IBM Cloud Docs
Displaying agents

Displaying agents

You can view an agent using the agent ID to retrieve the detailed configuration information. You can also list all the agents that are created in your account.

Displaying the list of agents using UI

  1. Log in to your IBM Cloud account by using your credentials.
  2. Navigate to Schematics > Agents.
  3. Click your agent from the list to view the agent details.

Displaying the list of agents using the CLI

You can display the list of agents in your account by using the agent list CLI command.

Example

ibmcloud schematics agent list

Output


Retrieving agents...
OK
Name                              ID                                         Version   Description                                   Resource Group   Agent Location   Schematics location   Status   Tags               Agent health   
Agent-UI-Final-Testing            Agent-UI-Final-Testing.deA.3dfb                                                                    cli-testing      eu-de                                  Active                         
Vishwa-CLI-Testing                Vishwa-CLI-Testing.deA.ef99                                                                        cli-testing      eu-de                                  Active                         
agent-5-multipod                  agent-5-multipod.deA.3d58                            Srikar testing multiple pods in agent-5 ...   job-runner       eu-de                                  Active   agent_register        
agent-prod-testing-api-dec-24-2   agent-prod-testing-api-dec-24-2.deA.ca07   1.6.0     Create Agent                                  Default          us-south         eu-de                 Active   env:prod, mytest      
agent-testing-prod-cli-dec-27-2   agent-testing-prod-cli-dec-27-2.deA.727f   v1.0.0                                                  Default          us-south         eu-de                 Active                         
agent-testing-prod-cli-dec-27-3   agent-testing-prod-cli-dec-27-3.deA.fd13                                                           Default          us-south         eu-de                 Active                         
agent-testing-prod-cli-dec-27-4   agent-testing-prod-cli-dec-27-4.deA.acd4                                                           Default          us-south         eu-de                 Active                         
agent-testing-prod-cli-dec-27     agent-testing-prod-cli-dec-27.deA.3f7e                                                             Default          jp-tok         eu-de                 Active                         
gsmmar27v1cli-agent-test          gsmmar27v1cli-agent-test.deA.6288                                                                  Default          eu-de            eu-de                 Active                         
gsmmar27v2cli-agent-test          gsmmar27v2cli-agent-test.deA.afcc                                                                  Default          eu-de            eu-de                 Active                         
gsmmar27v3cli-agent-test          gsmmar27v3cli-agent-test.deA.4b56                                                                  Default          eu-de            eu-de                 Active                         
                                  
Showing 1-11 of 11 items

Displaying agent configuration using CLI

You can view the configuration of an agent by using the agent get command. This command requires agent_id as an input argument.

To view the agent get commands, syntax, and option flag details, see ibmcloud schematics agent get.

Example

ibmcloud schematics agent get --id agent-testing-prod-cli-dec-27-5.deA.dc97 

Output

Retrieving agent...
OK
                    
ID               agent-testing-prod-cli-dec-27-5.deA.dc97   
Name             agent-testing-prod-cli-dec-27-5   
Status           ACTIVE   
Version          1.0.0   
Location         eu-de   
Agent Location   jp-tok   
Resource Group   Default   
                 
Recent Job   Job ID               Status                 Last modified   
DEPLOY       .ACTIVITY.465e9716   Triggered deployment   2023-03-27T12:25:01.239Z 

Displaying agents using the API

Follow the steps to retrieve your IAM access token and authenticate with IBM Cloud Schematics by using the API.

Example to list all the agents in your account.

LIST /v2/agents/ HTTP/1.1
Host: schematics.cloud.ibm.com
Content-Type: application/json
Authorization: Bearer <auth_token>

Output

{
    "name": "agent-beta1-testing",
    "description": "Create Agent",
    "resource_group": "schematics-prod",
    "tags": [
        "env:prod",
        "mytest"
    ],
    "version": "v1.0.0",
    "schematics_location": "us-south",
    "agent_location": "jp-tok",
    "user_state": {
        "state": "enable",
        "set_by": "test@in.ibm.com",
        "set_at": "2023-03-16T06:12:13.684097462Z"
    },
    "agent_crn": "crn:v1:bluemix:public:schematics:us-south:a/c19ef85117044059a3be5e45d6dc1cf6:347160c0-dca9-49e8-a292-9c980c7f8c47:agent:agent-beta1-testing.soA.748e",
    "created_at": "2023-03-16T06:12:13.684112846Z",
    "creation_by": "geetha_sathyamurthy@in.ibm.com",
    "updated_at": "0001-01-01T00:00:00Z",
    "system_state": {
        "status_code": "draft"
    },
    "agent_kpi": {
        "availability_indicator": "normal",
        "lifecycle_indicator": "consistent",
        "percent_usage_indicator": "30%"
    }
}

The agent get operation returns the agent configuration information based on your agent ID.

Example

GET /v2/agents/agent-beta1-testing.soA.748e/ HTTP/1.1
Host: schematics.cloud.ibm.com
Content-Type: application/json
Authorization: Bearer <auth_token>

Output

{
    "name": "agent-beta1-testing",
    "description": "Create Agent",
    "resource_group": "schematics-prod",
    "tags": [
        "env:prod",
        "mytest"
    ],
    "version": "v1.0.0",
    "schematics_location": "us-south",
    "agent_location": "us-south",
    "user_state": {
        "state": "enable",
        "set_by": "test@in.ibm.com",
        "set_at": "2023-03-16T06:12:13.684097462Z"
    },
    "agent_crn": "crn:v1:bluemix:public:schematics:us-south:a/c19ef85117044059a3be5e45d6dc1cf6:347160c0-dca9-49e8-a292-9c980c7f8c47:agent:agent-beta1-testing.soA.748e",
    "created_at": "2023-03-16T06:12:13.684112846Z",
    "creation_by": "test@in.ibm.com",
    "updated_at": "0001-01-01T00:00:00Z",
    "system_state": {
        "status_code": "draft"
    },
    "agent_kpi": {
        "availability_indicator": "normal",
        "lifecycle_indicator": "consistent",
        "percent_usage_indicator": "30%"
    }
}

Next steps