API Overview
The CS-Deployment API contains modules, classes, functions, and variables that are documented by using the Python best practices. You can use the available context-sensitive help when you use tools such as Visual Studio Code that display the documentation embedded in the code.
Modules, classes, functions, and variables that are named with an underscore “_” prefix are considered internal implementation level code. Their details are subject to change in future releases and any changes may not be compatible with an earlier version.
The csdeploy Python package contains the CS-Deployment API code. The various modules under this
package are as follows:
audit- Includes anAuditLoggerclass and related code to provide audit logging functionality.exporter- Contains theExporterclass and related code that carries out the export operation.gqlinvoke- Contains classes that represent a connection to a GraphQL server and runs GraphQL requests.imexmap- Provides mapping functionality to map certain objects that are encountered when you export from a source environment to the corresponding objects during import into a destination environment.importer- Contains theImporterclass and related code that carries out the import operation.pkg- Defines classes that make the deployment package to capture what is exported and imported.util- Defines utility classes and functions.
The main classes that are used during an API call are exposed directly from the
csdeploy package. These classes can be imported directly from
csdeploy individually or by importing all (*) from that package.
Exporter- Carries out the export operation.Importer- Carries out the import operation.GraphqlConnection- Defines the connection parameters to a GraphQL server and allows such things as an authentication token to be retrieved.DeploymentPackage- This holds the objects that are exported from a source environment and imported into a destination environment. It can be saved to a file and loaded from a file.ExportSelection- Defines what object or objects to export. This forms the initial user selection. More dependencies are analyzed based on this selection.ImportOptions- Defines various options that can control the import operation.AuditLogger- Allows the capture of certain information in an audit log.SelectionType- When not selecting specific objects to export, this selection type specifies that all application-defined objects, or all objects later than a certain timestamp be exported.ObjectType- Defines a metadata object type like a class definition, property template, or choice list.logging- The standard python logging module. This is not part of thecsdeploypackage but can be imported fromcsdeployfor convenience.
Limitations
- The metadata objects that can be exported and imported by using the API are limited to class definitions, property templates, and choice lists.
- The
AuditDefinitionsproperty of aSubscribableClassDefinitioncannot be exported or imported. - The
MarkingSetproperty of aPropertyTemplateStringcannot be exported or imported. - During import, there is no option to override the Creator/LastModifier system properties.
- The
idof source and destination objects must match. There is no option to discover and map destination objects by name. - The security-related properties
OwnerandPermissions, and theDefaultInstanceOwnerandDefaultInstancePermissionsproperties of class definitions, cannot be exported or imported. There is no a mapping mechanism to map security principals from source to destination environment.The
GraphqlRequestclass does not currently support a POST using multi-part form content and uploading file content. - (Removed in V5.6 IF001) Application-specific modifications to system class definitions cannot be exported or imported.
- (Removed in V5.6 IF001) Application-specific modifications to add-on installed metadata objects cannot be exported or imported.
- (Removed in V5.6 IF001) Changes to inherited property definitions –overriding certain attributes of property definitions a class definition inherits from its superclass – cannot be exported or imported.
- (Removed in V5.6 IF001) Class definitions of class
CmRoleClassDefinitionare not supported and an error is returned if selected for export. When you select ALL application-defined class definitions, these class definitions are filtered out. - (Removed in V5.6 IF001) Some properties of
SubscribableClassDefinition, for example,AuditDefinitionsandChangePreprocessorDefinitionscannot be exported or imported.