blueprints

Use this resource to retrieve a list of blueprints that meet specified criteria.

Method summary

HTTP Method Path Description
GET /bwl/blueprints Returns a list of blueprints that meet specified criteria. The criteria are expressed using zero or more filter parameters (space-id, space-name, archived-state) and exactly one search parameter (name or tag). Only blueprints that you have access to will be returned.

GET /blueprints

Description
Use this method to return a list of blueprints that meet specified criteria.
Resource information
Requirements Description
Response format JSON
Requires authentication Yes
Supports OAuth 2 client credentials Yes using a User Service ID containing Artifact Reporting Category
Parameters
Name Location Description Required Type
X-IBM-API-Version Header The version of this API. If you are programming against the API, you MUST include the version. If omitted, the latest version of the API is used, which might be incompatible with prior versions.

The current value is 1.0.0.

No String
X-On-Behalf-Of Header The user context. The value must be a username in the account. The user must have permission to perform the action in the account and in the specified parent space, if any. Required if Service ID OAuth credentials are used. Not required when using User Service ID OAuth credential. String
archived-state Query Filters the results based on the archived state of the artifact. If not specified, active is assumed.

The only allowed values are active and archived.

No String
name Query If specified, only blueprints with this exact name are returned. Either a name or a tag must be specified, but not both. No String
space-id Query The identifier of the space to search within. If not specified, the search is account wide. If this space contains child spaces, the child spaces will also be searched. If both a space-id and space-name are specified, the space-id takes precedence. No String
space-name Query The name of the space to search within. If not specified, the search is account wide. If both a space-id and space-name are specified, the space-id takes precedence. No String
tag Query If specified, only blueprints with this exact tag are returned. Either a name or a tag must be specified, but not both. No String
Response
Example input
LIST all blueprints named MyBlueprint within the space named MySpace, in an account that you have access to:
  • Using User Service ID OAuth 2 client credentials:
    curl -i -H "Authorization: Bearer access_token" -H  
        "https://your_server_url/bwl/blueprints?space-name=MySpace&name=MyBlueprint"
  • Using Service ID OAuth 2 client credentials:
    curl -i -H "Authorization: Bearer access_token" -H  
        "https://your_server_url/bwl/blueprints?space-name=MySpace&name=MyBlueprint"
  • Using Service ID OAuth 2 client credentials with user context:
    curl -i -H "Authorization: Bearer access_token" -H "X-On-Behalf-Of:user_name@domain.com" 
        "https://your_server_url/bwl/blueprints?space-name=MySpace&name=MyBlueprint"
Example output
LIST all blueprints named MyBlueprint within the space named MySpace, in an account that you have access to:
[
  {
    "id": "af0002",
    "name": "My Blueprint",
    "type": "blueprint",
    "space-ids": [
      "1310cb"
    ],
    "space-names": [
      "My Space"
    ],
    "archived-state": "active",
    "published-state": "unpublished",
    "last-modified-date": "2017-02-03T22:41:41.384+0000",
    "last-modified-by-user": {
      "id": "50029",
      "full-name": "Edith Editor",
      "email-address": "edith"
    },
    "created-date": "2017-02-01T22:41:41.260+0000",
    "created-by-user": {
      "id": "50029",
      "full-name": "Edith Editor",
      "email-address": "edith"
    }
  }
]
Response messages
HTTP code Reason
200

The request was completed successfully.

400

There was an error processing the request. Required parameters were missing or contained invalid values.

401
This user didn't pass authentication. This response could appear for the following reasons:
  • An invalid username or password was provided.
  • This user belongs to multiple accounts and an account wasn't specified in the request.
403
Access is forbidden. This message might appear for one of the following reasons:
  • The specified credentials are invalid.
  • This user isn't an editor for this process.
  • APIs aren't enabled by the administrator. APIs must be enabled on the Account Information tab.
  • The administrator didn't accept the Terms and Conditions of service.
More details
To get more details about the operations and response values, use a Swagger Editor to view the APIs:
  1. Download the rest-apis.zip file.
  2. Extract the openapi.yaml file.
  3. Open a web browser, and navigate to https://editor-next.swagger.io/.
  4. Import openapi.yaml using the File > Import File option.