百度智能云

All Product Document

          Baremetal Compute Sevice

          Deployment Set

          Create Deployment Set

          Use the following codes to create a deployment set based on the specified deployment set policy and concurrency.

          def create_deploy_set(self): 
              # Set the concurrency of deployment set, range [1,5] 
              concurrency = 1 
              # Set the policy for creating a deployment set. The BBC instance policy only supports: "tor_ha" 
              strategy = "tor_ha" 
              # Set the name of the deployment set 
              name = 'your-deploy-set-name' 
              # Set the description information of the created deployment set 
              desc='your-deploy-set-desc' 
              # If the user does not specify the client_token parameter, use uuid4 to generate a random string to the client_token 
              generate_client_token = str(uuid.uuid4()) 
              client_token = generate_client_token() 
              self.client.create_deploy_set(concurrency=concurrency, 
                                            strategy=strategy, 
                                            name=name, 
                                            desc=desc) 

          Query the List of Deployment Sets

          Use the following codes to query the list and detailed information of all deployment set instances.

          def list_deploy_sets(self): 
              # Perform query deployment set list operation 
              self.client.list_deploy_sets() 

          Query the Deployment Set Details

          Use the following codes to query the detailed information of the specified package.

          def get_deploy_set(self): 
              # Set the id of the deployment set you want to query 
              deploy_set_id = 'your-choose-deploy-set-id' 
              self.client.get_flavor(deploy_set_id=deploy_set_id) 

          Delete the Specified Deployment Set

          Use the following codes to delete the user's own specified deployment set.

          def delete_image(self): 
              # ID of the deployment set to delete 
              deploy_set_id='your-choose-deploy-set-id' 
              self.client.delete_deploy_set(deploy_set_id=deploy_set_id) 
          Previous
          Image
          Next
          Package