Project Deployer¶
Tutorials
You can find tutorials on this subject in the Developer Guide: Project deployment.
You will find a summary of the used classes and methods at the end of this document.
The starting point for the Project Deployer API documentation will be the DSSProjectDeployer class.
Project Deployer¶
Getting the Project Deployer¶
project_deployer = client.get_projectdeployer()
Listing deployments¶
Listing deployments on the Project Deployer.
for deployment in project_deployer.list_deployments():
print(f"Deployment id {deployment.id}")
Getting a deployment¶
Getting a handle to interact with a deployment.
DEPLOYMENT_ID = "" # Fill with your deployment id
deployment = project_deployer.get_deployment(DEPLOYMENT_ID)
Exporting a bundle¶
Exporting a bundle in a specific published project on the Project Deployer.
PROJECT_KEY = "" # Fill with your project key
project = client.get_project(PROJECT_KEY)
BUNDLE_ID = "" # Fill with the unique identifier for the bundle
release_notes = "" # Indicates the changes introduced by this bundle
bundle = project.export_bundle(BUNDLE_ID, release_notes)
Creating a published project¶
Creating a published project on the Project Deployer.
PUBLISHED_PROJECT_ID = "" # Fill with the identifier of the published project
published_project = project_deployer.create_project(PUBLISHED_PROJECT_ID)
Getting a published project¶
Getting a published project from the Project Deployer.
PUBLISHED_PROJECT_ID = "" # Fill with the identifier of the published project
published_project = project_deployer.get_project(PUBLISHED_PROJECT_ID)
Deleting a published project¶
Deleting a published project on the Project Deployer.
published_project.delete()
Publishing a bundle¶
Publishing an exported bundle to a published project on the Project Deployer.
PROJECT_KEY = "" # Fill with your project key
project = client.get_project(PROJECT_KEY)
BUNDLE_ID = "" # Fill with the unique identifier for the bundle
PUBLISHED_PROJECT_ID = "" # Fill with the identifier of the published project
published_project = project.publish_bundle(BUNDLE_ID, PUBLISHED_PROJECT_ID)
Creating a deployment¶
Creating a deployment and return the handle to interact with it.
DEPLOYMENT_ID = "" # Fill with your deployment id
PUBLISHED_PROJECT_ID = "" # Fill with the identifier of the published project
INFRA_ID = "" # Fill with the deployment id you chose
BUNDLE_ID = "" # Fill with the unique identifier for the bundle
deployment = project_deployer.create_deployment(deployment_id=DEPLOYMENT_ID, project_key=PUBLISHED_PROJECT_ID, infra_id=INFRA_ID, bundle_id=BUNDLE_ID, ignore_warnings=True)
# Once created, you need to trigger the update mechanism.
update = deployment.start_update()
update.wait_for_result()
print(f"Deployment state: {update.state}")
Deployment infrastructures¶
Listing stages¶
Listing the possible stages for infrastructures.
project_deployer.list_stages()
Listing deployment infrastructures¶
Listing the infrastructures on the Project Deployer.
for infra in project_deployer.list_infras():
print(f"Infrastructure id: {infra.id}")
Getting a deployment infrastructure¶
Getting a handle to interact with an infrastructure.
INFRA_ID = "" # Fill with the unique identifier of the infrastructure
infra = project_deployer.get_infra(INFRA_ID)
Creating a deployment infrastructure¶
Creating a new infrastructure and returns the handle to interact with it.
INFRA_ID = "" # Fill with the unique identifier of the infrastructure to create
STAGE_ID = "" # Fill with the stage of the infrastructure to create
GOVERN_CHECK_POLICY = "" # Fill with the policy that Govern will apply. possible values: PREVENT, WARN, or NO_CHECK
infra = project_deployer.create_infra(INFRA_ID, STAGE_ID, GOVERN_CHECK_POLICY)
Published Projects¶
Listing published projects¶
Listing published projects on the Project Deployer.
for project in project_deployer.list_projects():
print(f"Published project: {project.id} - {project.project_key}")
Creating a published project¶
PUBLISHED_ID = "" # Fill with the unique identifier of the published project to create
published_project = project_deployer.create_project(PUBLISHED_ID)
Getting a published project¶
PUBLISHED_ID = "" # Fill with the unique identifier of the published project to create
published_project = project_deployer.
Deployment status¶
Getting the status of a deployment¶
DEPLOYMENT_ID = "" # Fillwith your deployment id
deployment = project_deployer.get_deployment(DEPLOYMENT_ID)
status = deployment.get_status()
Getting details on a deployment status¶
heavy = status.get_heavy()
deployment_id = heavy.get('deploymentId')
infra_id = heavy.get('infraId')
health = status.get_health()
if health == 'ERROR':
print(f"The deployment {deployment_id} deployed on infra {infra_id} has an error status.")
for message in status.get_health_messages().get('messages'):
print(f" {message.get('severity')}: {message.get('details')}")
Reference documentation¶
Classes¶
|
Entry point for the DSS API client |
|
A handle to interact with a project on the DSS instance. |
Handle to interact with the Project Deployer. |
|
|
A deployment on the Project Deployer. |
|
The settings of a Project Deployer deployment. |
|
The status of a deployment on the Project Deployer. |
An Automation infrastructure on the Project Deployer. |
|
|
The settings of an Automation infrastructure. |
|
The status of an Automation infrastructure. |
|
A published project on the Project Deployer. |
|
The settings of a published project. |
|
The status of a published project. |
Functions¶
|
Create a deployment and return the handle to interact with it. |
|
Create a new infrastructure and returns the handle to interact with it. |
|
Get a handle to interact with a deployment. |
Get the health of this deployment. |
|
Get messages about the health of this deployment |
|
Get the 'heavy' (full) status. |
|
Gets a handle to work with the Project Deployer |
|
Get status information about this deployment. |
|
|
List deployments on the Project Deployer. |
|
List the infrastructures on the Project Deployer. |
List the possible stages for infrastructures. |
