IBM Cloud API Docs

Introduction

IBM Cloud® projects are a named collection of configurations that are used to manage and deploy related resources and Infrastructure as Code (IaC). Projects ensure that the IaC is always managed, secure, and compliant. Use the API to create, manage, and deploy by using projects.

SDKs for Node, Python, and Go are available to make it easier to programmatically access the API from your code. The client libraries that are provided by the SDKs implement best practices for using the API and reduce the amount of code that you need to write. The tab for each language includes code examples that demonstrate how to use the client libraries.

For more information about using projects, see Learn about IaC deployments with projects.

Installing the Node SDK

npm install @ibm-cloud/project-node-client

View on GitHub

Installing the Python SDK

pip install ibm-project-sdk

Then in your code, you can import the service

from ibm_project_sdk.project_v1 import *

View on GitHub

Installing the Go SDK

Go modules (recommended): Add the following import in your code, and then run go build or go mod tidy

import (
	"github.com/IBM/project-go-sdk/projectv1"
)

Go get

go get -u github.com/IBM/project-go-sdk/1

View on GitHub

Endpoint URLs

The projects API uses the following global endpoint URL for all regions. When you call the API, add the path for each method to form the complete API endpoint for your requests. In the request examples, replace the {base_url} parameter with the endpoint URL.

https://projects.api.cloud.ibm.com

Example API request

curl --request POST --header "content-type: application/json" --header "accept: application/json" --header "authorization: Bearer <IAM_token>" --data "{\"query\":\"string\"}" --url "https://projects.api.cloud.ibm.com"

Replace <IAM token> in this example with your token value for your particular API call.

Authentication

The IBM Cloud projects API uses IBM Cloud Identity and Access Management (IAM) to authenticate requests.

To work with the API, authenticate your application or service by including your IBM Cloud IAM access token in API requests. In the request examples, replace any {IAM_Token} and {iam_token} parameters with the access token that you obtained from IAM.

To call each method, you need to be assigned a role that includes the required IAM actions. Each method lists the associated action. For more information about IAM actions and how they map to roles, see Assigning access to account management services.

To retrieve your access token, replace <API_KEY> with your IAM API key:

curl -X POST   "https://iam.cloud.ibm.com/identity/token"   --header 'Content-Type: application/x-www-form-urlencoded'   --header 'Accept: application/json'   --data-urlencode 'grant_type=urn:ibm:params:oauth:grant-type:apikey'   --data-urlencode 'apikey=<API_KEY>'

To use the API, replace {IAM_Token} with the access token that you obtained from IAM, replace {http_method} with an HTTP method such as GET, and replace {url} with a request URL such as https://projects.api.cloud.ibm.com/projects?resource_group=Default&location=us-south":

curl -H "Authorization: Bearer {IAM_Token}" -X {http_method} "{url}"

Security scheme

Authentication to this API's methods uses one of the following security schemes.

basicAuth

Basic authentication: Set the IAM ID. Any IBM Cloud user can call the service broker API with a valid IAM ID.

Value
  • HTTP
  • Basic

selfCRNAuth

The self-CRN authorization.

Value
  • HTTP
  • Bearer

configCRNAuth

The config-CRN authorization.

Value
  • HTTP
  • Bearer

serviceEditorAuth

The service authorization with service IDs that have editor role permissions.

Value
  • HTTP
  • Bearer

serviceGhostAuth

The service authorization with service IDs for Ghost integration.

Value
  • HTTP
  • Bearer

serviceWebhookAuth

The service authorization with service IDs for webhook.

Value
  • HTTP
  • Bearer

userAuth

The user authorization level.

Value
  • HTTP
  • Bearer

Auditing

You can monitor API activity within your account by using the IBM Cloud Logs service. Whenever an API method is called, an event is generated that you can then track and audit from within IBM Cloud Logs. The specific event type is listed for each individual method.

For more information about tracking project activity, see Auditing events for projects.

Error handling

This API uses standard HTTP status codes to indicate whether a method completed successfully. A 400 type response indicates a failure, and a 500 type response indicates an internal system error.

Table 1. Error codes
HTTP Error Code Description Recovery
400 Bad Request The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all required parameters in your request.
401 Unauthorized You are not authorized to make this request. Log in to IBM Cloud and try again. If this error persists, contact the account owner to check your permissions.
403 Forbidden The supplied authentication is not authorized to access this resource.
404 Not Found The requested resource could not be found.
405 Method Not Allowed The requested resource doesn't support the request method.
408 Request Timeout The connection to the server timed out. Wait a few minutes, then try again.
409 Conflict The entity is already in the requested state.
410 Gone The requested resource is no longer available.
429 Too many requests Rate limiting in use. The user has sent too many requests.
500 Internal Server Error The request could not be completed by the server. It could be due to an internal error, or in some cases invalid data in the request.

Pagination

The IBM Cloud Projects API endpoints to list projects (GET /v1/projects), list configs (GET /v1/projects/{project_id}/configs), and list environments (GET /v1/projects/{project_id}/environments) can return many results. To improve performance, results are returned one page at a time, with a limited number of results on each page. The default page size is typically 10 items, with a maximum size of 100.

To specify a different page size, use the limit query parameter.

For a request that uses pagination, the response includes extra properties:

  • The first.href property links to the first page of resources
  • The next.href property links to the next page of resources (included for all pages except for the last page)

Use query parameters to page through your available resources and retrieve a subset of records. To retrieve the first page of results, make the request without specifying a token query parameter. If the results cannot fit on the first page, the response will include a next property, whose value can then be specified as the token parameter when the next page request is made. Each page of results is based on the resources that exist at the time of each paginated request. Therefore, the results might include resources that did not exist when the first request was made. The last page of results does not include a next property.

Rate limiting

Rate limits for API requests are enforced based on the number of requests from a user ID or client ID. If the number of requests from a particular user ID or client IP reaches the request limit within the specified time window, no further requests are accepted until the timer expires. After the timer expires, a new time window begins with the next accepted request.

The response to each HTTP request includes headers that you can use to determine whether you are close to the rate limit:

  • RateLimit-Reset: the time the current timer expires (in UNIX epoch time)
  • RateLimit-Remaining: the number of requests that remain in the current time window
  • RateLimit-Limit: the total number of requests that are allowed within the time window
  • Retry-After: the time to wait before a follow-up request is attempted

An HTTP status code of 429 indicates that the rate limit was exceeded.

The number of allowed requests and the length of the time window is the same for all methods and endpoints.

Change log

Important changes, such as additions, updates, and breaking changes, are marked with a change notice in this reference.

For a complete list of changes and improvements to this API, see the Projects API change log. Changes that require a new version are highlighted in the change log.

The configurations response models for all methods no longer use a pipeline_state. All status information of a configuration is available in the augmented state property in the canonical schema of a configuration. This update is a breaking change. For more information, see the Projects API change log for 6 November 2023.

Methods

Create a project

Create a new project and asynchronously setup the tools to manage it. Add a deployable architecture by customizing the configuration. After the changes are validated and approved, deploy the resources that the project configures. For more information, see Creating a project.

Create a new project and asynchronously setup the tools to manage it. Add a deployable architecture by customizing the configuration. After the changes are validated and approved, deploy the resources that the project configures. For more information, see Creating a project.

Create a new project and asynchronously setup the tools to manage it. Add a deployable architecture by customizing the configuration. After the changes are validated and approved, deploy the resources that the project configures. For more information, see Creating a project.

Create a new project and asynchronously setup the tools to manage it. Add a deployable architecture by customizing the configuration. After the changes are validated and approved, deploy the resources that the project configures. For more information, see Creating a project.

POST /v1/projects
create_project(
        self,
        definition: 'ProjectPrototypeDefinition',
        location: str,
        resource_group: str,
        *,
        configs: Optional[List['ProjectConfigPrototype']] = None,
        environments: Optional[List['EnvironmentPrototype']] = None,
        **kwargs,
    ) -> DetailedResponse
createProject(params)
(project *ProjectV1) CreateProject(createProjectOptions *CreateProjectOptions) (result *Project, response *core.DetailedResponse, err error)
(project *ProjectV1) CreateProjectWithContext(ctx context.Context, createProjectOptions *CreateProjectOptions) (result *Project, response *core.DetailedResponse, err error)

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies only to the project creation.

  • project.instance.create

Auditing

Calling this method generates the following auditing event.

  • project.project.create

Request

Instantiate the CreateProjectOptions struct and set the fields to provide parameter values for the CreateProject method.

A valid project definition document that adheres to the Project Definition schema.

Examples:

A project example request with configurations.

{
  "definition": {
    "name": "acme-microservice",
    "description": "A microservice to deploy on top of ACME infrastructure.",
    "authorizations": {
      "method": "trusted_profile",
      "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12"
    }
  },
  "configs": [
    {
      "definition": {
        "name": "account-stage",
        "description": "The stage account configuration.",
        "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global"
      }
    },
    {
      "definition": {
        "name": "env-stage",
        "description": "The stage environment configuration that includes services common to all the environment regions.",
        "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global",
        "inputs": {
          "account_id": "ref:/configs/account-stage/inputs/account_id",
          "resource_group": "stage",
          "access_tags": [
            "env:stage"
          ],
          "logdna_name": "The name of the LogDNA stage service instance.",
          "sysdig_name": "The name of the SysDig stage service instance."
        }
      }
    },
    {
      "definition": {
        "name": "region-us-south-stage",
        "description": "The stage us-south configuration.",
        "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global"
      }
    },
    {
      "definition": {
        "name": "region-eu-de-stage",
        "description": "The stage eu-de configuration.",
        "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global",
        "inputs": {
          "account_id": "ref:/configs/account-stage/inputs/account_id",
          "resource_group": "ref:/configs/env-stage/outputs/resource_group_id",
          "logdna_id": "ref:/configs/env-stage/outputs/logdna_id",
          "sysdig_id": "ref:/configs/env-stage/outputs/sysdig_id",
          "access_tags": [
            "region:eu-de"
          ]
        }
      }
    }
  ],
  "location": "us-south",
  "resource_group": "Default"
}

An empty project example request.

{
  "definition": {
    "name": "acme-microservice",
    "description": "A microservice to deploy on top of ACME infrastructure.",
    "authorizations": {
      "method": "trusted_profile",
      "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12"
    }
  },
  "location": "us-south",
  "resource_group": "Default"
}

An example request for project configurations environments.

{
  "definition": {
    "name": "acme-microservice",
    "description": "A microservice to deploy on top of ACME infrastructure."
  },
  "environments": [
    {
      "definition": {
        "name": "development",
        "description": "The 'development' environment.",
        "authorizations": {
          "method": "trusted_profile",
          "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12"
        },
        "inputs": {
          "resource_group": "stage",
          "region": "us-south"
        }
      }
    },
    {
      "definition": {
        "name": "production",
        "description": "The production environment."
      }
    }
  ],
  "location": "us-south",
  "resource_group": "Default"
}

A project example request for configurations by using a Schematics workspace.

{
  "definition": {
    "name": "acme-microservice",
    "description": "A microservice to deploy on top of ACME infrastructure.",
    "authorizations": {
      "method": "trusted_profile",
      "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12"
    }
  },
  "configs": [
    {
      "definition": {
        "name": "account-stage",
        "description": "The stage account configuration."
      },
      "schematics": {
        "workspace_crn": "crn:v1:staging:public:schematics:us-south:a/38acaf4469814090a4e675dc0c317a0d:95ad49de-ab96-4e7d-a08c-45c38aa448e6:workspace:us-south.workspace.service.e0106139"
      }
    }
  ],
  "location": "us-south",
  "resource_group": "Default"
}

