CasC bundle management on Operations Center

The CasC bundle management on Operations Center API allows users to view the master paths and tokens for all CasC bundles on an Operations Center. It also allows users to assign master paths and regenerate tokens.

Authentication

To access the CasC bundle management on Operations Center API you need an API authentication token and administrator access rights. See API authentication for more information.

Endpoints and methods

Table 1. Endpoints and methods
Endpoint Description Parameters

GET /casc-bundle/list

Lists all of the available CasC bundles on the Operations Center.

None.

POST /casc-bundle/regenerate-token

Regenerates the token and returns the new bundle information when successful.

  • Name: bundleId

    • Parameter type: Query string parameter

    • Data type: string

    • Description: The name of the file that contains the CasC bundle. Ex. casc-bundle-java

POST /casc-bundle/set-master-to-bundle

Assigns a new master path and returns the new bundle information when successful.

  • Name: bundleId

    • Parameter type: Query string parameter

    • Data type: string

    • Description: The bundle id is the name of the file that contains the CasC bundle. Ex. casc-bundle-java.

  • Name: masterPath

    • Parameter type: Query string parameter

    • Data type: string

    • Description: The Master Path attribute is the relative path of the master item in Operations Center. Ex. folder1/mm-example-casc.

Request examples

Table 2. Request examples
Endpoint Request example

GET /casc-bundle/list

curl --user "admin:rG57xFa2eFrCeWjG4NKU5QMJeW9TzfSkym" -XGET "https://my-operation-center.com/cjoc/casc-bundle/list"

POST /casc-bundle/regenerate-token

curl --user "admin:rG57xFa2eFrCeWjG4NKU5QMJeW9TzfSkym" -XPOST https://my-operation-center.com/cjoc/casc-bundle/regenerate-token?bundleId=casc-bundle-java

POST /casc-bundle/set-master-to-bundle

curl --user "admin:rG57xFa2eFrCeWjG4NKU5QMJeW9TzfSkym" -XPOST "https://my-operation-center.com/cjoc/casc-bundle/set-master-to-bundle?bundleId=casc-bundle-java&masterPath=/my-new/path"
In the request examples "admin" is the name of the user attempting to send the request and "https://my-operations-center.com/cjoc/" is the url for the Operations Center.

Response examples

GET /casc-bundle/list POST /casc-bundle/regenerate-token POST /casc-bundle/set-master-to-bundle
{
    "bundles":[
        {
            "linkFileContent":"url: \"https://my-operation-center.com/cjoc/config-bundle/casc-bundle-java\"\ntoken: \"048f49a4-3b37-4ccf-b536-0cc7a3b148d5\"\n",
            "masterPath":"/controllers/path",
            "name":"casc-bundle-java",
            "url":"https://my-operation-center.com/cjoc/config-bundle/casc-bundle-java",
            "token":"048f49a4-3b37-4ccf-b536-0cc7a3b148d5"
        }
    ]
}
{
    "linkFileContent":"url: \"https://my-operation-center.com/config-bundle/casc-bundle-java\"\ntoken: \"e33d986f-b11b-43c2-8d20-8109854241e0\"\n",
    "masterPath":"/new/path",
    "name":"casc-bundle-java",
    "url":"https://my-operation-center.com/config-bundle/casc-bundle-java",
    "token":"e33d986f-b11b-43c2-8d20-8109854241e0"
}
{
    "linkFileContent": "url: \"https://my-operation-center.com/config-bundle/casc-bundle-java\"\ntoken: \"4b0c02cc-6a7f-4bab-8d8f-38e98684994d\"\n",
    "masterPath":"/My-new/path",
    "name":"casc-bundle-java",
    "url":"https://my-operation-center.com/config-bundle/casc-bundle-java",
    "token":"4b0c02cc-6a7f-4bab-8d8f-38e98684994d"}
Response examples are formatted for better readability.

Response model

Table 3. Response model
Element Type Description

bundles

array of objects

List of all bundles available on an Operations Center.

linkFileContent

string

Contains two entries in string format wrapped in quotes and separated by newline characters: url and token. The url is the the bundle URL where Operations Center exposes its content. The token is the access token for the bundle.

masterPath

string

The Master Path attribute is the full path of the master item from Operations Center root. Ex. folder1/mm-example-casc.

name

string

The name is the name of the file that contains the CasC bundle. Ex. casc-bundle-java.

url

string

The url is the bundle URL where Operations Center exposes its content.

token

string

The token is the access token for the bundle.

Status and error codes

Table 4. Status and error codes
Code Description

200

Success

403

Not authorized. Administrator permission required.

404

The provided master path, endpoint, or method cannot be found.

500

Server error.