### Schema: WorkspaceActivityStatus
Source: https://cloud.ibm.com/apidocs/schematics/schematics.json
The status of your activity or job. To retrieve the URL to your job logs, use the GET /v1/workspaces/{id}/actions/{action_id}/logs API.
* **COMPLETED**: The job completed successfully.
* **CREATED**: The job was created, but the provisioning, modification, or removal of IBM Cloud resources has not started yet.
* **FAILED**: An error occurred during the plan, apply, or destroy job. Use the job ID to retrieve the URL to the log files for your job.
* **IN PROGRESS**: The job is in progress. You can use the log_url to access the logs.
```markdown
## Schema: WorkspaceActivityStatus
The status of your activity or job. To retrieve the URL to your job logs, use the GET /v1/workspaces/{id}/actions/{action_id}/logs API.
* **COMPLETED**: The job completed successfully.
* **CREATED**: The job was created, but the provisioning, modification, or removal of IBM Cloud resources has not started yet.
* **FAILED**: An error occurred during the plan, apply, or destroy job. Use the job ID to retrieve the URL to the log files for your job.
* **IN PROGRESS**: The job is in progress. You can use the log_url to access the logs.
**Type:** string
```
--------------------------------
### GET /v2/inventories/{inventory_id}
Source: https://cloud.ibm.com/apidocs/schematics/schematics.json
Use this API to retrieve the detailed information for a resource inventory definition used to target an action in your IBM Cloud account. For more information, about inventory get, refer to [ibmcloud schematics inventory get](https://cloud.ibm.com/docs/schematics?topic=schematics-schematics-cli-reference#schematics-get-inv).
**Note** you can fetch only the location and region, resource group from where your inventory is created.
Also, make sure your IP addresses are in the [allowlist](https://cloud.ibm.com/docs/schematics?topic=schematics-allowed-ipaddresses).
Authorization
Schematics support generic authorization for its resources.
For more information, about Schematics access and permissions, see
[Schematics service access roles and required permissions](https://cloud.ibm.com/docs/schematics?topic=schematics-access#access-roles).
```markdown
### Parameters
- **Authorization** (string, header, required): The IAM access token for your IBM Cloud account. You can use the client ID and the secret that are used by the IBM Cloud command line 'bx / bx'. To retrieve the token, run `ic iam oauth-tokens` in the IBM Cloud command line.
- **inventory_id** (string, path, required): Resource Inventory Id. Use `GET /v2/inventories` API to look up the Resource Inventory definition Ids in your IBM Cloud account.
- **profile** (string (summary|detailed|ids), query, optional): Level of details returned by the get method
### Responses
#### 200 - Successfully retrieved the resource inventory definition
**InventoryResourceRecord**
- **name** (string): The unique name of your Inventory. The name can be up to 128 characters long and can include alphanumeric characters, spaces, dashes, and underscores.
- **id** (string): Inventory id
- **description** (string): The description of your Inventory. The description can be up to 2048 characters long in size.
- **location** (string (us-south|us-east|eu-gb|eu-de)): List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics. ("us-south"|"us-east"|"eu-gb"|"eu-de")
- **resource_group** (string): Resource-group name for the Inventory definition. By default, Inventory will be created in Default Resource Group
- **created_at** (string (date-time)): Inventory creation time
- **created_by** (string): Email address of user who created the Inventory
- **updated_at** (string (date-time)): Inventory updation time
- **updated_by** (string): Email address of user who updated the Inventory
- **inventories_ini** (string): Input inventory of host and host group for the playbook, in the .ini file format.
- **resource_queries** (array (string)): Input resource queries that is used to dynamically generate the inventory of host and host group for the playbook
- **connection_type** (string): connection type to be ssh or wirm
- **credentials** (array (CredentialVariableData)): common credentials for the inventory
Array items:
- **name** (string): The name of the credential variable.
- **value** (string): The credential value for the variable or reference to the value. **Note** The SSH key should contain three `\n` in the SSH key value as shown in the example for CLI or API calls. When using Bastion from API you need to add SSH key in both `credentials` and `bastion_credentials`. (example: "-----BEGIN OPENSSH PRIVATE KEY-----\\nXXXXXXXXXXXXX\\n-----END OPENSSH PRIVATE KEY-----\\n")
- **use_default** (boolean): True, will ignore the data in the value attribute, instead the data in metadata.default_value will be used
- **metadata** (object): An user editable metadata for the credential variables.
- **type** (string (string|link)): Type of the variable. ("string"|"link")
- **aliases** (array (string)): The list of aliases for the variable name.
- **description** (string): The description of the meta data.
- **cloud_data_type** (string): Cloud data type of the credential variable. eg. api_key, iam_token, profile_id
- **default_value** (string): Default value for the variable only if the override value is not specified.
- **link_status** (string (normal|broken)): The status of the link ("normal"|"broken")
- **immutable** (boolean): Is the variable readonly ?
- **hidden** (boolean): If **true**, the variable is not displayed on UI or Command line.
- **required** (boolean): If the variable required?
- **position** (integer): The relative position of this variable in a list.
- **group_by** (string): The display name of the group this variable belongs to.
- **source** (string): The source of this meta-data.
- **link** (string): The reference link to the variable value By default the expression points to `$self.value`.
- **bastion** (object): Describes a bastion resource
- **name** (string): Bastion Name; the name must be unique
- **host** (string): Reference to the Inventory resource definition
- **bastion_credential** (object): User editable credential variable data and system generated reference to the value.
- **inventory_view** (object): Inventories' structured view for the provided inventory
- **groups** (array (Group))
Array items:
- **name** (string): Name of the group.
- **vars** (array (VariableData)): group level variables
Array items:
- **credentials** (array (CredentialVariableData)): inventory host group credentials
Array items:
- **hosts** (array (Host))
Array items:
- **name** (string): Host name/IP.
- **credential** (array (CredentialVariableData)): host credentials
Array items:
#### 400 - Bad request - Verify that the information in your request body is complete and correctly formatted in JSON.
**APIResponseMessage**
- **message** (string): Message text
- **message_id** (string): The message ID for translation.
- **request_id** (string): The request ID for request tracking.
- **status_code** (integer (int64)): The API response code.
- **timestamp** (string (date-time)): The API response timestamp.
#### 401 - The IAM authorization token for the request is missing, invalid, expired, or has no account. Check that the token value is correct or generate a new token with the `ibmcloud iam oauth-tokens` command.
**APIResponseMessage**
- **message** (string): Message text
- **message_id** (string): The message ID for translation.
- **request_id** (string): The request ID for request tracking.
- **status_code** (integer (int64)): The API response code.
- **timestamp** (string (date-time)): The API response timestamp.
#### 403 - Unauthorized access. Check that you have the correct access credentials and permissions.
**APIResponseMessage**
- **message** (string): Message text
- **message_id** (string): The message ID for translation.
- **request_id** (string): The request ID for request tracking.
- **status_code** (integer (int64)): The API response code.
- **timestamp** (string (date-time)): The API response timestamp.
#### 404 - The specified resource was not found
**APIResponseMessage**
- **message** (string): Message text
- **message_id** (string): The message ID for translation.
- **request_id** (string): The request ID for request tracking.
- **status_code** (integer (int64)): The API response code.
- **timestamp** (string (date-time)): The API response timestamp.
#### 500 - Internal server error. IBM Cloud Schematics is currently unavailable. Wait a few minutes, then try again. If the error persists, contact [IBM Cloud support](/docs/schematics?topic=schematics-schematics-help).
**APIResponseMessage**
- **message** (string): Message text
- **message_id** (string): The message ID for translation.
- **request_id** (string): The request ID for request tracking.
- **status_code** (integer (int64)): The API response code.
- **timestamp** (string (date-time)): The API response timestamp.
### Example Usage
```bash
curl -X GET "https://schematics.cloud.ibm.com/v2/inventories/{inventory_id}?profile=summary"
```
```
--------------------------------
### GET /v2/agents/{agent_id}
Source: https://cloud.ibm.com/apidocs/schematics/schematics.json
Retrieve a detailed configuration of an agent with a specific agent ID. The agent that is returned depends on the API endpoint that you use. For example, if you use an API endpoint for a geography, such as North America, only agents that are created in `us-south or `us-east` are returned. For more information about frequently asked questions, see [FAQ](https://cloud.ibm.com/docs/schematics?topic=schematics-faqs-agent) and [Troubleshooting guide](https://cloud.ibm.com/docs/schematics?topic=schematics-agent-crn-not-found).
For more information about supported API endpoints, see [API endpoint](https://cloud.ibm.com/apidocs/schematics/schematics#api-endpoints).
Authorization
Schematics support generic authorization for its resources.
For more information, about Schematics access and permissions, see [Schematics service access
roles and required permissions](https://cloud.ibm.com/docs/schematics?topic=schematics-access#access-roles).
```markdown
### Parameters
- **Authorization** (string, header, required): The IAM access token for your IBM Cloud account. You can use the client ID and the secret that are used by the IBM Cloud command line 'bx / bx'. To retrieve the token, run `ic iam oauth-tokens` in the IBM Cloud command line.
- **agent_id** (string, path, required): Agent ID to get the details of agent
- **profile** (string (summary|detailed|ids), query, optional): Level of details returned by the get method
### Responses
#### 200 - Successfully got the agent details
**AgentData**
- **name** (string) (required): The name of the agent (must be unique, for an account). (example: "MyDevAgent")
- **description** (string): Agent description. (example: "Create Agent")
- **resource_group** (string) (required): The resource-group name for the agent. By default, agent will be registered in Default Resource Group. (example: "Default")
- **tags** (array (string)): Tags for the agent.
- **version** (string) (required): Agent version (example: "v1.0.0")
- **schematics_location** (string (us-south|us-east|eu-gb|eu-de)) (required): List of locations supported by IBM Cloud Schematics service. While creating your workspace or action, choose the right region, since it cannot be changed. Note, this does not limit the location of the IBM Cloud resources, provisioned using Schematics. ("us-south"|"us-east"|"eu-gb"|"eu-de")
- **agent_location** (string) (required): The location where agent is deployed in the user environment. (example: "us-south")
- **agent_infrastructure** (object) (required): The infrastructure parameters used by the agent.
- **infra_type** (string (ibm_kubernetes|ibm_openshift|ibm_satellite)): Type of target agent infrastructure. ("ibm_kubernetes"|"ibm_openshift"|"ibm_satellite")
- **cluster_id** (string): The cluster ID where agent services will be running.
- **cluster_resource_group** (string): The resource group of the cluster (is it required?)
- **cos_instance_name** (string): The COS instance name to store the agent logs.
- **cos_bucket_name** (string): The COS bucket name used to store the logs.
- **cos_bucket_region** (string): The COS bucket region.
- **agent_metadata** (array (AgentMetadataInfo)): The metadata of an agent. (example: [{"name":"purpose","value":["git","terraform","ansible"]},{"name":"git_endpoints","value":["private-git.github.com","gitlab.com","private-git.gitlab.com"]}])
Array items:
- **name** (string): Name of the metadata. (example: "purpose")
- **value** (array (string)): Value of the metadata name. (example: "[\"git\", \"terraform\", \"ansible\"]")
- **agent_inputs** (array (VariableData)): Additional input variables for the agent
Array items:
- **name** (string): The name of the variable. For example, `name = "inventory username"`.
- **value** (string): The value for the variable or reference to the value. For example, `value = ""`.
- **use_default** (boolean): True, will ignore the data in the value attribute, instead the data in metadata.default_value will be used
- **metadata** (object): An user editable metadata for the variables.
- **type** (string (boolean|string|integer|date|array|list|map|complex|link)): Type of the variable. ("boolean"|"string"|"integer"|"date"|"array"|"list"|"map"|"complex"|"link")
- **aliases** (array (string)): The list of aliases for the variable name.
- **description** (string): The description of the meta data.
- **cloud_data_type** (string): Cloud data type of the variable. eg. resource_group_id, region, vpc_id.
- **default_value** (string): Default value for the variable only if the override value is not specified.
- **link_status** (string (normal|broken)): The status of the link ("normal"|"broken")
- **secure** (boolean): Is the variable secure or sensitive ?
- **immutable** (boolean): Is the variable readonly ?
- **hidden** (boolean): If **true**, the variable is not displayed on UI or Command line.
- **required** (boolean): If the variable required?
- **options** (array (string)): The list of possible values for this variable. If type is **integer** or **date**, then the array of string is converted to array of integers or date during the runtime.
- **min_value** (integer): The minimum value of the variable. Applicable for the integer type.
- **max_value** (integer): The maximum value of the variable. Applicable for the integer type.
- **min_length** (integer): The minimum length of the variable value. Applicable for the string type.
- **max_length** (integer): The maximum length of the variable value. Applicable for the string type.
- **matches** (string): The regex for the variable value.
- **position** (integer): The relative position of this variable in a list.
- **group_by** (string): The display name of the group this variable belongs to.
- **source** (string): The source of this meta-data.
- **link** (string): The reference link to the variable value By default the expression points to `$self.value`.
- **user_state** (object): User defined status of the agent
- **state** (string (enable|disable)): User-defined states
* `enable` Agent is enabled by the user.
* `disable` Agent is disbaled by the user. ("enable"|"disable")
- **set_by** (string): Name of the User who set the state of the Object
- **set_at** (string (date-time)): When the User who set the state of the Object
- **agent_crn** (string): The agent crn, obtained from the Schematics agent deployment configuration.
- **id** (string): The agent resource id.
- **created_at** (string (date-time)): The agent creation date-time.
- **creation_by** (string): The email address of an user who created the agent.
- **updated_at** (string (date-time)): The agent registration updation time.
- **updated_by** (string): Email address of user who updated the agent registration.
- **system_state** (object): Computed state of the agent
- **status_code** (string (error|normal|in_progress|pending|draft)): Agent Status ("error"|"normal"|"in_progress"|"pending"|"draft")
- **status_message** (string): The agent status message.
- **agent_kpi** (object): Schematics Agent key performance indicators.
- **availability_indicator** (string (available|unavailable|error)): Overall availability indicator reported by the agent ("available"|"unavailable"|"error")
- **lifecycle_indicator** (string (consistent|inconsistent|obselete)): Overall lifecycle indicator reported by the agents ("consistent"|"inconsistent"|"obselete")
- **percent_usage_indicator** (string): Percentage usage of the agent resources.
- **application_indicators** (array (unknown)): Agent application key performance indicators.
- **infra_indicators** (array (unknown)): Agent infrastructure key performance indicators.
- **recent_prs_job** (object): Run a pre-requisite scanner for deploying agent.
- **agent_id** (string): Id of the agent.
- **job_id** (string): Job Id
- **updated_at** (string (date-time)): The agent prs job updation time.
- **updated_by** (string): Email address of user who ran the agent prs job.
- **agent_version** (string): Agent version (example: "v1.0.0")
- **status_code** (string (job_pending|job_in_progress|job_finished|job_failed|job_cancelled|job_stopped|job_stop_in_progress|job_ready_to_execute)): Status of Jobs ("job_pending"|"job_in_progress"|"job_finished"|"job_failed"|"job_cancelled"|"job_stopped"|"job_stop_in_progress"|"job_ready_to_execute")
- **status_message** (string): The outcome of the pre-requisite scanner job, in a formatted log string.
- **log_url** (string): URL to the full pre-requisite scanner job logs.
- **recent_deploy_job** (object): Post-installations checks for Agent health.
- **agent_id** (string): Id of the agent.
- **job_id** (string): Job Id
- **updated_at** (string (date-time)): The agent deploy job updation time.
- **updated_by** (string): Email address of user who ran the agent deploy job.
- **is_redeployed** (boolean): True, when the same version of the agent was redeployed. (example: false)
- **agent_version** (string): Agent version. (example: "v1.0.0")
- **status_code** (string (job_pending|job_in_progress|job_finished|job_failed|job_cancelled|job_stopped|job_stop_in_progress|job_ready_to_execute)): Status of Jobs ("job_pending"|"job_in_progress"|"job_finished"|"job_failed"|"job_cancelled"|"job_stopped"|"job_stop_in_progress"|"job_ready_to_execute")
- **status_message** (string): The outcome of the agent deployment job, in a formatted log string.
- **log_url** (string): URL to the full agent deployment job logs.
- **recent_health_job** (object): Agent health check
- **recent_destroy_job** (object): destroy resource provisoned by agent deploy method.
- **encryption** (object): Encryption details about the workspace such as scheme (byok/kyok) and key CRN.
- **crn** (string): Key CRN
- **scheme** (string): Encryption scheme
#### 401 - The IAM authorization token for the request is missing, invalid, expired, or has no account. Check that the token value is correct or generate a new token with the `ibmcloud iam oauth-tokens` command.
**APIResponseMessage**
- **message** (string): Message text
- **message_id** (string): The message ID for translation.
- **request_id** (string): The request ID for request tracking.
- **status_code** (integer (int64)): The API response code.
- **timestamp** (string (date-time)): The API response timestamp.
#### 403 - Unauthorized access. Check that you have the correct access credentials and permissions.
**APIResponseMessage**
- **message** (string): Message text
- **message_id** (string): The message ID for translation.
- **request_id** (string): The request ID for request tracking.
- **status_code** (integer (int64)): The API response code.
- **timestamp** (string (date-time)): The API response timestamp.
#### 404 - The specified resource was not found
**APIResponseMessage**
- **message** (string): Message text
- **message_id** (string): The message ID for translation.
- **request_id** (string): The request ID for request tracking.
- **status_code** (integer (int64)): The API response code.
- **timestamp** (string (date-time)): The API response timestamp.
#### 500 - Internal server error. IBM Cloud Schematics is currently unavailable. Wait a few minutes, then try again. If the error persists, contact [IBM Cloud support](/docs/schematics?topic=schematics-schematics-help).
**APIResponseMessage**
- **message** (string): Message text
- **message_id** (string): The message ID for translation.
- **request_id** (string): The request ID for request tracking.
- **status_code** (integer (int64)): The API response code.
- **timestamp** (string (date-time)): The API response timestamp.
### Example Usage
```bash
curl -X GET "https://schematics.cloud.ibm.com/v2/agents/{agent_id}?profile=summary"
```
```