parameters

  • The definition of the project.

  • The IBM Cloud location where a resource is deployed.

    Allowable values: [us-south,us-east,eu-gb,eu-de,ca-tor]

    Examples:
  • The resource group name where the project's data and tools are created.

    Possible values: 0 ≤ length ≤ 64, Value must match regular expression /^(?!\\s)(?!.*\\s$)[^'\"`<>{}\\x00-\\x1F]*$/

    Examples:
  • The project configurations. These configurations are included in the response of creating a project only if a configuration array is specified in the request payload.

    Possible values: 0 ≤ number of items ≤ 100

    Default: []

    Examples:
  • The project environment. These environments are included in the response of creating a project only if an environment array is specified in the request payload.

    Possible values: 0 ≤ number of items ≤ 20

    Default: []

parameters

  • The definition of the project.

  • The IBM Cloud location where a resource is deployed.

    Allowable values: [us-south,us-east,eu-gb,eu-de,ca-tor]

    Examples:
  • The resource group name where the project's data and tools are created.

    Possible values: 0 ≤ length ≤ 64, Value must match regular expression /^(?!\\s)(?!.*\\s$)[^'\"`<>{}\\x00-\\x1F]*$/

    Examples:
  • The project configurations. These configurations are included in the response of creating a project only if a configuration array is specified in the request payload.

    Possible values: 0 ≤ number of items ≤ 100

    Default: []

    Examples:
  • The project environment. These environments are included in the response of creating a project only if an environment array is specified in the request payload.

    Possible values: 0 ≤ number of items ≤ 20

    Default: []

WithContext method only

The CreateProject options.

  • curl -X POST --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "definition": { "name": "acme-microservice", "description": "A microservice to deploy on top of ACME infrastructure.", "authorizations": { "method": "trusted_profile", "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12" } }, "configs": [ { "definition": { "name": "account-stage", "description": "The stage account configuration.", "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global" } }, { "definition": { "name": "env-stage", "description": "The stage environment configuration that includes services common to all the environment regions.", "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global", "inputs": { "account_id": "ref:/configs/account-stage/inputs/account_id", "resource_group": "stage", "access_tags": [ "env:stage" ], "logdna_name": "The name of the LogDNA stage service instance.", "sysdig_name": "The name of the SysDig stage service instance." } } }, { "definition": { "name": "region-us-south-stage", "description": "The stage us-south configuration.", "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global" } }, { "definition": { "name": "region-eu-de-stage", "description": "The stage eu-de configuration.", "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global", "inputs": { "account_id": "ref:/configs/account-stage/inputs/account_id", "resource_group": "ref:/configs/env-stage/outputs/resource_group_id", "logdna_id": "ref:/configs/env-stage/outputs/logdna_id", "sysdig_id": "ref:/configs/env-stage/outputs/sysdig_id", "access_tags": [ "region:eu-de" ] } } } ], "location": "us-south", "resource_group": "Default" }'   "{base_url}/v1/projects"
  • projectPrototypeDefinitionModel := &projectv1.ProjectPrototypeDefinition{
      Name: core.StringPtr("acme-microservice"),
      Description: core.StringPtr("A microservice to deploy on top of ACME infrastructure."),
    }
    
    projectConfigDefinitionPrototypeModel := &projectv1.ProjectConfigDefinitionPrototypeDAConfigDefinitionPropertiesPrototype{
      LocatorID: core.StringPtr("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global"),
      Description: core.StringPtr("The stage account configuration."),
      Name: core.StringPtr("account-stage"),
    }
    
    projectConfigPrototypeModel := &projectv1.ProjectConfigPrototype{
      Definition: projectConfigDefinitionPrototypeModel,
    }
    
    createProjectOptions := projectService.NewCreateProjectOptions(
      projectPrototypeDefinitionModel,
      "us-south",
      "Default",
    )
    createProjectOptions.SetConfigs([]projectv1.ProjectConfigPrototype{*projectConfigPrototypeModel})
    
    project, response, err := projectService.CreateProject(createProjectOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(project, "", "  ")
    fmt.Println(string(b))
  • // Request models needed by this operation.
    
    // ProjectPrototypeDefinition
    const projectPrototypeDefinitionModel = {
      name: 'acme-microservice',
      description: 'A microservice to deploy on top of ACME infrastructure.',
    };
    
    // ProjectConfigDefinitionPrototypeDAConfigDefinitionPropertiesPrototype
    const projectConfigDefinitionPrototypeModel = {
      locator_id: '1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global',
      description: 'The stage account configuration.',
      name: 'account-stage',
    };
    
    // ProjectConfigPrototype
    const projectConfigPrototypeModel = {
      definition: projectConfigDefinitionPrototypeModel,
    };
    
    const params = {
      definition: projectPrototypeDefinitionModel,
      location: 'us-south',
      resourceGroup: 'Default',
      configs: [projectConfigPrototypeModel],
    };
    
    let res;
    try {
      res = await projectService.createProject(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • project_prototype_definition_model = {
      'name': 'acme-microservice',
      'description': 'A microservice to deploy on top of ACME infrastructure.',
    }
    
    project_config_definition_prototype_model = {
      'locator_id': '1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global',
      'description': 'The stage account configuration.',
      'name': 'account-stage',
    }
    
    project_config_prototype_model = {
      'definition': project_config_definition_prototype_model,
    }
    
    response = project_service.create_project(
      definition=project_prototype_definition_model,
      location='us-south',
      resource_group='Default',
      configs=[project_config_prototype_model],
    )
    project = response.get_result()
    
    print(json.dumps(project, indent=2))

Response

The standard schema of a project.

The standard schema of a project.

The standard schema of a project.

The standard schema of a project.

Status Code

  • OK

  • The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all the required parameters in your request.

  • The credentials are invalid or authentication is required to succeed.

  • The supplied authentication is not authorized to view this resource.

Example responses
  • The sample response to a request to retrieve an empty project.

    {
      "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
      "created_at": "2023-02-22T19:51:23.253Z",
      "modified_at": "2023-02-22T19:51:23.253Z",
      "href": "https://projects.service.url/v1/projects/cfbf901-ab8e-ac97-b01b-ab5af830be8a",
      "definition": {
        "name": "acme-microservice",
        "description": "A microservice to deploy on top of ACME infrastructure.",
        "auto_deploy": false,
        "destroy_on_delete": true,
        "monitoring_enabled": false
      },
      "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
      "cumulative_needs_attention_view": [],
      "configs": [],
      "environments": [],
      "location": "us-south",
      "resource_group": "Default",
      "resource_group_id": "f37d2637ea814cfd9a1742683a713d24",
      "state": "ready"
    }
  • The sample response to a request to retrieve an empty project.

    {
      "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
      "created_at": "2023-02-22T19:51:23.253Z",
      "modified_at": "2023-02-22T19:51:23.253Z",
      "href": "https://projects.service.url/v1/projects/cfbf901-ab8e-ac97-b01b-ab5af830be8a",
      "definition": {
        "name": "acme-microservice",
        "description": "A microservice to deploy on top of ACME infrastructure.",
        "auto_deploy": false,
        "destroy_on_delete": true,
        "monitoring_enabled": false
      },
      "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
      "cumulative_needs_attention_view": [],
      "configs": [],
      "environments": [],
      "location": "us-south",
      "resource_group": "Default",
      "resource_group_id": "f37d2637ea814cfd9a1742683a713d24",
      "state": "ready"
    }
  • The sample response to a request to retrieve a project with configurations.

    {
      "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
      "created_at": "2023-02-22T19:51:23.253Z",
      "modified_at": "2023-02-22T19:51:23.253Z",
      "href": "https://projects.service.url/v1/projects/cfbf901-ab8e-ac97-b01b-ab5af830be8a",
      "definition": {
        "name": "acme-microservice",
        "description": "A microservice to deploy on top of ACME infrastructure.",
        "auto_deploy": false,
        "destroy_on_delete": true,
        "monitoring_enabled": false
      },
      "cumulative_needs_attention_view": [],
      "configs": [
        {
          "id": "673d79e4-52bf-4184-b8e9-d3ca3c110f96",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "common-variables",
            "description": "The common-variables configuration."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/673d79e4-52bf-4184-b8e9-d3ca3c110f96",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "modified_at": "2023-02-22T19:51:23.253Z",
          "update_available": false,
          "version": 1
        },
        {
          "id": "4a1d4ba2-54ba-43a7-975a-d82b5a7612d1",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "account-stage",
            "description": "The stage account configuration. The stage account hosts test environments prestage, performance, stage."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/4a1d4ba2-54ba-43a7-975a-d82b5a7612d1",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        },
        {
          "id": "293c3c36-a094-4115-a12b-de0a9ca39be5",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "env-stage",
            "description": "The stage environment configuration. It includes services that are common to all the environment regions."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/293c3c36-a094-4115-a12b-de0a9ca39be5",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        },
        {
          "id": "596e8656-9d4b-41a5-8340-b0cbe8bd374a",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "region-us-south-stage",
            "description": "The stage `us-south` configuration. You must have a blueprint that configures the Virtual Private Cloud and Red Hat OpenShift stage us-south."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/596e8656-9d4b-41a5-8340-b0cbe8bd374a",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        },
        {
          "id": "9c7afed6-17fb-4c56-a13d-440a78f936bd",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "region-eu-de-stage",
            "description": "The stage `eu-de` configuration. You must have a blueprint that configures the Virtual Private Cloud and Red Hat OpenShift stage `eu-de`."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/9c7afed6-17fb-4c56-a13d-440a78f936bd",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        }
      ],
      "environments": [],
      "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
      "location": "us-south",
      "resource_group": "Default",
      "resource_group_id": "f37d2637ea814cfd9a1742683a713d24",
      "state": "ready"
    }
  • The sample response to a request to retrieve a project with configurations.

    {
      "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
      "created_at": "2023-02-22T19:51:23.253Z",
      "modified_at": "2023-02-22T19:51:23.253Z",
      "href": "https://projects.service.url/v1/projects/cfbf901-ab8e-ac97-b01b-ab5af830be8a",
      "definition": {
        "name": "acme-microservice",
        "description": "A microservice to deploy on top of ACME infrastructure.",
        "auto_deploy": false,
        "destroy_on_delete": true,
        "monitoring_enabled": false
      },
      "cumulative_needs_attention_view": [],
      "configs": [
        {
          "id": "673d79e4-52bf-4184-b8e9-d3ca3c110f96",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "common-variables",
            "description": "The common-variables configuration."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/673d79e4-52bf-4184-b8e9-d3ca3c110f96",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "modified_at": "2023-02-22T19:51:23.253Z",
          "update_available": false,
          "version": 1
        },
        {
          "id": "4a1d4ba2-54ba-43a7-975a-d82b5a7612d1",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "account-stage",
            "description": "The stage account configuration. The stage account hosts test environments prestage, performance, stage."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/4a1d4ba2-54ba-43a7-975a-d82b5a7612d1",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        },
        {
          "id": "293c3c36-a094-4115-a12b-de0a9ca39be5",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "env-stage",
            "description": "The stage environment configuration. It includes services that are common to all the environment regions."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/293c3c36-a094-4115-a12b-de0a9ca39be5",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        },
        {
          "id": "596e8656-9d4b-41a5-8340-b0cbe8bd374a",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "region-us-south-stage",
            "description": "The stage `us-south` configuration. You must have a blueprint that configures the Virtual Private Cloud and Red Hat OpenShift stage us-south."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/596e8656-9d4b-41a5-8340-b0cbe8bd374a",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        },
        {
          "id": "9c7afed6-17fb-4c56-a13d-440a78f936bd",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "region-eu-de-stage",
            "description": "The stage `eu-de` configuration. You must have a blueprint that configures the Virtual Private Cloud and Red Hat OpenShift stage `eu-de`."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/9c7afed6-17fb-4c56-a13d-440a78f936bd",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        }
      ],
      "environments": [],
      "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
      "location": "us-south",
      "resource_group": "Default",
      "resource_group_id": "f37d2637ea814cfd9a1742683a713d24",
      "state": "ready"
    }
  • The sample response to a request to retrieve a project with environments.

    {
      "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
      "created_at": "2023-02-22T19:51:23.253Z",
      "modified_at": "2023-02-22T19:51:23.253Z",
      "href": "https://projects.service.url/v1/projects/cfbf901-ab8e-ac97-b01b-ab5af830be8a",
      "definition": {
        "name": "acme-microservice",
        "description": "A microservice to deploy on top of ACME infrastructure.",
        "auto_deploy": false,
        "destroy_on_delete": true,
        "monitoring_enabled": false
      },
      "cumulative_needs_attention_view": [],
      "configs": [],
      "environments": [
        {
          "id": "b0c44146-1ef6-40c2-82ba-74d51149770a",
          "definition": {
            "name": "development",
            "description": "The development environment."
          },
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "acme-microservice"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "created_at": "2023-02-10T10:05:35.787Z",
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/environments/b0c44146-1ef6-40c2-82ba-74d51149770a"
        },
        {
          "id": "9c7afed6-17fb-4c56-a13d-440a78f936bd",
          "definition": {
            "name": "production",
            "description": "The production environment."
          },
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "acme-microservice"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "created_at": "2023-02-10T10:05:35.787Z",
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/environments/9c7afed6-17fb-4c56-a13d-440a78f936bd"
        }
      ],
      "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
      "location": "us-south",
      "resource_group": "Default",
      "resource_group_id": "f37d2637ea814cfd9a1742683a713d24",
      "state": "ready"
    }
  • The sample response to a request to retrieve a project with environments.

    {
      "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
      "created_at": "2023-02-22T19:51:23.253Z",
      "modified_at": "2023-02-22T19:51:23.253Z",
      "href": "https://projects.service.url/v1/projects/cfbf901-ab8e-ac97-b01b-ab5af830be8a",
      "definition": {
        "name": "acme-microservice",
        "description": "A microservice to deploy on top of ACME infrastructure.",
        "auto_deploy": false,
        "destroy_on_delete": true,
        "monitoring_enabled": false
      },
      "cumulative_needs_attention_view": [],
      "configs": [],
      "environments": [
        {
          "id": "b0c44146-1ef6-40c2-82ba-74d51149770a",
          "definition": {
            "name": "development",
            "description": "The development environment."
          },
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "acme-microservice"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "created_at": "2023-02-10T10:05:35.787Z",
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/environments/b0c44146-1ef6-40c2-82ba-74d51149770a"
        },
        {
          "id": "9c7afed6-17fb-4c56-a13d-440a78f936bd",
          "definition": {
            "name": "production",
            "description": "The production environment."
          },
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "acme-microservice"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "created_at": "2023-02-10T10:05:35.787Z",
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/environments/9c7afed6-17fb-4c56-a13d-440a78f936bd"
        }
      ],
      "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
      "location": "us-south",
      "resource_group": "Default",
      "resource_group_id": "f37d2637ea814cfd9a1742683a713d24",
      "state": "ready"
    }

List projects

List existing projects. Projects are sorted by ID.

List existing projects. Projects are sorted by ID.

List existing projects. Projects are sorted by ID.

List existing projects. Projects are sorted by ID.

GET /v1/projects
list_projects(
        self,
        *,
        token: Optional[str] = None,
        limit: Optional[int] = None,
        **kwargs,
    ) -> DetailedResponse
listProjects(params)
(project *ProjectV1) ListProjects(listProjectsOptions *ListProjectsOptions) (result *ProjectCollection, response *core.DetailedResponse, err error)
(project *ProjectV1) ListProjectsWithContext(ctx context.Context, listProjectsOptions *ListProjectsOptions) (result *ProjectCollection, response *core.DetailedResponse, err error)

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies only to getting projects.

  • project.instance.retrieve-all

Auditing

Calling this method generates the following auditing event.

  • project.project.list

Request

Instantiate the ListProjectsOptions struct and set the fields to provide parameter values for the ListProjects method.

Query Parameters

  • The server uses this parameter to determine the first entry that is returned on the next page. If this parameter is not specified, the logical first page is returned.

    Possible values: 0 ≤ length ≤ 1536, Value must match regular expression ^$|^(?!\s)(?!.*\s$)[^\x00-\x1F]*$

    Default:

  • The maximum number of resources to return. The number of resources that are returned is the same, except for the last page.

    Possible values: 1 ≤ value ≤ 100

    Default: 10

parameters

  • The server uses this parameter to determine the first entry that is returned on the next page. If this parameter is not specified, the logical first page is returned.

    Possible values: 0 ≤ length ≤ 1536, Value must match regular expression /^$|^(?!\\s)(?!.*\\s$)[^\\x00-\\x1F]*$/

    Default:

  • The maximum number of resources to return. The number of resources that are returned is the same, except for the last page.

    Possible values: 1 ≤ value ≤ 100

    Default: 10

parameters

  • The server uses this parameter to determine the first entry that is returned on the next page. If this parameter is not specified, the logical first page is returned.

    Possible values: 0 ≤ length ≤ 1536, Value must match regular expression /^$|^(?!\\s)(?!.*\\s$)[^\\x00-\\x1F]*$/

    Default:

  • The maximum number of resources to return. The number of resources that are returned is the same, except for the last page.

    Possible values: 1 ≤ value ≤ 100

    Default: 10

WithContext method only

The ListProjects options.

  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/v1/projects"
  • listProjectsOptions := &projectv1.ListProjectsOptions{
      Limit: core.Int64Ptr(int64(10)),
    }
    
    pager, err := projectService.NewProjectsPager(listProjectsOptions)
    if err != nil {
      panic(err)
    }
    
    var allResults []projectv1.ProjectSummary
    for pager.HasNext() {
      nextPage, err := pager.GetNext()
      if err != nil {
        panic(err)
      }
      allResults = append(allResults, nextPage...)
    }
    b, _ := json.MarshalIndent(allResults, "", "  ")
    fmt.Println(string(b))
  • const params = {
      limit: 10,
    };
    
    const allResults = [];
    try {
      const pager = new ProjectV1.ProjectsPager(projectService, params);
      while (pager.hasNext()) {
        const nextPage = await pager.getNext();
        expect(nextPage).not.toBeNull();
        allResults.push(...nextPage);
      }
      console.log(JSON.stringify(allResults, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • all_results = []
    pager = ProjectsPager(
      client=project_service,
      limit=10,
    )
    while pager.has_next():
      next_page = pager.get_next()
      assert next_page is not None
      all_results.extend(next_page)
    
    print(json.dumps(all_results, indent=2))

Response

Projects list

Projects list.

Projects list.

Projects list.

Status Code

  • The request was successful.

  • The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all the required parameters in your request.

  • The credentials are invalid or authentication is required to succeed.

  • The supplied authentication is not authorized to view this resource.

Example responses
  • An example request to list projects.

    {
      "limit": 10,
      "first": {
        "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
      },
      "next": {
        "href": "https://projects.api.cloud.ibm.com/v1/projects/12349050-1234-ac97-0000-ba5a12fe9087"
      },
      "projects": [
        {
          "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
          "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
          "created_at": "2023-02-22T19:51:23.253Z",
          "modified_at": "2023-02-22T19:51:23.253Z",
          "href": "https://projects.service.url/v1/projects/cfbf901-ab8e-ac97-b01b-ab5af830be8a",
          "definition": {
            "description": "A project example.",
            "name": "iaas-infra-prestage-env",
            "auto_deploy": false,
            "destroy_on_delete": false,
            "monitoring_enabled": false
          },
          "location": "us-south",
          "state": "ready",
          "resource_group": "Default",
          "resource_group_id": "f37d2637ea814cfd9a1742683a713d24",
          "cumulative_needs_attention_view": [
            {
              "event": "project.instance.update"
            },
            {
              "event_id": "489f0090-6d7c-4af5-8f20-9106543e4974"
            },
            {
              "config_id": "069ab83e-5016-4bf2-bd50-cc95cf678293"
            },
            {
              "config_version": 1
            }
          ]
        },
        {
          "id": "1123ed42-4356-efa1-1101-235900fe9087",
          "created_at": "2023-02-22T19:51:23.253Z",
          "modified_at": "2023-02-22T19:51:23.253Z",
          "href": "https://projects.service.url/v1/projects/cfbf901-ab8e-ac97-b01b-ab5af830be8a",
          "definition": {
            "description": "A project example.",
            "name": "iaas-infra-stage-env",
            "auto_deploy": false,
            "destroy_on_delete": false,
            "monitoring_enabled": false
          },
          "crn": "crn:v1:staging:public:project:eu-de:a/06580d923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
          "location": "eu-gb",
          "state": "ready",
          "resource_group": "Default",
          "resource_group_id": "f37d2637ea814cfd9a1742683a713d24",
          "cumulative_needs_attention_view": []
        }
      ]
    }
  • An example request to list projects.

    {
      "limit": 10,
      "first": {
        "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
      },
      "next": {
        "href": "https://projects.api.cloud.ibm.com/v1/projects/12349050-1234-ac97-0000-ba5a12fe9087"
      },
      "projects": [
        {
          "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
          "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
          "created_at": "2023-02-22T19:51:23.253Z",
          "modified_at": "2023-02-22T19:51:23.253Z",
          "href": "https://projects.service.url/v1/projects/cfbf901-ab8e-ac97-b01b-ab5af830be8a",
          "definition": {
            "description": "A project example.",
            "name": "iaas-infra-prestage-env",
            "auto_deploy": false,
            "destroy_on_delete": false,
            "monitoring_enabled": false
          },
          "location": "us-south",
          "state": "ready",
          "resource_group": "Default",
          "resource_group_id": "f37d2637ea814cfd9a1742683a713d24",
          "cumulative_needs_attention_view": [
            {
              "event": "project.instance.update"
            },
            {
              "event_id": "489f0090-6d7c-4af5-8f20-9106543e4974"
            },
            {
              "config_id": "069ab83e-5016-4bf2-bd50-cc95cf678293"
            },
            {
              "config_version": 1
            }
          ]
        },
        {
          "id": "1123ed42-4356-efa1-1101-235900fe9087",
          "created_at": "2023-02-22T19:51:23.253Z",
          "modified_at": "2023-02-22T19:51:23.253Z",
          "href": "https://projects.service.url/v1/projects/cfbf901-ab8e-ac97-b01b-ab5af830be8a",
          "definition": {
            "description": "A project example.",
            "name": "iaas-infra-stage-env",
            "auto_deploy": false,
            "destroy_on_delete": false,
            "monitoring_enabled": false
          },
          "crn": "crn:v1:staging:public:project:eu-de:a/06580d923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
          "location": "eu-gb",
          "state": "ready",
          "resource_group": "Default",
          "resource_group_id": "f37d2637ea814cfd9a1742683a713d24",
          "cumulative_needs_attention_view": []
        }
      ]
    }

Get a project

Get information about a project.

Get information about a project.

Get information about a project.

Get information about a project.

GET /v1/projects/{id}
get_project(
        self,
        id: str,
        **kwargs,
    ) -> DetailedResponse
getProject(params)
(project *ProjectV1) GetProject(getProjectOptions *GetProjectOptions) (result *Project, response *core.DetailedResponse, err error)
(project *ProjectV1) GetProjectWithContext(ctx context.Context, getProjectOptions *GetProjectOptions) (result *Project, response *core.DetailedResponse, err error)

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies only to getting a project.

  • project.instance.retrieve

Auditing

Calling this method generates the following auditing event.

  • project.project.read

Request

Instantiate the GetProjectOptions struct and set the fields to provide parameter values for the GetProject method.

Path Parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression /^[\\.\\-0-9a-zA-Z]+$/

parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression /^[\\.\\-0-9a-zA-Z]+$/

WithContext method only

The GetProject options.

  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/v1/projects/{id}"
  • getProjectOptions := projectService.NewGetProjectOptions(
      projectIdLink,
    )
    
    project, response, err := projectService.GetProject(getProjectOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(project, "", "  ")
    fmt.Println(string(b))
  • const params = {
      id: projectIdLink,
    };
    
    let res;
    try {
      res = await projectService.getProject(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • response = project_service.get_project(
      id=project_id_link,
    )
    project = response.get_result()
    
    print(json.dumps(project, indent=2))

Response

The standard schema of a project.

The standard schema of a project.

The standard schema of a project.

The standard schema of a project.

Status Code

  • The request was successful.

  • The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all the required parameters in your request.

  • The credentials are invalid or authentication is required to succeed.

  • The supplied authentication is not authorized to view this resource.

Example responses
  • A sample response for retrieving a project with configurations.

    {
      "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
      "created_at": "2023-02-22T19:51:23.253Z",
      "modified_at": "2023-02-22T19:51:23.253Z",
      "href": "https://projects.service.url/v1/projects/cfbf901-ab8e-ac97-b01b-ab5af830be8a",
      "definition": {
        "name": "acme-microservice",
        "description": "A microservice to deploy on top of ACME infrastructure.",
        "auto_deploy": false,
        "destroy_on_delete": true,
        "monitoring_enabled": false
      },
      "configs": [
        {
          "id": "673d79e4-52bf-4184-b8e9-d3ca3c110f96",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "common-variables",
            "description": "The common-variables configuration."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/673d79e4-52bf-4184-b8e9-d3ca3c110f96",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "modified_at": "2023-02-22T19:51:23.253Z",
          "update_available": false,
          "version": 1
        },
        {
          "id": "4a1d4ba2-54ba-43a7-975a-d82b5a7612d1",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "account-stage",
            "description": "The stage account configuration. The stage account hosts test environments prestage, performance, stage. This configuration configures services that are common to all these environments and regions. It's a `terraform_template` type of configuration that points to a GitHub repository that hosts the terraform modules that a Schematics workspace can deploy."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/4a1d4ba2-54ba-43a7-975a-d82b5a7612d1",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        },
        {
          "id": "293c3c36-a094-4115-a12b-de0a9ca39be5",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "env-stage",
            "description": "The stage environment configuration. It includes services that are common to all the environment regions. You must have a blueprint that configures all the services that are common to the stage regions. It's a `terraform_template` type of configuration that points to a GitHub repository that hosts the Terraform modules that a Schematics workspace can deploy."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/293c3c36-a094-4115-a12b-de0a9ca39be5",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        },
        {
          "id": "596e8656-9d4b-41a5-8340-b0cbe8bd374a",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "region-us-south-stage",
            "description": "The stage `us-south` configuration. You must have a blueprint that configures the Virtual Private Cloud and Red Hat OpenShift stage `us-south`."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/596e8656-9d4b-41a5-8340-b0cbe8bd374a",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        },
        {
          "id": "9c7afed6-17fb-4c56-a13d-440a78f936bd",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "region-eu-de-stage",
            "description": "The stage `eu-de` configuration. You must have a blueprint that configures the Virtual Private Cloud and Red Hat OpenShift stage `eu-de`."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/9c7afed6-17fb-4c56-a13d-440a78f936bd",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        }
      ],
      "environments": [
        {
          "id": "b0c44146-1ef6-40c2-82ba-74d51149770a",
          "definition": {
            "name": "dev-environment",
            "description": "The development environment."
          },
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "created_at": "2023-02-10T10:05:35.787Z",
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/environments/b0c44146-1ef6-40c2-82ba-74d51149770a"
        }
      ],
      "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
      "cumulative_needs_attention_view": [
        {
          "event": "project.instance.update"
        },
        {
          "event_id": "489f0090-6d7c-4af5-8f20-9106543e4974"
        },
        {
          "config_id": "069ab83e-5016-4bf2-bd50-cc95cf678293"
        },
        {
          "config_version": 1
        }
      ],
      "event_notifications_crn": "crn:v1:staging:public:event-notifications:us-south:a/06580c923e40314421d3b6cb40c01c68:instance-id::",
      "location": "us-south",
      "resource_group": "Default",
      "resource_group_id": "f37d2637ea814cfd9a1742683a713d24",
      "state": "ready"
    }
  • A sample response for retrieving a project with configurations.

    {
      "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
      "created_at": "2023-02-22T19:51:23.253Z",
      "modified_at": "2023-02-22T19:51:23.253Z",
      "href": "https://projects.service.url/v1/projects/cfbf901-ab8e-ac97-b01b-ab5af830be8a",
      "definition": {
        "name": "acme-microservice",
        "description": "A microservice to deploy on top of ACME infrastructure.",
        "auto_deploy": false,
        "destroy_on_delete": true,
        "monitoring_enabled": false
      },
      "configs": [
        {
          "id": "673d79e4-52bf-4184-b8e9-d3ca3c110f96",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "common-variables",
            "description": "The common-variables configuration."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/673d79e4-52bf-4184-b8e9-d3ca3c110f96",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "modified_at": "2023-02-22T19:51:23.253Z",
          "update_available": false,
          "version": 1
        },
        {
          "id": "4a1d4ba2-54ba-43a7-975a-d82b5a7612d1",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "account-stage",
            "description": "The stage account configuration. The stage account hosts test environments prestage, performance, stage. This configuration configures services that are common to all these environments and regions. It's a `terraform_template` type of configuration that points to a GitHub repository that hosts the terraform modules that a Schematics workspace can deploy."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/4a1d4ba2-54ba-43a7-975a-d82b5a7612d1",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        },
        {
          "id": "293c3c36-a094-4115-a12b-de0a9ca39be5",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "env-stage",
            "description": "The stage environment configuration. It includes services that are common to all the environment regions. You must have a blueprint that configures all the services that are common to the stage regions. It's a `terraform_template` type of configuration that points to a GitHub repository that hosts the Terraform modules that a Schematics workspace can deploy."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/293c3c36-a094-4115-a12b-de0a9ca39be5",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        },
        {
          "id": "596e8656-9d4b-41a5-8340-b0cbe8bd374a",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "region-us-south-stage",
            "description": "The stage `us-south` configuration. You must have a blueprint that configures the Virtual Private Cloud and Red Hat OpenShift stage `us-south`."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/596e8656-9d4b-41a5-8340-b0cbe8bd374a",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        },
        {
          "id": "9c7afed6-17fb-4c56-a13d-440a78f936bd",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "region-eu-de-stage",
            "description": "The stage `eu-de` configuration. You must have a blueprint that configures the Virtual Private Cloud and Red Hat OpenShift stage `eu-de`."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/9c7afed6-17fb-4c56-a13d-440a78f936bd",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        }
      ],
      "environments": [
        {
          "id": "b0c44146-1ef6-40c2-82ba-74d51149770a",
          "definition": {
            "name": "dev-environment",
            "description": "The development environment."
          },
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "created_at": "2023-02-10T10:05:35.787Z",
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/environments/b0c44146-1ef6-40c2-82ba-74d51149770a"
        }
      ],
      "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
      "cumulative_needs_attention_view": [
        {
          "event": "project.instance.update"
        },
        {
          "event_id": "489f0090-6d7c-4af5-8f20-9106543e4974"
        },
        {
          "config_id": "069ab83e-5016-4bf2-bd50-cc95cf678293"
        },
        {
          "config_version": 1
        }
      ],
      "event_notifications_crn": "crn:v1:staging:public:event-notifications:us-south:a/06580c923e40314421d3b6cb40c01c68:instance-id::",
      "location": "us-south",
      "resource_group": "Default",
      "resource_group_id": "f37d2637ea814cfd9a1742683a713d24",
      "state": "ready"
    }

Update a project

Update a project by specifying its ID.

Update a project by specifying its ID.

Update a project by specifying its ID.

Update a project by specifying its ID.

PATCH /v1/projects/{id}
update_project(
        self,
        id: str,
        definition: 'ProjectPatchDefinitionBlock',
        **kwargs,
    ) -> DetailedResponse
updateProject(params)
(project *ProjectV1) UpdateProject(updateProjectOptions *UpdateProjectOptions) (result *Project, response *core.DetailedResponse, err error)
(project *ProjectV1) UpdateProjectWithContext(ctx context.Context, updateProjectOptions *UpdateProjectOptions) (result *Project, response *core.DetailedResponse, err error)

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies only to updating projects.

  • project.instance.update

Auditing

Calling this method generates the following auditing event.

  • project.project.update

Request

Instantiate the UpdateProjectOptions struct and set the fields to provide parameter values for the UpdateProject method.

Path Parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

The request body of the new project definition document.

Examples:

A project update example request.

{
  "definition": {
    "name": "acme-microservice",
    "description": "A microservice to deploy on top of ACME infrastructure.",
    "authorizations": {
      "method": "trusted_profile",
      "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12"
    }
  }
}

parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression /^[\\.\\-0-9a-zA-Z]+$/

  • The definition of the project.

parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression /^[\\.\\-0-9a-zA-Z]+$/

  • The definition of the project.

WithContext method only

The UpdateProject options.

  • curl -X PATCH --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "definition": { "name": "acme-microservice", "description": "A microservice to deploy on top of ACME infrastructure.", "authorizations": { "method": "trusted_profile", "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12" } } }'   "{base_url}/v1/projects/{id}"
  • projectPatchDefinitionBlockModel := &projectv1.ProjectPatchDefinitionBlock{
      Name: core.StringPtr("acme-microservice"),
      Description: core.StringPtr("A microservice to deploy on top of ACME infrastructure."),
    }
    
    updateProjectOptions := projectService.NewUpdateProjectOptions(
      projectIdLink,
      projectPatchDefinitionBlockModel,
    )
    
    project, response, err := projectService.UpdateProject(updateProjectOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(project, "", "  ")
    fmt.Println(string(b))
  • // Request models needed by this operation.
    
    // ProjectPatchDefinitionBlock
    const projectPatchDefinitionBlockModel = {
      name: 'acme-microservice',
      description: 'A microservice to deploy on top of ACME infrastructure.',
    };
    
    const params = {
      id: projectIdLink,
      definition: projectPatchDefinitionBlockModel,
    };
    
    let res;
    try {
      res = await projectService.updateProject(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • project_patch_definition_block_model = {
      'name': 'acme-microservice',
      'description': 'A microservice to deploy on top of ACME infrastructure.',
    }
    
    response = project_service.update_project(
      id=project_id_link,
      definition=project_patch_definition_block_model,
    )
    project = response.get_result()
    
    print(json.dumps(project, indent=2))

Response

The standard schema of a project.

The standard schema of a project.

The standard schema of a project.

The standard schema of a project.

Status Code

  • The request was successful.

  • The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all the required parameters in your request.

  • The credentials are invalid or authentication is required to succeed.

  • The supplied authentication is not authorized to view this resource.

Example responses
  • A sample response for retrieving a project with configurations.

    {
      "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
      "created_at": "2023-02-22T19:51:23.253Z",
      "modified_at": "2023-02-22T19:51:23.253Z",
      "href": "https://projects.service.url/v1/projects/cfbf901-ab8e-ac97-b01b-ab5af830be8a",
      "definition": {
        "name": "acme-microservice",
        "description": "A microservice to deploy on top of ACME infrastructure.",
        "auto_deploy": false,
        "destroy_on_delete": true,
        "monitoring_enabled": false
      },
      "configs": [
        {
          "id": "673d79e4-52bf-4184-b8e9-d3ca3c110f96",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "common-variables",
            "description": "The common-variables configuration."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/673d79e4-52bf-4184-b8e9-d3ca3c110f96",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "modified_at": "2023-02-22T19:51:23.253Z",
          "update_available": false,
          "version": 1
        },
        {
          "id": "4a1d4ba2-54ba-43a7-975a-d82b5a7612d1",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "account-stage",
            "description": "The stage account configuration. The stage account hosts test environments prestage, performance, stage. This configuration configures services that are common to all these environments and regions. It's a `terraform_template` type of configuration that points to a GitHub repository that hosts the terraform modules that a Schematics workspace can deploy."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/4a1d4ba2-54ba-43a7-975a-d82b5a7612d1",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        },
        {
          "id": "293c3c36-a094-4115-a12b-de0a9ca39be5",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "env-stage",
            "description": "The stage environment configuration. It includes services that are common to all the environment regions. You must have a blueprint that configures all the services that are common to the stage regions. It's a `terraform_template` type of configuration that points to a GitHub repository that hosts the Terraform modules that a Schematics workspace can deploy."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/293c3c36-a094-4115-a12b-de0a9ca39be5",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        },
        {
          "id": "596e8656-9d4b-41a5-8340-b0cbe8bd374a",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "region-us-south-stage",
            "description": "The stage `us-south` configuration. You must have a blueprint that configures the Virtual Private Cloud and Red Hat OpenShift stage `us-south`."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/596e8656-9d4b-41a5-8340-b0cbe8bd374a",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        },
        {
          "id": "9c7afed6-17fb-4c56-a13d-440a78f936bd",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "region-eu-de-stage",
            "description": "The stage `eu-de` configuration. You must have a blueprint that configures the Virtual Private Cloud and Red Hat OpenShift stage `eu-de`."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/9c7afed6-17fb-4c56-a13d-440a78f936bd",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        }
      ],
      "environments": [
        {
          "id": "b0c44146-1ef6-40c2-82ba-74d51149770a",
          "definition": {
            "name": "dev-environment",
            "description": "The development environment."
          },
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "created_at": "2023-02-10T10:05:35.787Z",
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/environments/b0c44146-1ef6-40c2-82ba-74d51149770a"
        }
      ],
      "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
      "cumulative_needs_attention_view": [
        {
          "event": "project.instance.update"
        },
        {
          "event_id": "489f0090-6d7c-4af5-8f20-9106543e4974"
        },
        {
          "config_id": "069ab83e-5016-4bf2-bd50-cc95cf678293"
        },
        {
          "config_version": 1
        }
      ],
      "event_notifications_crn": "crn:v1:staging:public:event-notifications:us-south:a/06580c923e40314421d3b6cb40c01c68:instance-id::",
      "location": "us-south",
      "resource_group": "Default",
      "resource_group_id": "f37d2637ea814cfd9a1742683a713d24",
      "state": "ready"
    }
  • A sample response for retrieving a project with configurations.

    {
      "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
      "created_at": "2023-02-22T19:51:23.253Z",
      "modified_at": "2023-02-22T19:51:23.253Z",
      "href": "https://projects.service.url/v1/projects/cfbf901-ab8e-ac97-b01b-ab5af830be8a",
      "definition": {
        "name": "acme-microservice",
        "description": "A microservice to deploy on top of ACME infrastructure.",
        "auto_deploy": false,
        "destroy_on_delete": true,
        "monitoring_enabled": false
      },
      "configs": [
        {
          "id": "673d79e4-52bf-4184-b8e9-d3ca3c110f96",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "common-variables",
            "description": "The common-variables configuration."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/673d79e4-52bf-4184-b8e9-d3ca3c110f96",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "modified_at": "2023-02-22T19:51:23.253Z",
          "update_available": false,
          "version": 1
        },
        {
          "id": "4a1d4ba2-54ba-43a7-975a-d82b5a7612d1",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "account-stage",
            "description": "The stage account configuration. The stage account hosts test environments prestage, performance, stage. This configuration configures services that are common to all these environments and regions. It's a `terraform_template` type of configuration that points to a GitHub repository that hosts the terraform modules that a Schematics workspace can deploy."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/4a1d4ba2-54ba-43a7-975a-d82b5a7612d1",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        },
        {
          "id": "293c3c36-a094-4115-a12b-de0a9ca39be5",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "env-stage",
            "description": "The stage environment configuration. It includes services that are common to all the environment regions. You must have a blueprint that configures all the services that are common to the stage regions. It's a `terraform_template` type of configuration that points to a GitHub repository that hosts the Terraform modules that a Schematics workspace can deploy."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/293c3c36-a094-4115-a12b-de0a9ca39be5",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        },
        {
          "id": "596e8656-9d4b-41a5-8340-b0cbe8bd374a",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "region-us-south-stage",
            "description": "The stage `us-south` configuration. You must have a blueprint that configures the Virtual Private Cloud and Red Hat OpenShift stage `us-south`."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/596e8656-9d4b-41a5-8340-b0cbe8bd374a",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        },
        {
          "id": "9c7afed6-17fb-4c56-a13d-440a78f936bd",
          "created_at": "2023-02-22T19:51:23.253Z",
          "definition": {
            "name": "region-eu-de-stage",
            "description": "The stage `eu-de` configuration. You must have a blueprint that configures the Virtual Private Cloud and Red Hat OpenShift stage `eu-de`."
          },
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/9c7afed6-17fb-4c56-a13d-440a78f936bd",
          "is_draft": true,
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "state": "draft",
          "update_available": false,
          "modified_at": "2023-02-22T19:51:23.253Z",
          "version": 1
        }
      ],
      "environments": [
        {
          "id": "b0c44146-1ef6-40c2-82ba-74d51149770a",
          "definition": {
            "name": "dev-environment",
            "description": "The development environment."
          },
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "created_at": "2023-02-10T10:05:35.787Z",
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/environments/b0c44146-1ef6-40c2-82ba-74d51149770a"
        }
      ],
      "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
      "cumulative_needs_attention_view": [
        {
          "event": "project.instance.update"
        },
        {
          "event_id": "489f0090-6d7c-4af5-8f20-9106543e4974"
        },
        {
          "config_id": "069ab83e-5016-4bf2-bd50-cc95cf678293"
        },
        {
          "config_version": 1
        }
      ],
      "event_notifications_crn": "crn:v1:staging:public:event-notifications:us-south:a/06580c923e40314421d3b6cb40c01c68:instance-id::",
      "location": "us-south",
      "resource_group": "Default",
      "resource_group_id": "f37d2637ea814cfd9a1742683a713d24",
      "state": "ready"
    }

Delete a project

Delete a project document by specifying the ID. A project can be deleted only after you delete all of its resources.

Delete a project document by specifying the ID. A project can be deleted only after you delete all of its resources.

Delete a project document by specifying the ID. A project can be deleted only after you delete all of its resources.

Delete a project document by specifying the ID. A project can be deleted only after you delete all of its resources.

DELETE /v1/projects/{id}
delete_project(
        self,
        id: str,
        **kwargs,
    ) -> DetailedResponse
deleteProject(params)
(project *ProjectV1) DeleteProject(deleteProjectOptions *DeleteProjectOptions) (result *ProjectDeleteResponse, response *core.DetailedResponse, err error)
(project *ProjectV1) DeleteProjectWithContext(ctx context.Context, deleteProjectOptions *DeleteProjectOptions) (result *ProjectDeleteResponse, response *core.DetailedResponse, err error)

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

Delete a project instance by specifying its ID.

  • project.instance.delete

Auditing

Calling this method generates the following auditing event.

  • project.project.delete

Request

Instantiate the DeleteProjectOptions struct and set the fields to provide parameter values for the DeleteProject method.

Path Parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression /^[\\.\\-0-9a-zA-Z]+$/

parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression /^[\\.\\-0-9a-zA-Z]+$/

WithContext method only

The DeleteProject options.

  • curl -X DELETE --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/v1/projects/{id}"
  • deleteProjectOptions := projectService.NewDeleteProjectOptions(
      projectIdLink,
    )
    
    projectDeleteResponse, response, err := projectService.DeleteProject(deleteProjectOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(projectDeleteResponse, "", "  ")
    fmt.Println(string(b))
  • const params = {
      id: projectIdLink,
    };
    
    let res;
    try {
      res = await projectService.deleteProject(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • response = project_service.delete_project(
      id=project_id_link,
    )
    project_delete_response = response.get_result()
    
    print(json.dumps(project_delete_response, indent=2))

Response

The ID of the deleted project.

The ID of the deleted project.

The ID of the deleted project.

The ID of the deleted project.

Status Code

  • The server successfully accepted the request to process the resource.

  • The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all the required parameters in your request.

  • The credentials are invalid or authentication is required to succeed.

  • The supplied authentication is not authorized to view this resource.

  • The project cannot be deleted. You're receiving this response because at least one of the configurations is in an active pipeline state (validating/deploying/undeploying). Wait for these pipeline actions to end before you run the deletion again.

Example responses
  • The example response to a request to delete a project.

    {
      "id": "4059955c-ccb3-4fd3-aa48-34e3b8334f80"
    }
  • The example response to a request to delete a project.

    {
      "id": "4059955c-ccb3-4fd3-aa48-34e3b8334f80"
    }

Sync a project

Sync a project.

POST /v1/projects/{id}/sync

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies only to the syncing a project.

  • project.instance.sync

Auditing

Calling this method generates the following auditing event.

  • project.project.update

Request

Path Parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

Response

Status Code

  • The request was successful but the response is empty.

  • The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all the required parameters in your request.

  • The credentials are invalid or authentication is required to succeed.

  • The request cannot be processed because of a conflict between the request and the current client-controlled state in the system.

No Sample Response

This method does not specify any sample responses.

Get project spending

The spending data on a project

POST /v1/projects/{project_id}/spending

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action will reveal spending data on a project

  • project.spending.retrieve-all

Request

Path Parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

Query Parameters

  • The last entry that is returned on the page. The server uses this parameter to determine the first entry that is returned on the next page. If this parameter is not specified, the logical first page is returned.

    Possible values: 0 ≤ length ≤ 1536, Value must match regular expression ^$|^(?!\s)(?!.*\s$)[^\x00-\x1F]*$

    Default:

  • The maximum number of resources to return. The number of resources that are returned is the same, except for the last page.

    Possible values: 1 ≤ value ≤ 100

    Default: 10

Data to create a specified report

Response

The spending details on a project

Status Code

  • Success

  • Bad Request

Example responses
  • Sample spending API response.

    {
      "configs": [
        {
          "config_id": "some-config-id",
          "config_name": "config-1",
          "usage": [
            {
              "month": "2024-03",
              "limit": 30,
              "count": 4,
              "first": {
                "href": "/v4/accounts/some-account-id/resource_instances/usage/2024-03?_limit=30&_names=false&_tags=true"
              },
              "next": {
                "href": "/v4/accounts/some-account-id/resource_instances/usage/2024-03?_limit=30&_names=false&_start=some-long-start-string&_names=false&_tags=true",
                "offset": "some-offset-string"
              },
              "resources": [
                {
                  "account_id": "some-account-id",
                  "resource_instance_id": "crn:v1:staging:public:continuous-delivery:us-south:a/some-account-id:some-instance-id::",
                  "resource_group_id": "some-resource-group-id",
                  "month": "2024-03",
                  "pricing_country": "USA",
                  "billing_country": "USA",
                  "currency_code": "USD",
                  "plan_id": "some-plan-id",
                  "resource_id": "some-resource-id",
                  "billable": true,
                  "pricing_plan_id": "billable:v4:some-plan-id::some-pricing-id:",
                  "region": "us-south",
                  "usage": [
                    {
                      "metric": "AUTHORIZED_USERS_PER_MONTH",
                      "unit": "Authorized User",
                      "price": [
                        {
                          "unitQuantity": "1",
                          "tier_model": "Granular Tier",
                          "price": 37.7,
                          "quantity_tier": "1"
                        }
                      ],
                      "additional_properties": null,
                      "quantity": 0.3870967741935484,
                      "cost": 14.580414193548387,
                      "rated_cost": 14.593548387096774,
                      "rateable_quantity": 0.3870967741935484,
                      "discounts": [
                        {
                          "name": "platform discount",
                          "display_name": "platform discount",
                          "ref": "discount-some-discount-id",
                          "discount": 0.09
                        }
                      ]
                    }
                  ],
                  "currency_rate": 1,
                  "tags": null,
                  "service_tags": [
                    "project::config_id:some-config-id",
                    "project::project_id:some-project-id"
                  ]
                }
              ]
            }
          ]
        }
      ],
      "token": "some-token-string",
      "first": {
        "href": "https://projects.api.test.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/spending?limit=10"
      },
      "next": {
        "href": "https://projects.api.test.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/spending?limit=10&start=some-offset-string"
      }
    }

Resolve project references

Resolve project references.

POST /v1/resolve

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies to resolving project references.

  • project.instance.retrieve

Auditing

Calling this method generates the following auditing event.

  • project.project.read

Request

A batch of one or more references.

Examples:

The example of a request for a collection of project batch references.

{
  "references": [
    {
      "reference": "ref://project.myproject/configs/myconfig/inputs/region"
    },
    {
      "reference": "ref:./inputs/region",
      "context": "ref://project.myproject/configs/myconfig/"
    }
  ]
}

Response

The resolved batch reference collection.

Status Code

  • You successfully resolved project references.

  • The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all the required parameters in your request.

  • The credentials are invalid or authentication is required to succeed.

Example responses
  • The example of a resolved project batch reference collection.

    {
      "correlation_id": "3cd535c7-04a9-4198-a550-8b7737bf748a",
      "references": [
        {
          "reference": "ref://project.myproject/configs/myconfig/inputs/region",
          "state": "The project reference was resolved.",
          "code": 200,
          "request_id": "66c535c7-03a0-6144-b340-8e5737bf688c",
          "value": "us-south",
          "content_type": "text/plain"
        },
        {
          "reference": "ref:./inputs/region",
          "context": "ref://project.myproject/configs/myconfig/",
          "state": "The project reference was resolved.",
          "code": 200,
          "request_id": "66c535c7-03a0-6144-b340-8e5737bf688c",
          "value": "us-south",
          "content_type": "text/plain"
        },
        {
          "reference": "ref:./inputs/regionx",
          "context": "ref://project.myproject/configs/myconfig/",
          "state": "The project reference ref://project.myproject/configs/myconfig/inputs/regionx is invalid",
          "state_code": "INVALID_PROJECT_REFERENCE_ERROR",
          "code": 400,
          "request_id": "66c535c7-03a0-6144-b340-8e5737bf688c"
        }
      ]
    }

List allowed locations for project creation

Returns list of allowed locations that caller is allowed to create projects from.

GET /v1/locations

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies only to the project creation.

  • project.instance.create

Request

No Request Parameters

This method does not accept any request parameters.

Response

Response containing locations user is allowed to create projects from.

Status Code

  • The request was successful.

  • The credentials are invalid or authentication is required to succeed.

  • The request was not completed by the server. It could be due to an internal error or in some cases, invalid data in the request.

Example responses
  • The sample response for retrieving the allowed project locations for project creation.

    {
      "locations": [
        {
          "location": "us-south",
          "location_display_name": "Dallas"
        },
        {
          "location": "us-east",
          "location_display_name": "Washington DC"
        },
        {
          "location": "eu-de",
          "location_display_name": "Frankfurt"
        },
        {
          "location": "eu-gb",
          "location_display_name": "London"
        },
        {
          "location": "ca-tor",
          "location_display_name": "Toronto"
        }
      ]
    }

List project resources

List resources that have been added to a project.

GET /v1/projects/{id}/resources

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies only to the project get resources.

  • project.resources.retrieve-all

Auditing

Calling this method generates the following auditing event.

  • project.project.read

Request

Path Parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

Query Parameters

  • The last entry that is returned on the page. The server uses this parameter to determine the first entry that is returned on the next page. If this parameter is not specified, the logical first page is returned.

    Possible values: 0 ≤ length ≤ 1536, Value must match regular expression ^$|^(?!\s)(?!.*\s$)[^\x00-\x1F]*$

    Default:

  • The maximum number of resources to return. The number of resources that are returned is the same, except for the last page.

    Possible values: 1 ≤ value ≤ 100

    Default: 10

  • An optional string indicating what type of resources are to be included in the search results.

    Allowable values: [user_deployed,project_deployed,all]

  • The unique configuration ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

Response

The project resource list.

Status Code

  • You successfully retrieved the resources added to the project.

  • The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all the required parameters in your request.

  • The credentials are invalid or authentication is required to succeed.

  • The supplied authentication is not authorized to view this resource.

  • The request could not be completed by the server. It could be due to an internal error or in some cases invalid data in the request.

Example responses
  • The example response to a request to get project resources.

    {
      "resources": [
        {
          "resource_crn": "crn:v1:staging:public:toolchain:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::",
          "resource_name": "toolchain_instance",
          "account_id": "499b176abb3e1c9727df87ae48b27c7b",
          "location": "us-south",
          "resource_type": "user_deployed",
          "resource_status": "active",
          "resource_group_id": "5201af285aba49fa97c31ad44967010f",
          "tags": [],
          "service_tags": [
            "project::project_id:cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          ],
          "project_id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
          "terraform_type": "ibm_cd_toolchain",
          "resource_group_name": "Default"
        },
        {
          "resource_crn": "crn:v1:staging:public:cloud-object-storage:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::",
          "resource_name": "cos_bucket_instance",
          "account_id": "499b176abb3e1c9727df87ae48b27c7b",
          "location": "us-south",
          "resource_type": "project_deployed",
          "resource_status": "active",
          "resource_group_id": "3201af285aba49fa97c31ad44967010f",
          "tags": [],
          "service_tags": [
            "project::project_id:cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          ],
          "project_id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
          "terraform_type": "ibm_cos_bucket",
          "resource_group_name": "Default"
        }
      ],
      "token": "eyJhY2NvdW50SWQiOiIqIiwidXNlcklk",
      "limit": 10,
      "first": {
        "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/resources"
      },
      "next": {
        "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/resources?&start=eyJhY2NvdW50SWQiOiIqIiwidXNlcklk"
      }
    }

Updates the resources in a project

Updates the resources in a project using a collection of JSON patch-like operations.

POST /v1/projects/{id}/resources

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies only to the project update resource bindings.

  • project.resources.update

Auditing

Calling this method generates the following auditing event.

  • project.project.read

Request

Custom Headers

  • The IBM trusted profile ID

    Possible values: 0 ≤ length ≤ 512, Value must match regular expression ^(?!\s)(?!.*\s$)[^`<>\x00-\x1F]*$

  • The IBM Cloud API key. It can be either raw or pulled from the catalog via a CRN or JSON blob.

    Possible values: 0 ≤ length ≤ 512, Value must match regular expression ^(?!\s)(?!.*\s$)[^`<>\x00-\x1F]*$

Path Parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

The request body for the change delta of the project resources to update.

Examples:

The example request to update project resources.

{
  "resources": [
    {
      "op": "add",
      "value": {
        "resource_crn": "crn:v1:staging:public:toolchain:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"
      }
    },
    {
      "op": "remove",
      "value": {
        "resource_crn": "crn:v1:staging:public:cloud-object-storage:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"
      }
    }
  ]
}

Response

The project resources update response.

Status Code

  • Some or all of the resource operations were successfully executed.

  • The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all the required parameters in your request.

  • The credentials are invalid or authentication is required to succeed.

  • The supplied authentication is not authorized to view this resource.

  • The request could not be completed by the server. It could be due to an internal error or in some cases invalid data in the request.

Example responses
  • An example response from updating project resources.

    {
      "resources": [
        {
          "op": "add",
          "value": {
            "resource_crn": "crn:v1:staging:public:toolchain:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-a6d576183bb2::"
          }
        }
      ],
      "errors": [
        {
          "code": "not_found",
          "message": "The resource with CRN crn:v1:staging:public:toolchain:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb3::' could not be found in the account with ID a94cbc051abd47828a396c94adaba9c1."
        },
        {
          "code": "bad_request",
          "message": "The resource with CRN crn:v1:staging:public:toolchain:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb8::' was added to another project. A resource can be added only to a single project."
        }
      ],
      "status_code": 200
    }

List all project available resources

Lists resources in an account that are available to add to the project. The account is specified using a trusted profile or API key.

GET /v1/projects/{id}/available_resources

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies only to the project get available resources.

  • project.available-resources.retrieve-all

Auditing

Calling this method generates the following auditing event.

  • project.project.read

Request

Custom Headers

  • The IBM trusted profile ID

    Possible values: 0 ≤ length ≤ 512, Value must match regular expression ^(?!\s)(?!.*\s$)[^`<>\x00-\x1F]*$

  • The IBM Cloud API key. It can be either raw or pulled from the catalog via a CRN or JSON blob.

    Possible values: 0 ≤ length ≤ 512, Value must match regular expression ^(?!\s)(?!.*\s$)[^`<>\x00-\x1F]*$

Path Parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

Query Parameters

  • The last entry that is returned on the page. The server uses this parameter to determine the first entry that is returned on the next page. If this parameter is not specified, the logical first page is returned.

    Possible values: 0 ≤ length ≤ 1536, Value must match regular expression ^$|^(?!\s)(?!.*\s$)[^\x00-\x1F]*$

    Default:

  • The maximum number of resources to return. The number of resources that are returned is the same, except for the last page.

    Possible values: 1 ≤ value ≤ 100

    Default: 10

Response

The project resource list.

Status Code

  • You successfully retrieved the resources.

  • The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all the required parameters in your request.

  • The credentials are invalid or authentication is required to succeed.

  • The supplied authentication is not authorized to view this resource.

  • The request could not be completed by the server. It could be due to an internal error or in some cases invalid data in the request.

Example responses
  • The example response to a request to get project resources.

    {
      "resources": [
        {
          "resource_crn": "crn:v1:staging:public:toolchain:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::",
          "resource_name": "toolchain_instance",
          "account_id": "499b176abb3e1c9727df87ae48b27c7b",
          "location": "us-south",
          "resource_type": "user_deployed",
          "resource_status": "active",
          "resource_group_id": "5201af285aba49fa97c31ad44967010f",
          "tags": [],
          "service_tags": [
            "project::project_id:cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          ],
          "project_id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
          "terraform_type": "ibm_cd_toolchain",
          "resource_group_name": "Default"
        },
        {
          "resource_crn": "crn:v1:staging:public:cloud-object-storage:global:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::",
          "resource_name": "cos_bucket_instance",
          "account_id": "499b176abb3e1c9727df87ae48b27c7b",
          "location": "us-south",
          "resource_type": "project_deployed",
          "resource_status": "active",
          "resource_group_id": "3201af285aba49fa97c31ad44967010f",
          "tags": [],
          "service_tags": [
            "project::project_id:cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          ],
          "project_id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
          "terraform_type": "ibm_cos_bucket",
          "resource_group_name": "Default"
        }
      ],
      "token": "eyJhY2NvdW50SWQiOiIqIiwidXNlcklk",
      "limit": 10,
      "first": {
        "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/resources"
      },
      "next": {
        "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/resources?&start=eyJhY2NvdW50SWQiOiIqIiwidXNlcklk"
      }
    }

Get project resources for an account

Get the project resources for an account, as returned by Schematics. This information is used by the GhoST service.

GET /v1/projects_resources

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies to getting the project resources for an account.

  • project.resources.sync

Request

Query Parameters

  • The IBM Cloud account id of the account owning the resource.

    Possible values: 0 ≤ length ≤ 256, Value must match regular expression ^(?!\s)(?!.*\s$).*$

  • The last entry that is returned on the page. The server uses this parameter to determine the first entry that is returned on the next page. If this parameter is not specified, the logical first page is returned.

    Possible values: 0 ≤ length ≤ 1536, Value must match regular expression ^$|^(?!\s)(?!.*\s$)[^\x00-\x1F]*$

    Default:

  • The maximum number of resources to return. The number of resources that are returned is the same, except for the last page.

    Possible values: 1 ≤ value ≤ 100

    Default: 10

Response

The project resources returned by Schematics

Status Code

  • You successfully retrieved the resources.

  • The credentials are invalid or authentication is required to succeed.

  • The supplied authentication is not authorized to view this resource.

  • The request could not be completed by the server. It could be due to an internal error or in some cases invalid data in the request.

Example responses
  • An example response from project resources for an account.

    {
      "limit": 10,
      "first": {
        "href": "https://projects.api.cloud.ibm.com/v1/projects_resources?account_id=e8bb1d11250e14b0de3dfa9f42a60e00"
      },
      "next": {
        "href": "https://projects.api.cloud.ibm.com/v1/projects_resources?account_id=e8bb1d11250e14b0de3dfa9f42a60e00&limit=100&start=6860801d-994a-497f-8b51-9166cae1c8ff"
      },
      "projects": [
        {
          "id": "6860801d-994a-497f-8b51-9166cae1c8ff",
          "resources": [
            {
              "project_id": "6860801d-994a-497f-8b51-9166cae1c8ff",
              "config_id": "1d70615f-387c-4325-af7c-a2067dc042fa",
              "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.26e5e9c0-745d-4e5a-ad5a-08bc0a374b5a-global",
              "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/e8bb1d11250e14b0de3dfa9f42a60e00:503c8368-9953-4695-b1ff-7e30f32cdb7f:bucket:sample-solution-app",
              "crn_type": "ibm",
              "id": "cos_bucket_instance_id",
              "name": "cos_bucket_instance",
              "type": "ibm_cos_bucket"
            }
          ]
        }
      ]
    }

Get project resources for a single project

Get the project resources for a single project, as returned by Schematics. This information is used by the GhoST service.

GET /v1/projects_resources/{id}/resources

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies to getting the project resources for a single project.

  • project.resources.sync

Request

Path Parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

Response

The project resources returned by Schematics

Status Code

  • You successfully retrieved the resources.

  • The credentials are invalid or authentication is required to succeed.

  • The supplied authentication is not authorized to view this resource.

  • The request could not be completed by the server. It could be due to an internal error or in some cases invalid data in the request.

Example responses
  • An example response from getting resources for a project.

    {
      "id": "6860801d-994a-497f-8b51-9166cae1c8ff",
      "resources": [
        {
          "project_id": "6860801d-994a-497f-8b51-9166cae1c8ff",
          "config_id": "1d70615f-387c-4325-af7c-a2067dc042fa",
          "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.26e5e9c0-745d-4e5a-ad5a-08bc0a374b5a-global",
          "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/e8bb1d11250e14b0de3dfa9f42a60e00:503c8368-9953-4695-b1ff-7e30f32cdb7f::",
          "crn_type": "ibm",
          "id": "cos_instance_id",
          "name": "cos_instance",
          "type": "ibm_cos"
        },
        {
          "project_id": "6860801d-994a-497f-8b51-9166cae1c8ff",
          "config_id": "1d70615f-387c-4325-af7c-a2067dc042fa",
          "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.26e5e9c0-745d-4e5a-ad5a-08bc0a374b5a-global",
          "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/e8bb1d11250e14b0de3dfa9f42a60e00:503c8368-9953-4695-b1ff-7e30f32cdb7f:bucket:sample-solution-app",
          "crn_type": "ibm",
          "id": "cos_bucket_instance_id",
          "name": "cos_bucket_instance",
          "type": "ibm_cos_bucket"
        }
      ]
    }

Get project resource detail

Get the project resource detail, as returned by Schematics. This information is used by the GhoST service.

GET /v1/projects_resources/{id}/resources/{resource_crn}

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies to getting the project resource detail.

  • project.resources.sync

Request

Path Parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

  • The CRN of the resource.

    Possible values: 4 ≤ length ≤ 512, Value must match regular expression (?!\s)(?!.*\s$)^(crn)[^'"`<>{}\s\x00-\x1F]*

    Example: crn:v1:staging:public:project:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::

Response

The project resource returned by Schematics

Status Code

  • You successfully retrieved the resource.

  • The credentials are invalid or authentication is required to succeed.

  • The supplied authentication is not authorized to view this resource.

  • The request could not be completed by the server. It could be due to an internal error or in some cases invalid data in the request.

Example responses
  • An example response from getting detail for a project resource.

    {
      "id": "6860801d-994a-497f-8b51-9166cae1c8ff",
      "resources": [
        {
          "project_id": "6860801d-994a-497f-8b51-9166cae1c8ff",
          "config_id": "1d70615f-387c-4325-af7c-a2067dc042fa",
          "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.26e5e9c0-745d-4e5a-ad5a-08bc0a374b5a-global",
          "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/e8bb1d11250e14b0de3dfa9f42a60e00:503c8368-9953-4695-b1ff-7e30f32cdb7f:bucket:sample-solution-app",
          "crn_type": "ibm",
          "id": "cos_bucket_instance_id",
          "name": "cos_bucket_instance",
          "type": "ibm_cos_bucket"
        }
      ]
    }

Create an environment

Create an environment to group related configurations together and share values across them for easier deployment. For more information, see Creating an environment.

Create an environment to group related configurations together and share values across them for easier deployment. For more information, see Creating an environment.

Create an environment to group related configurations together and share values across them for easier deployment. For more information, see Creating an environment.

Create an environment to group related configurations together and share values across them for easier deployment. For more information, see Creating an environment.

POST /v1/projects/{project_id}/environments
create_project_environment(
        self,
        project_id: str,
        definition: 'EnvironmentDefinitionRequiredProperties',
        **kwargs,
    ) -> DetailedResponse
createProjectEnvironment(params)
(project *ProjectV1) CreateProjectEnvironment(createProjectEnvironmentOptions *CreateProjectEnvironmentOptions) (result *Environment, response *core.DetailedResponse, err error)
(project *ProjectV1) CreateProjectEnvironmentWithContext(ctx context.Context, createProjectEnvironmentOptions *CreateProjectEnvironmentOptions) (result *Environment, response *core.DetailedResponse, err error)

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies only to creating environments.

  • project.environment.create

Auditing

Calling this method generates the following auditing event.

  • project.environment.create

Request

Instantiate the CreateProjectEnvironmentOptions struct and set the fields to provide parameter values for the CreateProjectEnvironment method.

Path Parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

The request body for a valid environment document.

Examples:

A sample environment update request.

{
  "definition": {
    "name": "development",
    "description": "The environment development.",
    "authorizations": {
      "method": "trusted_profile",
      "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12"
    },
    "inputs": {
      "resource_group": "stage",
      "region": "us-south"
    },
    "compliance_profile": {
      "id": "some-profile-id",
      "instance_id": "some-instance-id",
      "instance_location": "us-south",
      "profile_name": "some-profile-name",
      "attachment_id": "some-attachment-id"
    }
  }
}

parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression /^[\\.\\-0-9a-zA-Z]+$/

  • The environment definition.

parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression /^[\\.\\-0-9a-zA-Z]+$/

  • The environment definition.

WithContext method only

The CreateProjectEnvironment options.

  • curl -X POST --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "definition": { "name": "development", "description": "The environment development.", "authorizations": { "method": "trusted_profile", "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12" }, "inputs": { "resource_group": "stage", "region": "us-south" }, "compliance_profile": { "id": "some-profile-id", "instance_id": "some-instance-id", "instance_location": "us-south", "profile_name": "some-profile-name", "attachment_id": "some-attachment-id" } } }'   "{base_url}/v1/projects/{project_id}/environments"
  • projectConfigAuthModel := &projectv1.ProjectConfigAuth{
      TrustedProfileID: core.StringPtr("Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12"),
      Method: core.StringPtr("trusted_profile"),
    }
    
    projectComplianceProfileModel := &projectv1.ProjectComplianceProfile{
      ID: core.StringPtr("some-profile-id"),
      InstanceID: core.StringPtr("some-instance-id"),
      InstanceLocation: core.StringPtr("us-south"),
      AttachmentID: core.StringPtr("some-attachment-id"),
      ProfileName: core.StringPtr("some-profile-name"),
    }
    
    environmentDefinitionRequiredPropertiesModel := &projectv1.EnvironmentDefinitionRequiredProperties{
      Description: core.StringPtr("The environment development."),
      Name: core.StringPtr("development"),
      Authorizations: projectConfigAuthModel,
      ComplianceProfile: projectComplianceProfileModel,
    }
    
    createProjectEnvironmentOptions := projectService.NewCreateProjectEnvironmentOptions(
      projectIdLink,
      environmentDefinitionRequiredPropertiesModel,
    )
    
    environment, response, err := projectService.CreateProjectEnvironment(createProjectEnvironmentOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(environment, "", "  ")
    fmt.Println(string(b))
  • // Request models needed by this operation.
    
    // ProjectConfigAuth
    const projectConfigAuthModel = {
      trusted_profile_id: 'Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12',
      method: 'trusted_profile',
    };
    
    // ProjectComplianceProfile
    const projectComplianceProfileModel = {
      id: 'some-profile-id',
      instance_id: 'some-instance-id',
      instance_location: 'us-south',
      attachment_id: 'some-attachment-id',
      profile_name: 'some-profile-name',
    };
    
    // EnvironmentDefinitionRequiredProperties
    const environmentDefinitionRequiredPropertiesModel = {
      description: 'The environment development.',
      name: 'development',
      authorizations: projectConfigAuthModel,
      inputs: { resource_group: 'stage', region: 'us-south' },
      compliance_profile: projectComplianceProfileModel,
    };
    
    const params = {
      projectId: projectIdLink,
      definition: environmentDefinitionRequiredPropertiesModel,
    };
    
    let res;
    try {
      res = await projectService.createProjectEnvironment(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • project_config_auth_model = {
      'trusted_profile_id': 'Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12',
      'method': 'trusted_profile',
    }
    
    project_compliance_profile_model = {
      'id': 'some-profile-id',
      'instance_id': 'some-instance-id',
      'instance_location': 'us-south',
      'attachment_id': 'some-attachment-id',
      'profile_name': 'some-profile-name',
    }
    
    environment_definition_required_properties_model = {
      'description': 'The environment development.',
      'name': 'development',
      'authorizations': project_config_auth_model,
      'inputs': {'resource_group': 'stage', 'region': 'us-south'},
      'compliance_profile': project_compliance_profile_model,
    }
    
    response = project_service.create_project_environment(
      project_id=project_id_link,
      definition=environment_definition_required_properties_model,
    )
    environment = response.get_result()
    
    print(json.dumps(environment, indent=2))

Response

The definition of a project environment.

The definition of a project environment.

The definition of a project environment.

The definition of a project environment.

Status Code

  • The new resource was created.

  • The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all the required parameters in your request.

  • The credentials are invalid or authentication is required to succeed.

  • The supplied authentication is not authorized to view this resource.

Example responses
  • The sample environment response.

    {
      "id": "env123",
      "definition": {
        "name": "development",
        "description": "The environment development.",
        "authorizations": {
          "method": "trusted_profile",
          "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12"
        },
        "inputs": {
          "resource_group": "stage",
          "region": "us-south"
        },
        "compliance_profile": {
          "id": "some-profile-id",
          "instance_id": "some-instance-id",
          "instance_location": "us-south",
          "profile_name": "some-profile-name",
          "attachment_id": "some-attachment-id"
        }
      },
      "project": {
        "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
        "definition": {
          "name": "iaas-infra-prestage-env"
        },
        "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
        "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
      },
      "created_at": "2023-06-29T03:28:14.709Z",
      "modified_at": "2023-06-29T03:28:14.709Z",
      "href": "https://projects.api.test.cloud.ibm.com/v1/projects/6fd53106-7ce6-429e-8c57-f22e832d0c4b/environments/2102afed-94c7-46fe-90f2-7fff290637b4"
    }
  • The sample environment response.

    {
      "id": "env123",
      "definition": {
        "name": "development",
        "description": "The environment development.",
        "authorizations": {
          "method": "trusted_profile",
          "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12"
        },
        "inputs": {
          "resource_group": "stage",
          "region": "us-south"
        },
        "compliance_profile": {
          "id": "some-profile-id",
          "instance_id": "some-instance-id",
          "instance_location": "us-south",
          "profile_name": "some-profile-name",
          "attachment_id": "some-attachment-id"
        }
      },
      "project": {
        "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
        "definition": {
          "name": "iaas-infra-prestage-env"
        },
        "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
        "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
      },
      "created_at": "2023-06-29T03:28:14.709Z",
      "modified_at": "2023-06-29T03:28:14.709Z",
      "href": "https://projects.api.test.cloud.ibm.com/v1/projects/6fd53106-7ce6-429e-8c57-f22e832d0c4b/environments/2102afed-94c7-46fe-90f2-7fff290637b4"
    }

List environments

List all available environments. For more information, see Creating an environment.

List all available environments. For more information, see Creating an environment.

List all available environments. For more information, see Creating an environment.

List all available environments. For more information, see Creating an environment.

GET /v1/projects/{project_id}/environments
list_project_environments(
        self,
        project_id: str,
        *,
        token: Optional[str] = None,
        limit: Optional[int] = None,
        **kwargs,
    ) -> DetailedResponse
listProjectEnvironments(params)
(project *ProjectV1) ListProjectEnvironments(listProjectEnvironmentsOptions *ListProjectEnvironmentsOptions) (result *EnvironmentCollection, response *core.DetailedResponse, err error)
(project *ProjectV1) ListProjectEnvironmentsWithContext(ctx context.Context, listProjectEnvironmentsOptions *ListProjectEnvironmentsOptions) (result *EnvironmentCollection, response *core.DetailedResponse, err error)

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies only to listing environments.

  • project.environment.retrieve-all

Auditing

Calling this method generates the following auditing event.

  • project.environment.list

Request

Instantiate the ListProjectEnvironmentsOptions struct and set the fields to provide parameter values for the ListProjectEnvironments method.

Path Parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

Query Parameters

  • The server uses this parameter to determine the first entry that is returned on the next page. If this parameter is not specified, the logical first page is returned.

    Possible values: 0 ≤ length ≤ 1536, Value must match regular expression ^$|^(?!\s)(?!.*\s$)[^\x00-\x1F]*$

    Default:

  • The maximum number of resources to return. The number of resources that are returned is the same, except for the last page.

    Possible values: 1 ≤ value ≤ 100

    Default: 10

parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression /^[\\.\\-0-9a-zA-Z]+$/

  • The server uses this parameter to determine the first entry that is returned on the next page. If this parameter is not specified, the logical first page is returned.

    Possible values: 0 ≤ length ≤ 1536, Value must match regular expression /^$|^(?!\\s)(?!.*\\s$)[^\\x00-\\x1F]*$/

    Default:

  • The maximum number of resources to return. The number of resources that are returned is the same, except for the last page.

    Possible values: 1 ≤ value ≤ 100

    Default: 10

parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression /^[\\.\\-0-9a-zA-Z]+$/

  • The server uses this parameter to determine the first entry that is returned on the next page. If this parameter is not specified, the logical first page is returned.

    Possible values: 0 ≤ length ≤ 1536, Value must match regular expression /^$|^(?!\\s)(?!.*\\s$)[^\\x00-\\x1F]*$/

    Default:

  • The maximum number of resources to return. The number of resources that are returned is the same, except for the last page.

    Possible values: 1 ≤ value ≤ 100

    Default: 10

WithContext method only

The ListProjectEnvironments options.

  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/v1/projects/{project_id}/environments"
  • listProjectEnvironmentsOptions := &projectv1.ListProjectEnvironmentsOptions{
      ProjectID: &projectIdLink,
      Limit: core.Int64Ptr(int64(10)),
    }
    
    pager, err := projectService.NewProjectEnvironmentsPager(listProjectEnvironmentsOptions)
    if err != nil {
      panic(err)
    }
    
    var allResults []projectv1.Environment
    for pager.HasNext() {
      nextPage, err := pager.GetNext()
      if err != nil {
        panic(err)
      }
      allResults = append(allResults, nextPage...)
    }
    b, _ := json.MarshalIndent(allResults, "", "  ")
    fmt.Println(string(b))
  • const params = {
      projectId: projectIdLink,
      limit: 10,
    };
    
    const allResults = [];
    try {
      const pager = new ProjectV1.ProjectEnvironmentsPager(projectService, params);
      while (pager.hasNext()) {
        const nextPage = await pager.getNext();
        expect(nextPage).not.toBeNull();
        allResults.push(...nextPage);
      }
      console.log(JSON.stringify(allResults, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • all_results = []
    pager = ProjectEnvironmentsPager(
      client=project_service,
      project_id=project_id_link,
      limit=10,
    )
    while pager.has_next():
      next_page = pager.get_next()
      assert next_page is not None
      all_results.extend(next_page)
    
    print(json.dumps(all_results, indent=2))

Response

The list environment response.

The list environment response.

The list environment response.

The list environment response.

Status Code

  • The request was successful.

  • The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all the required parameters in your request.

  • The credentials are invalid or authentication is required to succeed.

  • The supplied authentication is not authorized to view this resource.

Example responses
  • The sample environment response for a list.

    {
      "limit": 1,
      "first": {
        "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/environments?limit=1"
      },
      "next": {
        "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/environments?limit=1&token=da969bff-vf9q-3t1t-b677-d6rt5c0de54e"
      },
      "environments": [
        {
          "id": "env123",
          "definition": {
            "name": "development",
            "description": "The environment development.",
            "authorizations": {
              "method": "trusted_profile",
              "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12"
            },
            "inputs": {
              "resource_group": "stage",
              "region": "us-south"
            },
            "compliance_profile": {
              "id": "some-profile-id",
              "instance_id": "some-instance-id",
              "instance_location": "us-south",
              "profile_name": "some-profile-name",
              "attachment_id": "some-attachment-id"
            }
          },
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "created_at": "2023-06-29T03:28:14.709Z",
          "modified_at": "2023-06-29T03:28:14.709Z",
          "href": "https://projects.api.test.cloud.ibm.com/v1/projects/6fd53106-7ce6-429e-8c57-f22e832d0c4b/environments/2102afed-94c7-46fe-90f2-7fff290637b4"
        }
      ]
    }
  • The sample environment response for a list.

    {
      "limit": 1,
      "first": {
        "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/environments?limit=1"
      },
      "next": {
        "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/environments?limit=1&token=da969bff-vf9q-3t1t-b677-d6rt5c0de54e"
      },
      "environments": [
        {
          "id": "env123",
          "definition": {
            "name": "development",
            "description": "The environment development.",
            "authorizations": {
              "method": "trusted_profile",
              "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12"
            },
            "inputs": {
              "resource_group": "stage",
              "region": "us-south"
            },
            "compliance_profile": {
              "id": "some-profile-id",
              "instance_id": "some-instance-id",
              "instance_location": "us-south",
              "profile_name": "some-profile-name",
              "attachment_id": "some-attachment-id"
            }
          },
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "created_at": "2023-06-29T03:28:14.709Z",
          "modified_at": "2023-06-29T03:28:14.709Z",
          "href": "https://projects.api.test.cloud.ibm.com/v1/projects/6fd53106-7ce6-429e-8c57-f22e832d0c4b/environments/2102afed-94c7-46fe-90f2-7fff290637b4"
        }
      ]
    }

Get an environment

Get an environment. Learn more.

Get an environment. Learn more.

Get an environment. Learn more.

Get an environment. Learn more.

GET /v1/projects/{project_id}/environments/{id}
get_project_environment(
        self,
        project_id: str,
        id: str,
        **kwargs,
    ) -> DetailedResponse
getProjectEnvironment(params)
(project *ProjectV1) GetProjectEnvironment(getProjectEnvironmentOptions *GetProjectEnvironmentOptions) (result *Environment, response *core.DetailedResponse, err error)
(project *ProjectV1) GetProjectEnvironmentWithContext(ctx context.Context, getProjectEnvironmentOptions *GetProjectEnvironmentOptions) (result *Environment, response *core.DetailedResponse, err error)

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies only to getting environments.

  • project.environment.retrieve

Auditing

Calling this method generates the following auditing event.

  • project.environment.read

Request

Instantiate the GetProjectEnvironmentOptions struct and set the fields to provide parameter values for the GetProjectEnvironment method.

Path Parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

  • The environment ID.

    Possible values: 1 ≤ length ≤ 256, Value must match regular expression ^(?!\s)(?!.*\s$).+$

parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression /^[\\.\\-0-9a-zA-Z]+$/

  • The environment ID.

    Possible values: 1 ≤ length ≤ 256, Value must match regular expression /^(?!\\s)(?!.*\\s$).+$/

parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression /^[\\.\\-0-9a-zA-Z]+$/

  • The environment ID.

    Possible values: 1 ≤ length ≤ 256, Value must match regular expression /^(?!\\s)(?!.*\\s$).+$/

WithContext method only

The GetProjectEnvironment options.

  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/v1/projects/{project_id}/environments/{id}"
  • getProjectEnvironmentOptions := projectService.NewGetProjectEnvironmentOptions(
      projectIdLink,
      projectIdLink,
    )
    
    environment, response, err := projectService.GetProjectEnvironment(getProjectEnvironmentOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(environment, "", "  ")
    fmt.Println(string(b))
  • const params = {
      projectId: projectIdLink,
      id: projectIdLink,
    };
    
    let res;
    try {
      res = await projectService.getProjectEnvironment(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • response = project_service.get_project_environment(
      project_id=project_id_link,
      id=project_id_link,
    )
    environment = response.get_result()
    
    print(json.dumps(environment, indent=2))

Response

The definition of a project environment.

The definition of a project environment.

The definition of a project environment.

The definition of a project environment.

Status Code

  • You successfully retrieved an environment.

  • The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all the required parameters in your request.

  • The credentials are invalid or authentication is required to succeed.

  • The supplied authentication is not authorized to view this resource.

Example responses
  • The sample environment response.

    {
      "id": "env123",
      "definition": {
        "name": "development",
        "description": "The environment development.",
        "authorizations": {
          "method": "trusted_profile",
          "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12"
        },
        "inputs": {
          "resource_group": "stage",
          "region": "us-south"
        },
        "compliance_profile": {
          "id": "some-profile-id",
          "instance_id": "some-instance-id",
          "instance_location": "us-south",
          "profile_name": "some-profile-name",
          "attachment_id": "some-attachment-id"
        }
      },
      "project": {
        "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
        "definition": {
          "name": "iaas-infra-prestage-env"
        },
        "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
        "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
      },
      "created_at": "2023-06-29T03:28:14.709Z",
      "modified_at": "2023-06-29T03:28:14.709Z",
      "href": "https://projects.api.test.cloud.ibm.com/v1/projects/6fd53106-7ce6-429e-8c57-f22e832d0c4b/environments/2102afed-94c7-46fe-90f2-7fff290637b4"
    }
  • The sample environment response.

    {
      "id": "env123",
      "definition": {
        "name": "development",
        "description": "The environment development.",
        "authorizations": {
          "method": "trusted_profile",
          "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12"
        },
        "inputs": {
          "resource_group": "stage",
          "region": "us-south"
        },
        "compliance_profile": {
          "id": "some-profile-id",
          "instance_id": "some-instance-id",
          "instance_location": "us-south",
          "profile_name": "some-profile-name",
          "attachment_id": "some-attachment-id"
        }
      },
      "project": {
        "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
        "definition": {
          "name": "iaas-infra-prestage-env"
        },
        "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
        "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
      },
      "created_at": "2023-06-29T03:28:14.709Z",
      "modified_at": "2023-06-29T03:28:14.709Z",
      "href": "https://projects.api.test.cloud.ibm.com/v1/projects/6fd53106-7ce6-429e-8c57-f22e832d0c4b/environments/2102afed-94c7-46fe-90f2-7fff290637b4"
    }

Update an environment

Update an environment by specifying its ID. Learn more.

Update an environment by specifying its ID. Learn more.

Update an environment by specifying its ID. Learn more.

Update an environment by specifying its ID. Learn more.

PATCH /v1/projects/{project_id}/environments/{id}
update_project_environment(
        self,
        project_id: str,
        id: str,
        definition: 'EnvironmentDefinitionPropertiesPatch',
        **kwargs,
    ) -> DetailedResponse
updateProjectEnvironment(params)
(project *ProjectV1) UpdateProjectEnvironment(updateProjectEnvironmentOptions *UpdateProjectEnvironmentOptions) (result *Environment, response *core.DetailedResponse, err error)
(project *ProjectV1) UpdateProjectEnvironmentWithContext(ctx context.Context, updateProjectEnvironmentOptions *UpdateProjectEnvironmentOptions) (result *Environment, response *core.DetailedResponse, err error)

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies only to updating an environments.

  • project.environment.update

Auditing

Calling this method generates the following auditing event.

  • project.environment.update

Request

Instantiate the UpdateProjectEnvironmentOptions struct and set the fields to provide parameter values for the UpdateProjectEnvironment method.

Path Parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

  • The environment ID.

    Possible values: 1 ≤ length ≤ 256, Value must match regular expression ^(?!\s)(?!.*\s$).+$

The request body for the updated environment document.

Examples:

A sample environment update request.

{
  "definition": {
    "name": "development",
    "description": "The environment development.",
    "authorizations": {
      "method": "trusted_profile",
      "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12"
    },
    "inputs": {
      "resource_group": "stage",
      "region": "us-south"
    },
    "compliance_profile": {
      "id": "some-profile-id",
      "instance_id": "some-instance-id",
      "instance_location": "us-south",
      "profile_name": "some-profile-name",
      "attachment_id": "some-attachment-id"
    }
  }
}

parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression /^[\\.\\-0-9a-zA-Z]+$/

  • The environment ID.

    Possible values: 1 ≤ length ≤ 256, Value must match regular expression /^(?!\\s)(?!.*\\s$).+$/

  • The environment definition that is used for updates.

parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression /^[\\.\\-0-9a-zA-Z]+$/

  • The environment ID.

    Possible values: 1 ≤ length ≤ 256, Value must match regular expression /^(?!\\s)(?!.*\\s$).+$/

  • The environment definition that is used for updates.

WithContext method only

The UpdateProjectEnvironment options.

  • curl -X PATCH --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "definition": { "name": "development", "description": "The environment development.", "authorizations": { "method": "trusted_profile", "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12" }, "inputs": { "resource_group": "stage", "region": "us-south" }, "compliance_profile": { "id": "some-profile-id", "instance_id": "some-instance-id", "instance_location": "us-south", "profile_name": "some-profile-name", "attachment_id": "some-attachment-id" } } }'   "{base_url}/v1/projects/{project_id}/environments/{id}"
  • projectConfigAuthModel := &projectv1.ProjectConfigAuth{
      TrustedProfileID: core.StringPtr("Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12"),
      Method: core.StringPtr("trusted_profile"),
    }
    
    projectComplianceProfileModel := &projectv1.ProjectComplianceProfile{
      ID: core.StringPtr("some-profile-id"),
      InstanceID: core.StringPtr("some-instance-id"),
      InstanceLocation: core.StringPtr("us-south"),
      AttachmentID: core.StringPtr("some-attachment-id"),
      ProfileName: core.StringPtr("some-profile-name"),
    }
    
    environmentDefinitionPropertiesPatchModel := &projectv1.EnvironmentDefinitionPropertiesPatch{
      Description: core.StringPtr("The environment development."),
      Name: core.StringPtr("development"),
      Authorizations: projectConfigAuthModel,
      ComplianceProfile: projectComplianceProfileModel,
    }
    
    updateProjectEnvironmentOptions := projectService.NewUpdateProjectEnvironmentOptions(
      projectIdLink,
      projectIdLink,
      environmentDefinitionPropertiesPatchModel,
    )
    
    environment, response, err := projectService.UpdateProjectEnvironment(updateProjectEnvironmentOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(environment, "", "  ")
    fmt.Println(string(b))
  • // Request models needed by this operation.
    
    // ProjectConfigAuth
    const projectConfigAuthModel = {
      trusted_profile_id: 'Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12',
      method: 'trusted_profile',
    };
    
    // ProjectComplianceProfile
    const projectComplianceProfileModel = {
      id: 'some-profile-id',
      instance_id: 'some-instance-id',
      instance_location: 'us-south',
      attachment_id: 'some-attachment-id',
      profile_name: 'some-profile-name',
    };
    
    // EnvironmentDefinitionPropertiesPatch
    const environmentDefinitionPropertiesPatchModel = {
      description: 'The environment development.',
      name: 'development',
      authorizations: projectConfigAuthModel,
      inputs: { resource_group: 'stage', region: 'us-south' },
      compliance_profile: projectComplianceProfileModel,
    };
    
    const params = {
      projectId: projectIdLink,
      id: projectIdLink,
      definition: environmentDefinitionPropertiesPatchModel,
    };
    
    let res;
    try {
      res = await projectService.updateProjectEnvironment(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • project_config_auth_model = {
      'trusted_profile_id': 'Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12',
      'method': 'trusted_profile',
    }
    
    project_compliance_profile_model = {
      'id': 'some-profile-id',
      'instance_id': 'some-instance-id',
      'instance_location': 'us-south',
      'attachment_id': 'some-attachment-id',
      'profile_name': 'some-profile-name',
    }
    
    environment_definition_properties_patch_model = {
      'description': 'The environment development.',
      'name': 'development',
      'authorizations': project_config_auth_model,
      'inputs': {'resource_group': 'stage', 'region': 'us-south'},
      'compliance_profile': project_compliance_profile_model,
    }
    
    response = project_service.update_project_environment(
      project_id=project_id_link,
      id=project_id_link,
      definition=environment_definition_properties_patch_model,
    )
    environment = response.get_result()
    
    print(json.dumps(environment, indent=2))

Response

The definition of a project environment.

The definition of a project environment.

The definition of a project environment.

The definition of a project environment.

Status Code

  • You successfully updated an environment.

  • The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all the required parameters in your request.

  • The credentials are invalid or authentication is required to succeed.

  • The supplied authentication is not authorized to view this resource.

Example responses
  • The sample environment response.

    {
      "id": "env123",
      "definition": {
        "name": "development",
        "description": "The environment development.",
        "authorizations": {
          "method": "trusted_profile",
          "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12"
        },
        "inputs": {
          "resource_group": "stage",
          "region": "us-south"
        },
        "compliance_profile": {
          "id": "some-profile-id",
          "instance_id": "some-instance-id",
          "instance_location": "us-south",
          "profile_name": "some-profile-name",
          "attachment_id": "some-attachment-id"
        }
      },
      "project": {
        "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
        "definition": {
          "name": "iaas-infra-prestage-env"
        },
        "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
        "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
      },
      "created_at": "2023-06-29T03:28:14.709Z",
      "modified_at": "2023-06-29T03:28:14.709Z",
      "href": "https://projects.api.test.cloud.ibm.com/v1/projects/6fd53106-7ce6-429e-8c57-f22e832d0c4b/environments/2102afed-94c7-46fe-90f2-7fff290637b4"
    }
  • The sample environment response.

    {
      "id": "env123",
      "definition": {
        "name": "development",
        "description": "The environment development.",
        "authorizations": {
          "method": "trusted_profile",
          "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12"
        },
        "inputs": {
          "resource_group": "stage",
          "region": "us-south"
        },
        "compliance_profile": {
          "id": "some-profile-id",
          "instance_id": "some-instance-id",
          "instance_location": "us-south",
          "profile_name": "some-profile-name",
          "attachment_id": "some-attachment-id"
        }
      },
      "project": {
        "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
        "definition": {
          "name": "iaas-infra-prestage-env"
        },
        "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
        "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
      },
      "created_at": "2023-06-29T03:28:14.709Z",
      "modified_at": "2023-06-29T03:28:14.709Z",
      "href": "https://projects.api.test.cloud.ibm.com/v1/projects/6fd53106-7ce6-429e-8c57-f22e832d0c4b/environments/2102afed-94c7-46fe-90f2-7fff290637b4"
    }

Delete an environment

Delete an environment in a project by specifying its ID.

Delete an environment in a project by specifying its ID.

Delete an environment in a project by specifying its ID.

Delete an environment in a project by specifying its ID.

DELETE /v1/projects/{project_id}/environments/{id}
delete_project_environment(
        self,
        project_id: str,
        id: str,
        **kwargs,
    ) -> DetailedResponse
deleteProjectEnvironment(params)
(project *ProjectV1) DeleteProjectEnvironment(deleteProjectEnvironmentOptions *DeleteProjectEnvironmentOptions) (result *EnvironmentDeleteResponse, response *core.DetailedResponse, err error)
(project *ProjectV1) DeleteProjectEnvironmentWithContext(ctx context.Context, deleteProjectEnvironmentOptions *DeleteProjectEnvironmentOptions) (result *EnvironmentDeleteResponse, response *core.DetailedResponse, err error)

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies only to the delete environments operation.

  • project.environment.delete

Auditing

Calling this method generates the following auditing event.

  • project.environment.delete

Request

Instantiate the DeleteProjectEnvironmentOptions struct and set the fields to provide parameter values for the DeleteProjectEnvironment method.

Path Parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

  • The environment ID.

    Possible values: 1 ≤ length ≤ 256, Value must match regular expression ^(?!\s)(?!.*\s$).+$

parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression /^[\\.\\-0-9a-zA-Z]+$/

  • The environment ID.

    Possible values: 1 ≤ length ≤ 256, Value must match regular expression /^(?!\\s)(?!.*\\s$).+$/

parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression /^[\\.\\-0-9a-zA-Z]+$/

  • The environment ID.

    Possible values: 1 ≤ length ≤ 256, Value must match regular expression /^(?!\\s)(?!.*\\s$).+$/

WithContext method only

The DeleteProjectEnvironment options.

  • curl -X DELETE --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/v1/projects/{project_id}/environments/{id}"
  • deleteProjectEnvironmentOptions := projectService.NewDeleteProjectEnvironmentOptions(
      projectIdLink,
      projectIdLink,
    )
    
    environmentDeleteResponse, response, err := projectService.DeleteProjectEnvironment(deleteProjectEnvironmentOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(environmentDeleteResponse, "", "  ")
    fmt.Println(string(b))
  • const params = {
      projectId: projectIdLink,
      id: projectIdLink,
    };
    
    let res;
    try {
      res = await projectService.deleteProjectEnvironment(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • response = project_service.delete_project_environment(
      project_id=project_id_link,
      id=project_id_link,
    )
    environment_delete_response = response.get_result()
    
    print(json.dumps(environment_delete_response, indent=2))

Response

The response to a request to delete an environment.

The response to a request to delete an environment.

The response to a request to delete an environment.

The response to a request to delete an environment.

Status Code

  • You successfully deleted an environment.

  • The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all the required parameters in your request.

  • The credentials are invalid or authentication is required to succeed.

  • The supplied authentication is not authorized to view this resource.

Example responses
  • The sample environment delete response.

    {
      "id": "env123"
    }
  • The sample environment delete response.

    {
      "id": "env123"
    }

Add or remove resources

Add or remove existing resources from a configuration by adding or removing service tags. Service tags are static and already part of the model. The request does not require a payload.

POST /v1/projects/{project_id}/configs/{id}/apply_tags

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies service tags to your resources so that they can be managed in your project.

  • project.config.manual-tag

Auditing

Calling this method generates the following auditing event.

  • project.config.manual-tag

Request

Path Parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

  • The unique configuration ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

Response

The response to a successful request to tag.

Status Code

  • The operation was successful.

  • The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all the required parameters in your request.

Example responses
  • {}

Add a new configuration

Add a new configuration to a project.

Add a new configuration to a project.

Add a new configuration to a project.

Add a new configuration to a project.

POST /v1/projects/{project_id}/configs
create_config(
        self,
        project_id: str,
        definition: 'ProjectConfigDefinitionPrototype',
        *,
        schematics: Optional['SchematicsWorkspace'] = None,
        **kwargs,
    ) -> DetailedResponse
createConfig(params)
(project *ProjectV1) CreateConfig(createConfigOptions *CreateConfigOptions) (result *ProjectConfig, response *core.DetailedResponse, err error)
(project *ProjectV1) CreateConfigWithContext(ctx context.Context, createConfigOptions *CreateConfigOptions) (result *ProjectConfig, response *core.DetailedResponse, err error)

Authentication

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

This action applies to only the update project operation.

  • project.config.create

Auditing

Calling this method generates the following auditing event.

  • project.config.create

Request

Instantiate the CreateConfigOptions struct and set the fields to provide parameter values for the CreateConfig method.

Path Parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression ^[\.\-0-9a-zA-Z]+$

The request body for the new project definition document.

Examples:

An example request for a project configuration with a catalog locator ID.

{
  "definition": {
    "name": "env-stage",
    "description": "The stage environment configuration.",
    "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global",
    "inputs": {
      "account_id": "account_id",
      "resource_group": "stage",
      "access_tags": [
        "env:stage"
      ],
      "logdna_name": "LogDNA_stage_service",
      "sysdig_name": "SysDig_stage_service"
    }
  }
}

A resource configuration example request.

{
  "definition": {
    "name": "shared-resources-dev",
    "description": "The stage environment configuration.",
    "labels": [
      "dev"
    ],
    "resource_crns": [
      "crn:v1:staging:public:continuous-delivery:us-south:a/d11256044e024d5bbea1a7d7ee4575c3:e988fcf7-2bd7-46de-a72d-339ebe859a9e::",
      "crn:v1:staging:public:toolchain:us-south:a/d11256044e024d5bbea1a7d7ee4575c3:618c70c7-0ead-40fb-86ce-e3f7b10c9f99::"
    ],
    "authorizations": {
      "method": "trusted_profile",
      "trusted_profile_id": "Profile-9ac10c5c-195c-41ef-b465-68a6b6dg5f12"
    }
  }
}

A project configuration example request for importing from an existing workspace.

{
  "definition": {
    "name": "env-stage",
    "description": "The stage environment configuration.",
    "inputs": {
      "account_id": "account_id",
      "resource_group": "stage",
      "access_tags": [
        "env:stage"
      ],
      "logdna_name": "LogDNA_stage_service",
      "sysdig_name": "SysDig_stage_service"
    }
  },
  "schematics": {
    "workspace_crn": "crn:v1:staging:public:schematics:us-south:a/38acaf4469814090a4e675dc0c317a0d:95ad49de-ab96-4e7d-a08c-45c38aa448e6:workspace:us-south.workspace.service.e0106139"
  }
}

The example request to create a stack configuration.

{
  "definition": {
    "name": "stack-bottom-up-example",
    "description": "A deployable architecture stack that includes two member deployable architectures.",
    "members": [
      {
        "name": "foundation-deployable-architecture",
        "config_id": "293c3c36-a094-4115-a12b-de0a9ca39beX"
      },
      {
        "name": "middleware-architecture",
        "config_id": "293c3c36-a094-4115-a12b-de0a9ca39be5"
      }
    ]
  }
}

parameters

  • The unique project ID.

    Possible values: length ≤ 128, Value must match regular expression /^[\\.\\-0-9a-zA-Z]+$/

  • The description of a project configuration.

    • A Schematics workspace to use for deploying this deployable architecture.

      If you are importing data from an existing Schematics workspace that is not backed by cart, then you must provide a locator_id. If you are using a Schematics workspace that is backed by cart, a locator_id is not required because the Schematics workspace has one. There are 3 scenarios:

      1. If only a locator_id is specified, a new Schematics workspace is instantiated with that locator_id.
      2. If only a schematics workspace_crn is specified, a 400 is returned if a locator_id is not found in the existing schematics workspace.
      3. If both a Schematics workspace_crn and a locator_id are specified, a 400code is returned if the specified locator_id does not agree with the locator_id in the existing Schematics workspace. For more information, see Creating workspaces and importing your Terraform template.

    parameters

    • The unique project ID.

      Possible values: length ≤ 128, Value must match regular expression /^[\\.\\-0-9a-zA-Z]+$/

    • The description of a project configuration.

      • A Schematics workspace to use for deploying this deployable architecture.

        If you are importing data from an existing Schematics workspace that is not backed by cart, then you must provide a locator_id. If you are using a Schematics workspace that is backed by cart, a locator_id is not required because the Schematics workspace has one. There are 3 scenarios:

        1. If only a locator_id is specified, a new Schematics workspace is instantiated with that locator_id.
        2. If only a schematics workspace_crn is specified, a 400 is returned if a locator_id is not found in the existing schematics workspace.
        3. If both a Schematics workspace_crn and a locator_id are specified, a 400code is returned if the specified locator_id does not agree with the locator_id in the existing Schematics workspace. For more information, see Creating workspaces and importing your Terraform template.

      WithContext method only

      The CreateConfig options.

      • curl -X POST --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "definition": { "name": "env-stage", "description": "The stage environment configuration.", "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global", "inputs": { "account_id": "account_id", "resource_group": "stage", "access_tags": [ "env:stage" ], "logdna_name": "LogDNA_stage_service", "sysdig_name": "SysDig_stage_service" } } }'   "{base_url}/v1/projects/{project_id}/configs"
      • projectConfigDefinitionPrototypeModel := &projectv1.ProjectConfigDefinitionPrototypeDAConfigDefinitionPropertiesPrototype{
          LocatorID: core.StringPtr("1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global"),
          Description: core.StringPtr("The stage environment configuration."),
          Name: core.StringPtr("env-stage"),
        }
        
        createConfigOptions := projectService.NewCreateConfigOptions(
          projectIdLink,
          projectConfigDefinitionPrototypeModel,
        )
        
        projectConfig, response, err := projectService.CreateConfig(createConfigOptions)
        if err != nil {
          panic(err)
        }
        b, _ := json.MarshalIndent(projectConfig, "", "  ")
        fmt.Println(string(b))
      • // Request models needed by this operation.
        
        // ProjectConfigDefinitionPrototypeDAConfigDefinitionPropertiesPrototype
        const projectConfigDefinitionPrototypeModel = {
          locator_id: '1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global',
          description: 'The stage environment configuration.',
          name: 'env-stage',
          inputs: { account_id: 'account_id', resource_group: 'stage', access_tags: ['env:stage'], logdna_name: 'LogDNA_stage_service', sysdig_name: 'SysDig_stage_service' },
        };
        
        const params = {
          projectId: projectIdLink,
          definition: projectConfigDefinitionPrototypeModel,
        };
        
        let res;
        try {
          res = await projectService.createConfig(params);
          console.log(JSON.stringify(res.result, null, 2));
        } catch (err) {
          console.warn(err);
        }
      • project_config_definition_prototype_model = {
          'locator_id': '1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global',
          'description': 'The stage environment configuration.',
          'name': 'env-stage',
          'inputs': {'account_id': 'account_id', 'resource_group': 'stage', 'access_tags': ['env:stage'], 'logdna_name': 'LogDNA_stage_service', 'sysdig_name': 'SysDig_stage_service'},
        }
        
        response = project_service.create_config(
          project_id=project_id_link,
          definition=project_config_definition_prototype_model,
        )
        project_config = response.get_result()
        
        print(json.dumps(project_config, indent=2))

      Response

      The standard schema of a project configuration.

      The standard schema of a project configuration.

      The standard schema of a project configuration.

      The standard schema of a project configuration.

      Status Code

      • The new resource was created.

      • The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all the required parameters in your request.

      • The credentials are invalid or authentication is required to succeed.

      • The supplied authentication is not authorized to view this resource.

      Example responses
      • The example response to a request for a deployable architecture configuration draft.

        {
          "id": "293c3c36-a094-4115-a12b-de0a9ca39be5",
          "definition": {
            "name": "env-stage",
            "description": "The stage environment configuration.",
            "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global",
            "inputs": {
              "account_id": "ref:/configs/account-stage/inputs/account_id",
              "resource_group": "stage",
              "access_tags": [
                "env:stage"
              ],
              "logdna_name": "The name of the LogDNA stage service instance.",
              "sysdig_name": "The name of the SysDig stage service instance."
            }
          },
          "is_draft": true,
          "version": 2,
          "outputs": [
            {
              "name": "resource_group_id"
            },
            {
              "name": "logdna_id"
            },
            {
              "name": "sysdig_id"
            }
          ],
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "schematics": {
            "workspace_crn": "crn:v1:staging:public:schematics:us-south:a/38acaf4469814090a4e675dc0c317a0d:95ad49de-ab96-4e7d-a08c-45c38aa448e6:workspace:us-south.workspace.service.e0106139"
          },
          "state": "validated",
          "update_available": true,
          "needs_attention_state": [],
          "created_at": "2023-02-22T19:51:23.253Z",
          "modified_at": "2023-02-22T19:51:23.253Z",
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/b0c44146-1ef6-40c2-82ba-74d51149770a",
          "deployment_mode": "project_deployed"
        }
      • The example response to a request for a deployable architecture configuration draft.

        {
          "id": "293c3c36-a094-4115-a12b-de0a9ca39be5",
          "definition": {
            "name": "env-stage",
            "description": "The stage environment configuration.",
            "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global",
            "inputs": {
              "account_id": "ref:/configs/account-stage/inputs/account_id",
              "resource_group": "stage",
              "access_tags": [
                "env:stage"
              ],
              "logdna_name": "The name of the LogDNA stage service instance.",
              "sysdig_name": "The name of the SysDig stage service instance."
            }
          },
          "is_draft": true,
          "version": 2,
          "outputs": [
            {
              "name": "resource_group_id"
            },
            {
              "name": "logdna_id"
            },
            {
              "name": "sysdig_id"
            }
          ],
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "schematics": {
            "workspace_crn": "crn:v1:staging:public:schematics:us-south:a/38acaf4469814090a4e675dc0c317a0d:95ad49de-ab96-4e7d-a08c-45c38aa448e6:workspace:us-south.workspace.service.e0106139"
          },
          "state": "validated",
          "update_available": true,
          "needs_attention_state": [],
          "created_at": "2023-02-22T19:51:23.253Z",
          "modified_at": "2023-02-22T19:51:23.253Z",
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/b0c44146-1ef6-40c2-82ba-74d51149770a",
          "deployment_mode": "project_deployed"
        }
      • The example response to a request for a resource configuration draft.

        {
          "id": "293c3c36-a094-4115-a12b-de0a9ca39be5",
          "definition": {
            "name": "shared-resources-dev",
            "description": "The shared resources for dev environments.",
            "labels": [
              "dev"
            ],
            "type": "manual",
            "resource_crns": [
              "crn:v1:staging:public:toolchain:us-south:a/d11256044e024d5bbea1a7d7ee4575c3:618c70c7-0ead-40fb-86ce-e3f7b10c9f99::"
            ]
          },
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "is_draft": false,
          "version": 2,
          "state": "applied",
          "needs_attention_state": [],
          "outputs": [],
          "created_at": "2023-02-22T19:51:23.253Z",
          "updated_at": "2023-02-22T19:51:23.253Z",
          "modified_at": "2023-02-22T19:51:23.253Z",
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/293c3c36-a094-4115-a12b-de0a9ca39be5",
          "deployment_mode": "user_deployed"
        }
      • The example response to a request for a resource configuration draft.

        {
          "id": "293c3c36-a094-4115-a12b-de0a9ca39be5",
          "definition": {
            "name": "shared-resources-dev",
            "description": "The shared resources for dev environments.",
            "labels": [
              "dev"
            ],
            "type": "manual",
            "resource_crns": [
              "crn:v1:staging:public:toolchain:us-south:a/d11256044e024d5bbea1a7d7ee4575c3:618c70c7-0ead-40fb-86ce-e3f7b10c9f99::"
            ]
          },
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "is_draft": false,
          "version": 2,
          "state": "applied",
          "needs_attention_state": [],
          "outputs": [],
          "created_at": "2023-02-22T19:51:23.253Z",
          "updated_at": "2023-02-22T19:51:23.253Z",
          "modified_at": "2023-02-22T19:51:23.253Z",
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/293c3c36-a094-4115-a12b-de0a9ca39be5",
          "deployment_mode": "user_deployed"
        }
      • Sample response to consume a stack.

        {
          "id": "293c3c36-a094-4115-a12b-de0a9ca39be5",
          "definition": {
            "name": "stack-config-example",
            "description": "A deployable architecture stack that substitutes the first member in a stack for another existing configuration.",
            "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global",
            "inputs": {
              "region": "us-south",
              "resource_group_name": "stack-rg"
            },
            "members": [
              {
                "name": "foundation-deployable-architecture",
                "config_id": "293c3c36-a094-4115-a12b-de0a9ca39beX"
              },
              {
                "name": "middleware-architecture",
                "config_id": "293c3c36-a094-4115-a12b-de0a9ca39beZ"
              }
            ]
          },
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "version": 1,
          "is_draft": true,
          "state": "draft",
          "needs_attention_state": [],
          "outputs": [
            {
              "name": "workload_cluster_server_url"
            }
          ],
          "created_at": "2023-02-22T19:51:23.253Z",
          "updated_at": "2023-02-22T19:51:23.253Z",
          "modified_at": "2023-02-22T19:51:23.253Z",
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/293c3c36-a094-4115-a12b-de0a9ca39be5"
        }
      • Sample response to consume a stack.

        {
          "id": "293c3c36-a094-4115-a12b-de0a9ca39be5",
          "definition": {
            "name": "stack-config-example",
            "description": "A deployable architecture stack that substitutes the first member in a stack for another existing configuration.",
            "locator_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc.018edf04-e772-4ca2-9785-03e8e03bef72-global",
            "inputs": {
              "region": "us-south",
              "resource_group_name": "stack-rg"
            },
            "members": [
              {
                "name": "foundation-deployable-architecture",
                "config_id": "293c3c36-a094-4115-a12b-de0a9ca39beX"
              },
              {
                "name": "middleware-architecture",
                "config_id": "293c3c36-a094-4115-a12b-de0a9ca39beZ"
              }
            ]
          },
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "version": 1,
          "is_draft": true,
          "state": "draft",
          "needs_attention_state": [],
          "outputs": [
            {
              "name": "workload_cluster_server_url"
            }
          ],
          "created_at": "2023-02-22T19:51:23.253Z",
          "updated_at": "2023-02-22T19:51:23.253Z",
          "modified_at": "2023-02-22T19:51:23.253Z",
          "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a/configs/293c3c36-a094-4115-a12b-de0a9ca39be5"
        }
      • Sample response to create a stack.

        {
          "id": "293c3c36-a094-4115-a12b-de0a9ca39be5",
          "definition": {
            "name": "stack-bottom-up-example",
            "description": "A deployable architecture stack that includes two member deployable architectures.",
            "members": [
              {
                "name": "foundation-deployable-architecture",
                "config_id": "293c3c36-a094-4115-a12b-de0a9ca39beX"
              },
              {
                "name": "middleware-architecture",
                "config_id": "293c3c36-a094-4115-a12b-de0a9ca39be5"
              }
            ]
          },
          "project": {
            "id": "cfbf9050-ab8e-ac97-b01b-ab5af830be8a",
            "definition": {
              "name": "iaas-infra-prestage-env"
            },
            "crn": "crn:v1:staging:public:project:us-south:a/06580c923e40314421d3b6cb40c01c68:cfbf9050-ab8e-ac97-b01b-ab5af830be8a::",
            "href": "https://projects.api.cloud.ibm.com/v1/projects/cfbf9050-ab8e-ac97-b01b-ab5af830be8a"
          },
          "version": 1,
          "is_draft": true,
          "state": "draft",
          "needs_attention_state": [],
          "outputs": [],
          "created_at": "2023-02-22T19:51:23.253Z",
          "updated_at": &