{
  "openapi": "3.0.0",
  "info": {
    "title": "Activity Tracker API Version 2",
    "description": "## Introduction\n\nYou can configure [IBM Cloud® Activity Tracker Event Routing to manage auditing events in your IBM Cloud account.](https://cloud.ibm.com/docs/atracker?topic=atracker-getting-started)\n\nIBM Cloud Activity Tracker Event Routing provides a REST API that you can use with the golang language to define, retrieve, and modify targets and routes. For details about using IBM Cloud Activity Tracker Event Routing, see the IBM Cloud Activity Tracker Event Routing [documentation](https://cloud.ibm.com/docs/atracker).\n\n## Endpoint URL\n\nYou can use private and public endpoints to manage IBM Cloud Activity Tracker Event Routing.\n\nThe IBM Cloud Activity Tracker Event Routing API uses the following regional private endpoint URL.\n\n```text\nhttps://private.<region>.atracker.cloud.ibm.com\n```\n\nThe IBM Cloud Activity Tracker Event Routing API uses the following regional public endpoint URL.\n\n```text\nhttps://<region>.atracker.cloud.ibm.com\n```\n\nWhen you call the API, you must add the path for each method to form the complete API endpoint for your request.\n\nReplace `<region>` with the prefix that represents the geographic area where you would like to enable the IBM Cloud Activity Tracker Event Routing service. For more information, see [Locations](https://cloud.ibm.com/docs/atracker?topic=atracker-regions).\n\nFor more information about supported endpoints, see [Endpoints](https://cloud.ibm.com/docs/atracker?topic=atracker-endpoints).\n\nExample API request\n\n```bash\ncurl -X <request_method> \"https://private.<region>.atracker.cloud.ibm.com/<method_endpoint>\"\n```\n\nReplace `<request_method>`, `<region`, and `<method_endpoint>` in this example with the values for your particular API call. Some API calls require an additional request payload. See the API Schema and examples for details.\n\n## Authentication\n\nTo call each method, you'll 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 [Managing access with IAM](https://cloud.ibm.com/docs/atracker?topic=atracker-iam).\n\nTo work with the API, authenticate your app or service by including your IBM Cloud [IAM access token.](https://cloud.ibm.com/docs/atracker?topic=atracker-iam)\n\nYou can build your API request by pairing a [service endpoint](https://cloud.ibm.com/docs/atracker?topic=atracker-endpoints) with your authentication credentials. For example, if you plan to configure a routing target for the `us-south` region for your auditing events, use the following endpoint and API headers to list the targets in your service:\n\n```bash\ncurl -X GET \\\n    \"https://private.us-south.atracker.cloud.ibm.com/api/v2/targets\" \\\n    -H \"accept: application/json\" \\\n    -H \"Authorization: Bearer <access_token>\" \\\n```\n\nReplace `<access_token>` with your IBM Cloud IAM token.\n\nYou can retrieve an access token by first creating an API key, and then exchanging your API key for an IBM Cloud IAM token. For more information, see [Retrieving an access token programmatically](https://cloud.ibm.com/docs/atracker?topic=atracker-retrieve-iam-token&interface=api).\n\nTo find out more about setting up the IBM Cloud Activity Tracker Event Routing API, see [Getting started](https://cloud.ibm.com/docs/atracker?topic=atracker-getting-started).\n\nTo retrieve your access token:\n\n```bash\ncurl -X POST \\\n\"https://iam.cloud.ibm.com/identity/token\" \\\n  -H \"Content-Type: application/x-www-form-urlencoded\" \\\n  -H \"Accept: application/json\" \\\n  -d \"grant_type=urn%3Aibm%3Aparams%3Aoauth%3Agrant-type%3Aapikey&apikey=<API_KEY>\" > token.json\n```\n\nReplace `<API_KEY>` with your [service credentials.](https://cloud.ibm.com/docs/atracker?topic=atracker-retrieve-iam-token&interface=api) Then use the full\n`access_token` value, prefixed by the _Bearer_ token type, to authenticate your API requests.\n\n## Auditing\n\nYou can monitor API activity within your account by using IBM Cloud Activity Tracker Event Routing. For more information, see [Getting started](https://cloud.ibm.com/docs/atracker?topic=atracker-getting-started).\n\nWhenever an API method is called, an auditing event is generated that you can then track and audit in your account. The specific event type is listed for each individual method.\n\n## Error handling\n\nThe IBM Cloud Activity Tracker Event Routing service uses standard HTTP response codes to indicate whether a method completed successfully. A `200` response always indicates success. A `400` type response is some sort of failure, and a `500` type response usually indicates an internal system error.\n\n| Status code | Status |\tDescription                    |\n|-------------|-------------|--------------------------------|\n|   200       | OK          | The request was successful. |\n|   201       | OK          | The request was successful. A resource is created. |\n|   400       | Bad Request | The request was unsuccessful. This is often due to a missing required parameter. |\n|   401       | Unauthorized| The IAM token that is used in the API request is invalid or expired. |\n|   403       | Forbidden   | The operation is forbidden due to insufficient permissions. |\n|   404       | Not Found   | The requested resource doesn't exist or is already deleted. |\n|   429       | Too Many Requests | Too many requests hit the API too quickly. |\n|   500       | Internal Server Error | Something went wrong when processing your request. |",
    "version": "2.0.0",
    "contact": {
      "name": "IBM Cloud Activity Tracker Event Routing",
      "url": "https://cloud.ibm.com/docs/services/atracker"
    },
    "license": {
      "name": "IBM-License",
      "url": "http://ibm.com/LICENSE-IBM"
    },
    "x-ibm-name": "atracker",
    "x-try-it-out-enabled": {
      "enabled": false,
      "credentials": false,
      "defaultApiEndpoint": "https://private.us-south.atracker.cloud.ibm.com",
      "corsPolicy": true
    },
    "x-alternate-name": "atracker",
    "x-codegen-config": {
      "improvedNameFormattingV2": true,
      "go": {
        "apiPackage": "github.com/IBM/platform-services-go-sdk"
      },
      "java": {
        "apiPackage": "com.ibm.cloud.platform_services"
      },
      "python": {
        "apiPackage": "ibm_platform_services"
      },
      "terraform": {
        "apiEndpoint": "IBMCLOUD_ATRACKER_API_ENDPOINT"
      }
    },
    "x-github": "https://github.ibm.com/cloud-api-docs/atracker",
    "x-github-issues": "https://github.ibm.com/cloud-api-docs/atracker/issues/new",
    "x-last-updated": "2025-01-17"
  },
  "tags": [
    {
      "description": "Activity Tracker Target APIs",
      "name": "Targets"
    },
    {
      "description": "Activity Tracker Route APIs",
      "name": "Routes"
    },
    {
      "description": "Activity Tracker Account wide settings",
      "name": "Settings"
    }
  ],
  "servers": [
    {
      "url": "https://us-south.atracker.cloud.ibm.com",
      "x-ibm-region": "us-south",
      "description": "The server for IBM Cloud Activity Tracker Service in the us-south region."
    },
    {
      "url": "https://private.us-south.atracker.cloud.ibm.com",
      "x-ibm-region": "private.us-south",
      "description": "The server for IBM Cloud Activity Tracker Service in the us-south region."
    },
    {
      "url": "https://us-east.atracker.cloud.ibm.com",
      "x-ibm-region": "us-east",
      "description": "The server for IBM Cloud Activity Tracker Service in the us-east region."
    },
    {
      "url": "https://private.us-east.atracker.cloud.ibm.com",
      "x-ibm-region": "private.us-east",
      "description": "The server for IBM Cloud Activity Tracker Service in the us-east region."
    },
    {
      "url": "https://eu-de.atracker.cloud.ibm.com",
      "x-ibm-region": "eu-de",
      "description": "The server for IBM Cloud Activity Tracker Service in the eu-de region."
    },
    {
      "url": "https://private.eu-de.atracker.cloud.ibm.com",
      "x-ibm-region": "private.eu-de",
      "description": "The server for IBM Cloud Activity Tracker Service in the eu-de region."
    },
    {
      "url": "https://eu-gb.atracker.cloud.ibm.com",
      "x-ibm-region": "eu-gb",
      "description": "The server for IBM Cloud Activity Tracker Service in the eu-gb region."
    },
    {
      "url": "https://private.eu-gb.atracker.cloud.ibm.com",
      "x-ibm-region": "private.eu-gb",
      "description": "The server for IBM Cloud Activity Tracker Service in the eu-gb region."
    },
    {
      "url": "https://eu-es.atracker.cloud.ibm.com",
      "x-ibm-region": "eu-es",
      "description": "The server for IBM Cloud Activity Tracker Service in the eu-es region."
    },
    {
      "url": "https://private.eu-es.atracker.cloud.ibm.com",
      "x-ibm-region": "private.eu-es",
      "description": "The server for IBM Cloud Activity Tracker Service in the eu-es region."
    },
    {
      "url": "https://au-syd.atracker.cloud.ibm.com",
      "x-ibm-region": "au-syd",
      "description": "The server for IBM Cloud Activity Tracker Service in the au-syd region."
    },
    {
      "url": "https://private.au-syd.atracker.cloud.ibm.com",
      "x-ibm-region": "private.au-syd",
      "description": "The server for IBM Cloud Activity Tracker Service in the au-syd region."
    },
    {
      "url": "https://ca-mon.atracker.cloud.ibm.com",
      "x-ibm-region": "ca-mon",
      "description": "The server for IBM Cloud Activity Tracker Service in the ca-mon region."
    },
    {
      "url": "https://private.ca-mon.atracker.cloud.ibm.com",
      "x-ibm-region": "private.ca-mon",
      "description": "The server for IBM Cloud Activity Tracker Service in the ca-mon region."
    },
    {
      "url": "https://ca-tor.atracker.cloud.ibm.com",
      "x-ibm-region": "ca-tor",
      "description": "The server for IBM Cloud Activity Tracker Service in the ca-tor region."
    },
    {
      "url": "https://private.ca-tor.atracker.cloud.ibm.com",
      "x-ibm-region": "private.ca-tor",
      "description": "The server for IBM Cloud Activity Tracker Service in the ca-tor region."
    },
    {
      "url": "https://br-sao.atracker.cloud.ibm.com",
      "x-ibm-region": "br-sao",
      "description": "The server for IBM Cloud Activity Tracker Service in the br-sao region."
    },
    {
      "url": "https://private.br-sao.atracker.cloud.ibm.com",
      "x-ibm-region": "private.br-sao",
      "description": "The server for IBM Cloud Activity Tracker Service in the br-sao region."
    },
    {
      "url": "https://eu-fr2.atracker.cloud.ibm.com",
      "x-ibm-region": "eu-fr2",
      "description": "The server for IBM Cloud Activity Tracker Service in the eu-fr2 region."
    },
    {
      "url": "https://private.eu-fr2.atracker.cloud.ibm.com",
      "x-ibm-region": "private.eu-fr2",
      "description": "The server for IBM Cloud Activity Tracker Service in the eu-fr2 region."
    },
    {
      "url": "https://jp-tok.atracker.cloud.ibm.com",
      "x-ibm-region": "jp-tok",
      "description": "The server for IBM Cloud Activity Tracker Service in the jp-tok region."
    },
    {
      "url": "https://private.jp-tok.atracker.cloud.ibm.com",
      "x-ibm-region": "private.jp-tok",
      "description": "The server for IBM Cloud Activity Tracker Service in the jp-tok region."
    },
    {
      "url": "https://jp-osa.atracker.cloud.ibm.com",
      "x-ibm-region": "jp-osa",
      "description": "The server for IBM Cloud Activity Tracker Service in the jp-osa region."
    },
    {
      "url": "https://private.jp-osa.atracker.cloud.ibm.com",
      "x-ibm-region": "private.jp-osa",
      "description": "The server for IBM Cloud Activity Tracker Service in the jp-osa region."
    },
    {
      "url": "https://in-che.atracker.cloud.ibm.com",
      "x-ibm-region": "in-che",
      "description": "The server for IBM Cloud Activity Tracker Service in the in-che region."
    },
    {
      "url": "https://private.in-che.atracker.cloud.ibm.com",
      "x-ibm-region": "private.in-che",
      "description": "The server for IBM Cloud Activity Tracker Service in the in-che region."
    }
  ],
  "paths": {
    "/api/v2/targets": {
      "post": {
        "summary": "Create a target",
        "tags": [
          "Targets"
        ],
        "description": "Creates a target that includes information about the endpoint and the credentials required to write to that target.\nYou can send your logs from all regions to a single target, different targets or multiple targets. One target per region is not required. You can define up to 16 targets per account.\n\n**Enterprise management**:  Optionally set `managed_by: \"enterprise\"` in the request body to create an enterprise-managed target. the `managed_by` value is immutable after creation and you cannot mingle account-managed and enterprise-managed resources",
        "operationId": "create_target",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TargetPrototype"
              }
            }
          }
        },
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "atracker.target.create"
            },
            {
              "name": "atracker.enterprise-target.create   (used when managed_by=enterprise)"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "atracker.target.create"
            },
            {
              "name": "atracker.enterprise-target.create   (emitted when managed_by=enterprise)"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request for cloud object storage endpoint",
                "example": [
                  {
                    "type": "code",
                    "lang": "curl",
                    "source": [
                      "curl -X POST \\\n  https://private.<region>.atracker.cloud.ibm.com/api/v2/targets \\\n  -H \"Authorization: Bearer <IAM_TOKEN>\" \\\n  -H 'content-type: application/json' \\\n  -d '{\n    \"name\": \"a-name\",\n    \"target_type\": \"cloud_object_storage\",\n    \"cos_endpoint\": {\n      \"endpoint\": \"s3.private.us-east.cloud-object-storage.appdomain.cloud\",\n      \"target_crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::\",\n      \"bucket\": \"my-atracker-bucket\",\n      \"api_key\": \"xxxxxxxxxxxxxxxxxx\",\n      \"service_to_service_enabled\": false\n    }\n  }'"
                    ]
                  }
                ]
              },
              {
                "name": "Example enterprise-managed request for COS endpoint",
                "example": [
                  {
                    "type": "code",
                    "lang": "curl",
                    "source": [
                      "curl -X POST \\\n  https://private.<region>.atracker.cloud.ibm.com/api/v2/targets \\\n  -H \"Authorization: Bearer <IAM_TOKEN>\" \\\n  -H 'content-type: application/json' \\\n  -d '{\n    \"name\": \"enterprise-cos-target\",\n    \"target_type\": \"cloud_object_storage\",\n    \"managed_by\": \"enterprise\",\n    \"cos_endpoint\": {\n      \"endpoint\": \"s3.private.us-east.cloud-object-storage.appdomain.cloud\",\n      \"target_crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::\",\n      \"bucket\": \"my-atracker-bucket\",\n      \"service_to_service_enabled\": true\n    }\n  }'"
                    ]
                  }
                ]
              },
              {
                "name": "Example request for Event Streams endpoint",
                "example": [
                  {
                    "type": "code",
                    "lang": "curl",
                    "source": [
                      "curl -X POST \\\n  https://private.<region>.atracker.cloud.ibm.com/api/v2/targets \\\n  -H \"Authorization: Bearer <IAM_TOKEN>\" \\\n  -H 'content-type: application/json' \\\n  -d '{\n    \"name\": \"a-name\",\n    \"target_type\": \"event_streams\",\n    \"eventstreams_endpoint\": {\n      \"target_crn\": \"crn:v1:staging:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::\",\n      \"brokers\": [\"xxxxx.cloud.ibm.com:9093\",\"yyyyy.cloud.ibm.com:9093\"],\n      \"topic\": \"test-topic\",\n      \"api_key\": \"xxxxxxxxxxxxxxxxxx\",\n      \"service_to_service_enabled\": false\n    }\n  }'"
                    ]
                  }
                ]
              },
              {
                "name": "Example request for IBM Cloud Logs endpoint",
                "example": [
                  {
                    "type": "code",
                    "lang": "curl",
                    "source": [
                      "curl -X POST \\\n  https://private.<region>.atracker.cloud.ibm.com/api/v2/targets \\\n  -H \"Authorization: Bearer <IAM_TOKEN>\" \\\n  -H 'content-type: application/json' \\\n  -d '{\n    \"name\": \"a-name\",\n    \"target_type\": \"cloud_logs\",\n    \"cloudlogs_endpoint\": {\n      \"target_crn\": \"crn:v1:staging:public:logs:eu-es:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::\"\n    }\n  }'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "cosEndpointPrototypeModel := &atrackerv2.CosEndpointPrototype{\n",
                      "  Endpoint:                core.StringPtr(\"s3.private.us-east.cloud-object-storage.appdomain.cloud\"),\n",
                      "  TargetCRN:               core.StringPtr(\"crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::\"),\n",
                      "  Bucket:                  core.StringPtr(\"my-atracker-bucket\"),\n",
                      "  APIKey:                  core.StringPtr(\"xxxxxxxxxxxxxx\"),\n",
                      "  ServiceToServiceEnabled: core.BoolPtr(false),\n",
                      "}\n",
                      "createTargetOptions := atrackerService.NewCreateTargetOptions(\n",
                      "  \"my-cos-target\",\n",
                      "  \"cloud_object_storage\",\n",
                      ")\n",
                      "createTargetOptions.SetCosEndpoint(cosEndpointPrototypeModel)\n",
                      "target, response, err := atrackerService.CreateTarget(createTargetOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(target, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "x-try-it-out-example": [
          {
            "in": "header",
            "name": "Authorization",
            "value": ""
          },
          {
            "in": "body",
            "name": "body",
            "value": [
              "{\n  \"name\": \"a-cos-target-us-south\",\n  \"target_type\": \"cloud_object_storage\",\n  \"cos_endpoint\": {\n    \"endpoint\": \"s3.private.us-east.cloud-object-storage.appdomain.cloud\",\n    \"target_crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::\",\n    \"bucket\": \"my-atracker-bucket\",\n    \"api_key\": \"xxxxxxxxxxxxxxxxxx\",\n    \"service_to_service_enabled\": false\n  }\n}",
              "{\n  \"name\": \"a-cos-target-enterprise\",\n  \"target_type\": \"cloud_object_storage\",\n  \"managed_by\": \"enterprise\",\n  \"cos_endpoint\": {\n    \"endpoint\": \"s3.private.us-east.cloud-object-storage.appdomain.cloud\",\n    \"target_crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::\",\n    \"bucket\": \"my-atracker-bucket\",\n    \"service_to_service_enabled\": true\n  }\n}",
              "{\n  \"name\": \"a-ies-target-us-south\",\n  \"target_type\": \"event_streams\",\n    \"eventstreams_endpoint\": {\n      \"target_crn\": \"crn:v1:staging:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::\",\n      \"brokers\": [\"xxxxx.cloud.ibm.com:9093\",\"yyyyy.cloud.ibm.com:9093\"],\n      \"topic\": \"test-topic\",\n      \"api_key\": \"xxxxxxxxxxxxxxxxxx\",\n      \"service_to_service_enabled\": false\n    }\n}",
              "{\n  \"name\": \"a-icl-target-us-south\",\n  \"target_type\": \"cloud_logs\",\n    \"cloudlogs_endpoint\": {\n      \"target_crn\": \"crn:v1:staging:public:logs:eu-es:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::\"\n    }\n}"
            ]
          }
        ],
        "responses": {
          "201": {
            "description": "The COS target was successfully created for this region.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Target"
                },
                "example": {
                  "id": "c3af557f-fb0e-4476-85c3-0889e7fe7bc4",
                  "crn": "crn:v1:bluemix:public:atracker:us-south:a/6a1d10334a2e4dd197d4e301e8f87df9::target:c3af557f-fb0e-4476-85c3-0889e7fe7bc4",
                  "target_type": "cloud_object_storage",
                  "name": "a-cos-target-us-south",
                  "cos_endpoint": {
                    "endpoint": "s3.private.us-east.cloud-object-storage.appdomain.cloud",
                    "target_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::",
                    "bucket": "my-atracker-bucket",
                    "service_to_service_enabled": false
                  },
                  "created_at": "2022-02-01T19:39:38.174Z",
                  "updated_at": "2022-02-01T19:39:38.174Z",
                  "write_status": {
                    "status": "success"
                  },
                  "api_version": 2
                }
              }
            },
            "links": {
              "TargetId": {
                "$ref": "#/components/links/TargetId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableContent"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "get": {
        "summary": "List targets",
        "tags": [
          "Targets"
        ],
        "description": "List all targets that are defined for your account.\n\n**Enterprise management** - The response will include the `managed_by` field. - The `managed_by` attribute is immutable; it cannot be changed after creation. This endpoint only\n  reads/returns targets and does not modify their state.",
        "operationId": "list_targets",
        "parameters": [
          {
            "name": "region",
            "in": "query",
            "description": "Limit the query to the specified region",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 256,
              "pattern": "^[a-zA-Z0-9 -]"
            }
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "atracker.target.list"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "atracker.target.list"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request all target",
                "example": [
                  {
                    "type": "code",
                    "lang": "curl",
                    "source": [
                      "curl -X GET \\\n  https://private.<region>.atracker.cloud.ibm.com/api/v2/targets \\\n  -H \"Authorization: Bearer <IAM_TOKEN>\" \\"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "listTargetsOptions := atrackerService.NewListTargetsOptions()\n",
                      "\n",
                      "targetList, response, err := atrackerService.ListTargets(listTargetsOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(targetList, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "x-try-it-out-example": [
          {
            "in": "header",
            "name": "Authorization",
            "value": ""
          }
        ],
        "responses": {
          "200": {
            "description": "List all targets defined.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TargetList"
                },
                "example": {
                  "targets": [
                    {
                      "id": "c3af557f-fb0e-4476-85c3-0889e7fe7bc4",
                      "crn": "crn:v1:bluemix:public:atracker:us-south:a/6a1d10334a2e4dd197d4e301e8f87df9::target:c3af557f-fb0e-4476-85c3-0889e7fe7bc4",
                      "target_type": "cloud_object_storage",
                      "name": "a-cos-target-us-south",
                      "cos_endpoint": {
                        "endpoint": "s3.private.us-east.cloud-object-storage.appdomain.cloud",
                        "target_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::",
                        "bucket": "my-atracker-bucket",
                        "service_to_service_enabled": false
                      },
                      "created_at": "2022-02-01T19:39:38.174Z",
                      "updated_at": "2022-02-01T19:39:38.174Z",
                      "write_status": {
                        "status": "success"
                      },
                      "api_version": 2
                    },
                    {
                      "id": "d8f85813-0406-48d5-bf03-bfa054b101e8",
                      "crn": "crn:v1:staging:public:atracker:au-syd:a/9c7ef5cba2c0486981a4ce2f375ba662::target:d8f85813-0406-48d5-bf03-bfa054b101e8",
                      "target_type": "cloud_object_storage",
                      "region": "au-syd",
                      "name": "enterprise-cos-target1",
                      "cos_endpoint": {
                        "endpoint": "s3.us-west.cloud-object-storage.test.appdomain.cloud",
                        "target_crn": "crn:v1:staging:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::",
                        "bucket": "my-cos-bucket",
                        "service_to_service_enabled": true
                      },
                      "write_status": {
                        "status": "success"
                      },
                      "api_version": 2,
                      "managed_by": "enterprise"
                    },
                    {
                      "id": "6162684d-3318-468b-b4a2-db999f92886c",
                      "crn": "crn:v1:staging:public:atracker:us-south:a/627fcf60ca699ba38ccf1d295f1ee179::target:6162684d-3318-468b-b4a2-db999f92886c",
                      "target_type": "event_streams",
                      "name": "eventstreams-target-01",
                      "eventstreams_endpoint": {
                        "target_crn": "crn:v1:staging:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::",
                        "brokers": [
                          "xxxxx.cloud.ibm.com:9093",
                          "yyyyy.cloud.ibm.com:9093"
                        ],
                        "topic": "test-topic",
                        "api_key": "xxxxxxxxxxxxxxxxxx"
                      },
                      "created_at": "2022-02-01T20:43:02.719Z",
                      "updated_at": "2022-02-01T20:43:02.719Z",
                      "write_status": {
                        "status": "success"
                      },
                      "api_version": 2
                    },
                    {
                      "id": "97480465-20c7-4ee4-babe-fe13d0e64445",
                      "crn": "crn:v1:staging:public:atracker:us-south:a/627fcf60ca699ba38ccf1d295f1ee179::target:97480465-20c7-4ee4-babe-fe13d0e64445",
                      "target_type": "cloud_logs",
                      "name": "cloud-logs-target-01",
                      "region": "us-south",
                      "cloudlogs_endpoint": {
                        "target_crn": "crn:v1:staging:public:logs:eu-es:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"
                      },
                      "created_at": "2024-03-29T16:46:06.726Z",
                      "updated_at": "2024-03-29T16:46:06.726Z",
                      "write_status": {
                        "status": "success"
                      },
                      "api_version": 2
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/v2/targets/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/TargetId"
        }
      ],
      "get": {
        "summary": "Get details of a target",
        "tags": [
          "Targets"
        ],
        "description": "Retrieve the configuration details of a target.\n\n**Enterprise management** - The response will include a `managed_by` field indicating if the target is managed by `\"enterprise\"` or `\"account\"`.",
        "operationId": "get_target",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "atracker.target.get"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "atracker.target.get"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "lang": "curl",
                    "source": [
                      "curl -X GET \\\n  https://private.<region>.atracker.cloud.ibm.com/api/v2/targets/<target_ID> \\\n  -H \"Authorization: Bearer <IAM_TOKEN>\" \\\n  -H 'accept: application/json'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "getTargetOptions := atrackerService.NewGetTargetOptions(\n",
                      "  targetIDLink,\n",
                      ")\n",
                      "\n",
                      "target, response, err := atrackerService.GetTarget(getTargetOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(target, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "x-try-it-out-example": [
          {
            "in": "path",
            "name": "id",
            "value": ""
          },
          {
            "in": "header",
            "name": "Authorization",
            "value": ""
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a target.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Target"
                },
                "example": {
                  "id": "c3af557f-fb0e-4476-85c3-0889e7fe7bc4",
                  "crn": "crn:v1:bluemix:public:atracker:us-south:a/6a1d10334a2e4dd197d4e301e8f87df9::target:c3af557f-fb0e-4476-85c3-0889e7fe7bc4",
                  "target_type": "cloud_object_storage",
                  "name": "a-cos-target-us-south",
                  "region": "us-south",
                  "cos_endpoint": {
                    "endpoint": "s3.private.us-east.cloud-object-storage.appdomain.cloud",
                    "target_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::",
                    "bucket": "my-atracker-bucket",
                    "service_to_service_enabled": false
                  },
                  "write_status": {
                    "status": "success"
                  },
                  "created_at": "2022-01-27T19:22:27.293Z",
                  "updated_at": "2022-01-27T19:22:27.293Z",
                  "api_version": 2,
                  "managed_by": "enterprise"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "put": {
        "summary": "Update a target",
        "tags": [
          "Targets"
        ],
        "description": "Update the configuration details of a target.\n\n**Enterprise management** - The `managed_by` attribute is **immutable** and cannot be modified. - Enterprise-managed targets can only be updated by identities authorized for enterprise target actions.",
        "operationId": "replace_target",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTargetPrototype"
              }
            }
          }
        },
        "parameters": [],
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "atracker.target.update"
            },
            {
              "name": "atracker.enterprise-target.update    (used when managed_by=enterprise)"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "atracker.target.update"
            },
            {
              "name": "atracker.enterprise-target.update    (emitted when managed_by=enterprise)"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "lang": "curl",
                    "source": [
                      "curl -X PUT \\\n  https://private.<region>.atracker.cloud.ibm.com/api/v2/targets/<target_ID> \\\n  -H \"Authorization: Bearer <IAM_TOKEN>\" \\\n  -H 'accept: application/json'\n  -d '{\n    \"name\": \"a-new-name\",\n    \"cos_endpoint\": {\n      \"endpoint\": \"s3.private.us-east.cloud-object-storage.appdomain.cloud\",\n      \"target_crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::\",\n      \"bucket\": \"my-atracker-bucket\",\n      \"api_key\": \"xxxxxxxxxxxxxxxxxx\",\n      \"service_to_service_enabled\": false\n    }\n  }'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "replaceTargetOptions := atrackerService.NewReplaceTargetOptions(\n",
                      "  targetIDLink,\n",
                      ")\n",
                      "\n",
                      "target, response, err := atrackerService.ReplaceTarget(replaceTargetOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(target, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "x-try-it-out-example": [
          {
            "in": "path",
            "name": "id",
            "value": ""
          },
          {
            "in": "header",
            "name": "Authorization",
            "value": ""
          }
        ],
        "responses": {
          "200": {
            "description": "The target was successfully updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Target"
                },
                "example": {
                  "id": "c3af557f-fb0e-4476-85c3-0889e7fe7bc4",
                  "crn": "crn:v1:bluemix:public:atracker:us-south:a/6a1d10334a2e4dd197d4e301e8f87df9::target:c3af557f-fb0e-4476-85c3-0889e7fe7bc4",
                  "target_type": "cloud_object_storage",
                  "name": "a-cos-target-us-south",
                  "region": "us-south",
                  "cos_endpoint": {
                    "endpoint": "s3.private.us-east.cloud-object-storage.appdomain.cloud",
                    "target_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::",
                    "bucket": "my-atracker-bucket",
                    "service_to_service_enabled": false
                  },
                  "write_status": {
                    "status": "success"
                  },
                  "created_at": "2022-01-27T19:22:27.293Z",
                  "updated_at": "2022-01-27T19:22:27.293Z",
                  "api_version": 2,
                  "managed_by": "enterprise"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableContent"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "delete": {
        "summary": "Delete a target",
        "tags": [
          "Targets"
        ],
        "description": "Delete a target.",
        "operationId": "delete_target",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "atracker.target.delete"
            },
            {
              "name": "atracker.enterprise-target.delete    (used when managed_by=enterprise)"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "atracker.target.delete"
            },
            {
              "name": "atracker.enterprise-target.delete    (emitted when managed_by=enterprise)"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "lang": "curl",
                    "source": [
                      "curl -X DELETE \\\n  https://private.<region>.atracker.cloud.ibm.com/api/v2/targets/<target_ID> \\\n  -H \"Authorization: Bearer <IAM_TOKEN>\" \\\n  -H 'accept: application/json'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "deleteTargetOptions := atrackerService.NewDeleteTargetOptions(\n",
                      "  targetIDLink,\n",
                      ")\n",
                      "\n",
                      "warningReport, response, err := atrackerService.DeleteTarget(deleteTargetOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(warningReport, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "x-try-it-out-example": [
          {
            "in": "path",
            "name": "id",
            "value": ""
          },
          {
            "in": "header",
            "name": "Authorization",
            "value": ""
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/DeletedResponse"
          },
          "204": {
            "description": "The target is successfully deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The delete request could not be fulfilled because the target is in use.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorReport"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/v2/targets/{id}/validate": {
      "parameters": [
        {
          "$ref": "#/components/parameters/TargetId"
        }
      ],
      "post": {
        "summary": "Validate a target",
        "tags": [
          "Targets"
        ],
        "description": "Validate a target by checking the credentials to write to the target. The result is included as additional data of the target in the section \"write_status\".",
        "operationId": "validate_target",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "atracker.target.update"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "atracker.target.update"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "lang": "curl",
                    "source": [
                      "curl -X POST \\\n  https://private.<region>.atracker.cloud.ibm.com/api/v2/targets/<target_ID>/validate \\\n  -H \"Authorization: Bearer <IAM_TOKEN>\" \\\n  -H 'accept: application/json'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "validateTargetOptions := atrackerService.NewValidateTargetOptions(\n",
                      "  targetIDLink,\n",
                      ")\n",
                      "\n",
                      "target, response, err := atrackerService.ValidateTarget(validateTargetOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(target, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "x-try-it-out-example": [
          {
            "in": "path",
            "name": "id",
            "value": ""
          },
          {
            "in": "header",
            "name": "Authorization",
            "value": ""
          }
        ],
        "responses": {
          "200": {
            "description": "The target is successfully updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Target"
                },
                "example": {
                  "id": "c3af557f-fb0e-4476-85c3-0889e7fe7bc4",
                  "crn": "crn:v1:bluemix:public:atracker:us-south:a/6a1d10334a2e4dd197d4e301e8f87df9::target:c3af557f-fb0e-4476-85c3-0889e7fe7bc4",
                  "target_type": "cloud_object_storage",
                  "name": "a-cos-target-us-south",
                  "cos_endpoint": {
                    "endpoint": "s3.private.us-east.cloud-object-storage.appdomain.cloud",
                    "target_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::",
                    "bucket": "my-atracker-bucket",
                    "service_to_service_enabled": false
                  },
                  "write_status": {
                    "status": "success"
                  },
                  "created_at": "2022-01-27T19:22:27.293Z",
                  "updated_at": "2022-01-27T19:22:27.293Z",
                  "api_version": 2
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/v2/routes": {
      "post": {
        "summary": "Create a route",
        "tags": [
          "Routes"
        ],
        "description": "Create a route to define the rule that specifies how to manage auditing events.\n\n**Enterprise management** The `managed_by` value is immutable and you cannot mingle account-managed and enterprise-managed resources.",
        "operationId": "create_route",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoutePrototype"
              }
            }
          }
        },
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "atracker.route.create"
            },
            {
              "name": "atracker.enterprise-route.create    (used when managed_by=enterprise)"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "atracker.route.create"
            },
            {
              "name": "atracker.enterprise-route.create    (emitted when managed_by=enterprise)"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "lang": "curl",
                    "source": [
                      "curl -X POST \\\n  https://private.<region>.atracker.cloud.ibm.com/api/v2/routes \\\n  -H \"Authorization: Bearer <IAM_TOKEN>\" \\\n  -H 'content-type: application/json' \\\n  -d '{\n    \"name\": \"my-route\",\n    \"rules\": [\n      {\n        \"locations\": [\"us-south\", \"us-east\", \"global\"],\n        \"target_ids\": [\"50375218-7cff-4234-bbb4-171bebab8408\", \"c7519d8a-5f97-498b-a229-8542f60955cd\"]\n      }\n    ]\n  }'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "rulePrototypeModel := &atrackerv2.RulePrototype{\n",
                      "  TargetIds: []string{targetIDLink},\n",
                      "  Locations: []string{\"us-south\"},\n",
                      "}\n",
                      "\n",
                      "createRouteOptions := atrackerService.NewCreateRouteOptions(\n",
                      "  \"my-route\",\n",
                      "  []atrackerv2.RulePrototype{*rulePrototypeModel},\n",
                      ")\n",
                      "\n",
                      "route, response, err := atrackerService.CreateRoute(createRouteOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(route, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "x-try-it-out-example": [
          {
            "in": "header",
            "name": "Authorization",
            "value": ""
          },
          {
            "in": "body",
            "name": "body",
            "value": [
              "{\n  \"name\": \"my-route\",\n  \"rules\": [\n    {\n      \"locations\": [\"us-south\", \"us-east\", \"global\"],\n      \"target_ids\": [\"50375218-7cff-4234-bbb4-171bebab8408\", \"c7519d8a-5f97-498b-a229-8542f60955cd\"]\n    }\n  ]\n}"
            ]
          }
        ],
        "responses": {
          "201": {
            "description": "A route is successfully created for this region.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Route"
                },
                "example": {
                  "id": "ebd9d812-13da-461a-b772-33485e6046fe",
                  "name": "my-route",
                  "crn": "crn:v1:bluemix:public:atracker:global:a/08daa472aa7c4fd087506cca2a3e514e::route:ebd9d812-13da-461a-b772-33485e6046fe",
                  "version": 0,
                  "rules": [
                    {
                      "locations": [
                        "us-south",
                        "us-east",
                        "global"
                      ],
                      "target_ids": [
                        "50375218-7cff-4234-bbb4-171bebab8408",
                        "c7519d8a-5f97-498b-a229-8542f60955cd"
                      ]
                    }
                  ],
                  "created_at": "2022-01-26T16:05:42.728Z",
                  "updated_at": "2022-01-26T16:05:42.728Z",
                  "api_version": 2
                }
              }
            },
            "links": {
              "RouteId": {
                "$ref": "#/components/links/RouteId"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableContent"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "get": {
        "summary": "List routes",
        "tags": [
          "Routes"
        ],
        "description": "List the route that is configured for an account.\n\n**Enterprise management** - The response includes the `managed_by` field. - The `managed_by` value is immutable.",
        "operationId": "list_routes",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "atracker.route.list"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "atracker.route.list"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request for all routes in the account",
                "example": [
                  {
                    "type": "code",
                    "lang": "curl",
                    "source": [
                      "curl -X GET \\\n  https://private.<region>.atracker.cloud.ibm.com/api/v2/routes \\\n  -H \"Authorization: Bearer <IAM_TOKEN>\" \\"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "listRoutesOptions := atrackerService.NewListRoutesOptions()\n",
                      "\n",
                      "routeList, response, err := atrackerService.ListRoutes(listRoutesOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(routeList, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "x-try-it-out-example": [
          {
            "in": "header",
            "name": "Authorization",
            "value": ""
          }
        ],
        "responses": {
          "200": {
            "description": "List routes  defined.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RouteList"
                },
                "example": {
                  "routes": [
                    {
                      "id": "ebd9d812-13da-461a-b772-33485e6046fe",
                      "name": "my-route",
                      "crn": "crn:v1:bluemix:public:atracker:global:a/08daa472aa7c4fd087506cca2a3e514e::route:ebd9d812-13da-461a-b772-33485e6046fe",
                      "version": 0,
                      "rules": [
                        {
                          "locations": [
                            "us-south",
                            "us-east",
                            "global"
                          ],
                          "target_ids": [
                            "50375218-7cff-4234-bbb4-171bebab8408",
                            "c7519d8a-5f97-498b-a229-8542f60955cd"
                          ]
                        }
                      ],
                      "created_at": "2022-01-26T16:05:42.728Z",
                      "updated_at": "2022-01-26T16:05:42.728Z",
                      "api_version": 2,
                      "managed_by": "enterprise"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/v2/routes/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/RouteId"
        }
      ],
      "get": {
        "summary": "Get details of a route",
        "tags": [
          "Routes"
        ],
        "description": "Get the configuration details of a route.\n\n**Enterprise management** - The response includes the `managed_by:` field. - The `managed_by` value is immutable.",
        "operationId": "get_route",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "atracker.route.get"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "atracker.route.get"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "lang": "curl",
                    "source": [
                      "curl -X GET \\\n  https://private.<region>.atracker.cloud.ibm.com/api/v2/routes/<route_ID> \\\n  -H \"Authorization: Bearer <IAM_TOKEN>\" \\\n  -H 'accept: application/json'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "getRouteOptions := atrackerService.NewGetRouteOptions(\n",
                      "  routeIDLink,\n",
                      ")\n",
                      "\n",
                      "route, response, err := atrackerService.GetRoute(getRouteOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(route, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "x-try-it-out-example": [
          {
            "in": "path",
            "name": "id",
            "value": ""
          },
          {
            "in": "header",
            "name": "Authorization",
            "value": ""
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a route.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Route"
                },
                "example": {
                  "id": "ebd9d812-13da-461a-b772-33485e6046fe",
                  "name": "my-route",
                  "crn": "crn:v1:bluemix:public:atracker:global:a/08daa472aa7c4fd087506cca2a3e514e::route:ebd9d812-13da-461a-b772-33485e6046fe",
                  "version": 0,
                  "rules": [
                    {
                      "locations": [
                        "us-south",
                        "us-east",
                        "global"
                      ],
                      "target_ids": [
                        "50375218-7cff-4234-bbb4-171bebab8408",
                        "c7519d8a-5f97-498b-a229-8542f60955cd"
                      ]
                    }
                  ],
                  "created_at": "2022-01-26T16:05:42.728Z",
                  "updated_at": "2022-01-26T16:05:42.728Z",
                  "api_version": 2
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "put": {
        "summary": "Update a route",
        "tags": [
          "Routes"
        ],
        "description": "Update the configuration details of a route.\n\n**Enterprise management** The `managed_by` value is immutable and you cannot mingle account-managed and enterprise-managed resources.",
        "operationId": "replace_route",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoutePrototype"
              }
            }
          }
        },
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "atracker.route.update"
            },
            {
              "name": "atracker.enterprise-route.update    (used when managed_by=enterprise)"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "atracker.route.update"
            },
            {
              "name": "atracker.enterprise-route.update    (emitted when managed_by=enterprise)"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "lang": "curl",
                    "source": [
                      "curl -X PUT \\\n  https://private.<region>.atracker.cloud.ibm.com/api/v2/routes/<route_ID> \\\n  -H \"Authorization: Bearer <IAM_TOKEN>\" \\\n  -H 'accept: application/json'\n  -d '{\n    \"name\": \"a-new-name\",\n    \"rules\": [\n      {\n        \"locations\": [\"us-south\", \"us-east\", \"global\"],\n        \"target_ids\": [\"50375218-7cff-4234-bbb4-171bebab8408\", \"c7519d8a-5f97-498b-a229-8542f60955cd\"]\n      }\n    ]\n  }'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "rulePrototypeModel := &atrackerv2.RulePrototype{\n",
                      "  TargetIds: []string{targetIDLink},\n",
                      "  Locations: []string{\"us-south\"},\n",
                      "}\n",
                      "\n",
                      "replaceRouteOptions := atrackerService.NewReplaceRouteOptions(\n",
                      "  routeIDLink,\n",
                      "  \"my-route\",\n",
                      "  []atrackerv2.RulePrototype{*rulePrototypeModel},\n",
                      ")\n",
                      "\n",
                      "route, response, err := atrackerService.ReplaceRoute(replaceRouteOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(route, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "x-try-it-out-example": [
          {
            "in": "path",
            "name": "id",
            "value": ""
          },
          {
            "in": "header",
            "name": "Authorization",
            "value": ""
          }
        ],
        "responses": {
          "200": {
            "description": "The route was successfully updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Route"
                },
                "example": {
                  "id": "c3af557f-fb0e-4476-85c3-0889e7fe7bc4",
                  "name": "my-route-01",
                  "crn": "crn:v1:bluemix:public:atracker:global:a/6a1d10334a2e4dd197d4e301e8f87df9::route:c3af557f-fb0e-4476-85c3-0889e7fe7bc4",
                  "version": 3,
                  "rules": [
                    {
                      "locations": [
                        "us-south",
                        "us-east",
                        "global"
                      ],
                      "target_ids": [
                        "50375218-7cff-4234-bbb4-171bebab8408",
                        "c7519d8a-5f97-498b-a229-8542f60955cd"
                      ]
                    }
                  ],
                  "created_at": "2022-01-26T17:18:02.487Z",
                  "updated_at": "2022-01-26T17:59:29.763Z",
                  "api_version": 2
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableContent"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "delete": {
        "summary": "Delete a route",
        "tags": [
          "Routes"
        ],
        "description": "Deletes a route.",
        "operationId": "delete_route",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "atracker.route.delete"
            },
            {
              "name": "atracker.enterprise-route.delete    (used when managed_by=enterprise)"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "atracker.route.delete"
            },
            {
              "name": "atracker.enterprise-route.delete    (emitted when managed_by=enterprise)"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "lang": "curl",
                    "source": [
                      "curl -X DELETE \\\n  https://private.<region>.atracker.cloud.ibm.com/api/v2/routes/<route_ID> \\\n  -H \"Authorization: Bearer <IAM_TOKEN>\" \\\n  -H 'accept: application/json'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "deleteRouteOptions := atrackerService.NewDeleteRouteOptions(\n",
                      "  routeIDLink,\n",
                      ")\n",
                      "\n",
                      "response, err := atrackerService.DeleteRoute(deleteRouteOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "if response.StatusCode != 204 {\n",
                      "  fmt.Printf(\"\\nUnexpected response status code received from DeleteRoute(): %d\\n\", response.StatusCode)\n",
                      "}"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "x-try-it-out-example": [
          {
            "in": "path",
            "name": "id",
            "value": ""
          },
          {
            "in": "header",
            "name": "Authorization",
            "value": ""
          }
        ],
        "responses": {
          "204": {
            "description": "The route is successfully deleted."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/v2/settings": {
      "get": {
        "summary": "Get settings",
        "tags": [
          "Settings"
        ],
        "description": "Get information about the current settings including default targets.",
        "operationId": "get_settings",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "atracker.setting.get"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "atracker.setting.get"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "lang": "curl",
                    "source": [
                      "curl -X GET \\\n  https://private.<region>.atracker.cloud.ibm.com/api/v2/settings \\\n  -H \"Authorization: Bearer <IAM_TOKEN>\" \\"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "getSettingsOptions := atrackerService.NewGetSettingsOptions()\n",
                      "\n",
                      "settings, response, err := atrackerService.GetSettings(getSettingsOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(settings, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "x-try-it-out-example": [
          {
            "in": "header",
            "name": "Authorization",
            "value": ""
          }
        ],
        "responses": {
          "200": {
            "description": "Get atracker service settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Settings"
                },
                "example": {
                  "default_targets": [
                    "50375218-7cff-4234-bbb4-171bebab8408",
                    "c7519d8a-5f97-498b-a229-8542f60955cd"
                  ],
                  "permitted_target_regions": [
                    "us-south",
                    "us-east"
                  ],
                  "metadata_region_primary": "us-south",
                  "private_api_endpoint_only": false,
                  "api_version": 2
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "put": {
        "summary": "Modify settings",
        "tags": [
          "Settings"
        ],
        "description": "Modify the current settings such as default targets, permitted target regions, metadata region primary and secondary.\n\n**Enterprise management** - Default targets must be **account-managed**. Enterprise-managed targets (`managed_by: enterprise`) cannot be set as default targets and will be rejected.",
        "operationId": "put_settings",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsPrototype"
              }
            }
          }
        },
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "atracker.setting.set"
            }
          ]
        },
        "x-ibm-events": {
          "events": [
            {
              "name": "atracker.setting.set"
            }
          ]
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "lang": "curl",
                    "source": [
                      "curl -X PUT \\\n  https://private.<region>.atracker.cloud.ibm.com/api/v2/settings \\\n  -H \"Authorization: Bearer <IAM_TOKEN>\" \\\n  -H 'accept: application/json'\n  -d '{\n    \"default_targets\": [\"50375218-7cff-4234-bbb4-171bebab8408\", \"c7519d8a-5f97-498b-a229-8542f60955cd\"],\n    \"permitted_target_regions\": [\"us-south\", \"us-east\"],\n    \"metadata_region_primary\": \"us-south\",\n    \"private_api_endpoint_only\": false\n  }'"
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "putSettingsOptions := atrackerService.NewPutSettingsOptions(\n",
                      "  \"us-south\",\n",
                      "  false,\n",
                      ")\n",
                      "\n",
                      "settings, response, err := atrackerService.PutSettings(putSettingsOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(settings, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ]
          }
        },
        "x-try-it-out-example": [
          {
            "in": "header",
            "name": "Authorization",
            "value": ""
          }
        ],
        "responses": {
          "201": {
            "description": "The settings is successfully modified.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Settings"
                },
                "example": {
                  "default_targets": [
                    "50375218-7cff-4234-bbb4-171bebab8408",
                    "c7519d8a-5f97-498b-a229-8542f60955cd"
                  ],
                  "permitted_target_regions": [
                    "us-south",
                    "us-east"
                  ],
                  "metadata_region_primary": "us-south",
                  "private_api_endpoint_only": false,
                  "api_version": 2
                }
              }
            }
          },
          "400": {
            "description": "The request could not be understood due to malformed syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorReport"
                },
                "examples": {
                  "invalid_managed_by_default_targets": {
                    "summary": "Enterprise-managed target used as a default target",
                    "value": {
                      "errors": [
                        {
                          "code": "invalid_managed_by_default_targets",
                          "message": "Your request has failed. The target ID 01a4c611-e6ea-49c9-9b77-d8c3f4abb2df cannot be used as a default target due to managed_by value.",
                          "status_code": 400
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Your IBM Cloud access token.",
        "bearerFormat": "JWT"
      }
    },
    "links": {
      "TargetId": {
        "description": "Link target ID to subsequent operations",
        "operationId": "get_target",
        "parameters": {
          "id": "$response.body#/id"
        }
      },
      "RouteId": {
        "description": "Link route ID to subsequent operations",
        "operationId": "get_route",
        "parameters": {
          "id": "$response.body#/id"
        }
      }
    },
    "parameters": {
      "TargetId": {
        "name": "id",
        "in": "path",
        "description": "The v4 UUID that uniquely identifies the target.",
        "schema": {
          "type": "string",
          "minLength": 24,
          "maxLength": 1028,
          "pattern": "^[a-zA-Z0-9 -]"
        },
        "required": true,
        "x-linkback": "#/components/links/TargetId"
      },
      "RouteId": {
        "name": "id",
        "in": "path",
        "description": "The v4 UUID that uniquely identifies the route.",
        "schema": {
          "type": "string",
          "minLength": 24,
          "maxLength": 1028,
          "pattern": "^[a-zA-Z0-9 -]"
        },
        "required": true,
        "x-linkback": "#/components/links/RouteId"
      }
    },
    "responses": {
      "BadRequest": {
        "description": "The request could not be understood due to malformed syntax.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorReport"
            }
          }
        }
      },
      "UnprocessableContent": {
        "description": "The request was well-formed but contains semantic errors (e.g., attempted change to immutable `managed_by`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorReport"
            },
            "example": {
              "trace": "3c9abf28-1f65-4f0c-84b1-0e2db1b7a9c2",
              "errors": [
                {
                  "code": "immutable_field",
                  "message": "The `managed_by` value is immutable after creation and cannot be updated."
                }
              ],
              "status_code": 422
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Your access token is invalid or authentication of your token failed.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorReport"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Your access token is valid but does not have the necessary permissions to access this resource.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorReport"
            }
          }
        }
      },
      "NotFound": {
        "description": "The resource could not be found.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorReport"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Too many requests. Please wait a few minutes and try again.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorReport"
            }
          }
        }
      },
      "InternalServerError": {
        "description": "Your request could not be processed. Please try again later. If the problem persists, note the `transaction-id` in the response header and contact [IBM Cloud support](https://watson.service-now.com/wcp).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorReport"
            }
          }
        }
      },
      "DeletedResponse": {
        "description": "The target is deleted.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/WarningReport"
            },
            "example": {
              "trace": "11111111-cccc-dddd-eeee-ffffffffffff",
              "status_code": 200,
              "warnings": [
                {
                  "code": "delete_write_failed",
                  "message": "The Target is deleted but could not write to the target about the deletion."
                }
              ]
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "description": "The error object.",
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "description": "The error code.",
            "type": "string"
          },
          "message": {
            "description": "The error message.",
            "type": "string"
          },
          "more_info": {
            "description": "A location where more detail on this sype of error can be found.",
            "type": "string"
          }
        }
      },
      "ErrorReport": {
        "description": "Description of an error that occurred in a service request.",
        "required": [
          "status_code",
          "trace",
          "errors"
        ],
        "properties": {
          "status_code": {
            "description": "The status code.",
            "type": "integer",
            "minimum": 100,
            "maximum": 599
          },
          "trace": {
            "description": "The transaction-id of the API request.",
            "type": "string"
          },
          "errors": {
            "description": "The error array triggered by the API request.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Warning": {
        "description": "The warning object.",
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "description": "The warning code.",
            "type": "string"
          },
          "message": {
            "description": "The warning message.",
            "type": "string"
          }
        }
      },
      "WarningReport": {
        "description": "Description of a warning that occurred in a service request.",
        "properties": {
          "status_code": {
            "description": "The status code.",
            "type": "integer",
            "minimum": 100,
            "maximum": 599
          },
          "trace": {
            "description": "The transaction-id of the API request.",
            "type": "string"
          },
          "warnings": {
            "description": "The warning array triggered by the API request.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Warning"
            }
          }
        }
      },
      "TargetPrototype": {
        "description": "The request payload to create a target.",
        "type": "object",
        "required": [
          "name",
          "target_type"
        ],
        "properties": {
          "name": {
            "description": "The name of the target. The name must be 1000 characters or less, and cannot include any special characters other than `(space) - . _ :`. Do not include any personal identifying information (PII) in any resource names.",
            "type": "string",
            "example": "my-cos-target",
            "minLength": 1,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:]+$"
          },
          "target_type": {
            "description": "The type of the target. It can be cloud_object_storage, event_streams, or cloud_logs. Based on this type you must include cos_endpoint, eventstreams_endpoint or cloudlogs_endpoint.",
            "type": "string",
            "x-terraform-force-new": true,
            "enum": [
              "cloud_object_storage",
              "event_streams",
              "cloud_logs"
            ],
            "example": "cloud_object_storage"
          },
          "cos_endpoint": {
            "$ref": "#/components/schemas/CosEndpointPrototype"
          },
          "eventstreams_endpoint": {
            "$ref": "#/components/schemas/EventstreamsEndpointPrototype"
          },
          "cloudlogs_endpoint": {
            "$ref": "#/components/schemas/CloudLogsEndpointPrototype"
          },
          "region": {
            "description": "Include this optional field if you want to create a target in a different region other than the one you are connected.",
            "type": "string",
            "example": "us-south",
            "minLength": 3,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:]+$"
          },
          "managed_by": {
            "description": "Identifies who manages this target. Optional at create time. If set to `enterprise`, the target becomes enterprise-managed and can only be modified by identities authorized for the enterprise actions. If omitted or set to `account`, the target is managed by the child account. This value is immutable after creation.\n",
            "type": "string",
            "example": "enterprise",
            "enum": [
              "enterprise",
              "account"
            ]
          }
        }
      },
      "UpdateTargetPrototype": {
        "description": "The request payload to update a target.",
        "type": "object",
        "properties": {
          "name": {
            "description": "The name of the target. The name must be 1000 characters or less, and cannot include any special characters other than `(space) - . _ :`. Do not include any personal identifying information (PII) in any resource names.",
            "type": "string",
            "example": "my-cos-target",
            "minLength": 1,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:]+$"
          },
          "cos_endpoint": {
            "$ref": "#/components/schemas/CosEndpointPrototype"
          },
          "eventstreams_endpoint": {
            "$ref": "#/components/schemas/EventstreamsEndpointPrototype"
          },
          "cloudlogs_endpoint": {
            "$ref": "#/components/schemas/CloudLogsEndpointPrototype"
          }
        }
      },
      "CosEndpointPrototype": {
        "description": "Property values for a Cloud Object Storage Endpoint in requests.",
        "type": "object",
        "required": [
          "endpoint",
          "target_crn",
          "bucket"
        ],
        "properties": {
          "endpoint": {
            "description": "The host name of the Cloud Object Storage endpoint.",
            "type": "string",
            "minLength": 3,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:]+$",
            "example": "s3.private.us-east.cloud-object-storage.appdomain.cloud"
          },
          "target_crn": {
            "description": "The CRN of the Cloud Object Storage instance.",
            "type": "string",
            "minLength": 3,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:/]+$",
            "example": "crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"
          },
          "bucket": {
            "description": "The bucket name under the Cloud Object Storage instance.",
            "type": "string",
            "minLength": 3,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:/]+$",
            "example": "my-atracker-bucket"
          },
          "api_key": {
            "description": "The IAM API key that has writer access to the Cloud Object Storage instance. This credential is masked in the response. This is required if service_to_service is not enabled.",
            "type": "string",
            "minLength": 3,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:]+$",
            "example": "xxxxxxxxxxxxxx",
            "x-terraform-sensitive": true
          },
          "service_to_service_enabled": {
            "description": "Determines if IBM Cloud Activity Tracker Event Routing has service to service authentication enabled. Set this flag to true if service to service is enabled and do not supply an apikey.",
            "type": "boolean",
            "example": true
          }
        }
      },
      "CosEndpoint": {
        "description": "Property values for a Cloud Object Storage Endpoint in responses.",
        "type": "object",
        "required": [
          "endpoint",
          "target_crn",
          "bucket",
          "service_to_service_enabled"
        ],
        "properties": {
          "endpoint": {
            "description": "The host name of the Cloud Object Storage endpoint.",
            "type": "string",
            "minLength": 3,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:]+$",
            "example": "s3.private.us-east.cloud-object-storage.appdomain.cloud"
          },
          "target_crn": {
            "description": "The CRN of the Cloud Object Storage instance.",
            "type": "string",
            "minLength": 3,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:/]+$",
            "example": "crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"
          },
          "bucket": {
            "description": "The bucket name under the Cloud Object Storage instance.",
            "type": "string",
            "minLength": 3,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:/]+$",
            "example": "my-atracker-bucket"
          },
          "service_to_service_enabled": {
            "description": "Determines if IBM Cloud Activity Tracker Event Routing has service to service authentication enabled. Set this flag to true if service to service is enabled and do not supply an apikey.",
            "type": "boolean",
            "example": true
          }
        }
      },
      "EventstreamsEndpointPrototype": {
        "description": "Property values for an Event Streams Endpoint in requests.",
        "type": "object",
        "required": [
          "target_crn",
          "brokers",
          "topic"
        ],
        "properties": {
          "target_crn": {
            "description": "The CRN of the Event Streams instance.",
            "type": "string",
            "minLength": 3,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:/]+$",
            "example": "crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"
          },
          "brokers": {
            "description": "List of broker endpoints.",
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9 -._:]+$",
              "minLength": 1,
              "maxLength": 1000,
              "example": "kafka-x:9094"
            }
          },
          "topic": {
            "description": "The messsage hub topic defined in the Event Streams instance.",
            "type": "string",
            "minLength": 3,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:/]+$",
            "example": "my-topic"
          },
          "api_key": {
            "description": "The user password (api key) for the message hub topic in the Event Streams instance. This is required if service_to_service is not enabled.",
            "type": "string",
            "minLength": 3,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:/]+$",
            "example": "xxxxxxxxxxxxxx"
          },
          "service_to_service_enabled": {
            "description": "Determines if IBM Cloud Activity Tracker Event Routing has service to service authentication enabled. Set this flag to true if service to service is enabled and do not supply an apikey.",
            "type": "boolean",
            "example": false
          }
        }
      },
      "EventstreamsEndpoint": {
        "description": "Property values for the Event Streams Endpoint in responses.",
        "type": "object",
        "required": [
          "target_crn",
          "brokers",
          "topic"
        ],
        "properties": {
          "target_crn": {
            "description": "The CRN of the Event Streams instance.",
            "type": "string",
            "minLength": 3,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:/]+$",
            "example": "crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"
          },
          "brokers": {
            "description": "List of broker endpoints.",
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9 -._:]+$",
              "minLength": 1,
              "maxLength": 1000,
              "example": "kafka-x:9094"
            }
          },
          "topic": {
            "description": "The messsage hub topic defined in the Event Streams instance.",
            "type": "string",
            "minLength": 3,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:/]+$",
            "example": "my-topic"
          },
          "api_key": {
            "description": "The user password (api key) for the message hub topic in the Event Streams instance.",
            "type": "string",
            "minLength": 3,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:/]+$",
            "example": "xxxxxxxxxxxxxx"
          },
          "service_to_service_enabled": {
            "description": "Determines if IBM Cloud Activity Tracker Event Routing has service to service authentication enabled. Set this flag to true if service to service is enabled and do not supply an apikey.",
            "type": "boolean",
            "example": false
          }
        }
      },
      "CloudLogsEndpointPrototype": {
        "description": "Property values for an IBM Cloud Logs endpoint in requests.",
        "type": "object",
        "required": [
          "target_crn"
        ],
        "properties": {
          "target_crn": {
            "description": "The CRN of the IBM Cloud Logs instance.",
            "type": "string",
            "minLength": 3,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:/]+$",
            "example": "crn:v1:bluemix:public:logs:eu-es:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"
          }
        }
      },
      "CloudLogsEndpoint": {
        "description": "Property values for the IBM Cloud Logs endpoint in responses.",
        "type": "object",
        "required": [
          "target_crn"
        ],
        "properties": {
          "target_crn": {
            "description": "The CRN of the IBM Cloud Logs instance.",
            "type": "string",
            "minLength": 3,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:/]+$",
            "example": "crn:v1:bluemix:public:eu-es:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"
          }
        }
      },
      "WriteStatus": {
        "description": "The status of the write attempt to the target with the provided endpoint parameters.",
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "description": "The status such as failed or success.",
            "type": "string",
            "example": "success"
          },
          "last_failure": {
            "description": "The timestamp of the failure.",
            "type": "string",
            "format": "date-time",
            "example": "2021-05-18T20:15:12.353Z"
          },
          "reason_for_last_failure": {
            "description": "Detailed description of the cause of the failure.",
            "type": "string",
            "example": "Provided API key could not be found"
          }
        }
      },
      "Target": {
        "description": "Property values for a target in responses.",
        "type": "object",
        "required": [
          "id",
          "name",
          "crn",
          "target_type",
          "write_status",
          "created_at",
          "updated_at",
          "api_version",
          "managed_by"
        ],
        "x-terraform-resource-name": "atracker_target",
        "x-terraform-resource-operations": {
          "create": "create_target",
          "read": "get_target",
          "update": "replace_target",
          "delete": "delete_target"
        },
        "properties": {
          "id": {
            "description": "The uuid of the target resource.",
            "type": "string",
            "example": "f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6"
          },
          "name": {
            "description": "The name of the target resource.",
            "type": "string",
            "example": "a-cos-target-us-south"
          },
          "crn": {
            "description": "The crn of the target resource.",
            "type": "string",
            "example": "crn:v1:bluemix:public:atracker:us-south:a/11111111111111111111111111111111:b6eec08b-5201-08ca-451b-cd71523e3626:target:f7dcfae6-e7c5-08ca-451b-fdfa696c9bb6"
          },
          "target_type": {
            "description": "The type of the target.",
            "type": "string",
            "enum": [
              "cloud_object_storage",
              "event_streams",
              "cloud_logs"
            ],
            "example": "cloud_object_storage"
          },
          "region": {
            "description": "Included this optional field if you used it to create a target in a different region other than the one you are connected.",
            "type": "string",
            "example": "us-south"
          },
          "cos_endpoint": {
            "$ref": "#/components/schemas/CosEndpoint"
          },
          "eventstreams_endpoint": {
            "$ref": "#/components/schemas/EventstreamsEndpoint"
          },
          "cloudlogs_endpoint": {
            "$ref": "#/components/schemas/CloudLogsEndpoint"
          },
          "write_status": {
            "$ref": "#/components/schemas/WriteStatus"
          },
          "created_at": {
            "description": "The timestamp of the target creation time.",
            "type": "string",
            "format": "date-time",
            "example": "2021-05-18T20:15:12.353Z"
          },
          "updated_at": {
            "description": "The timestamp of the target last updated time.",
            "type": "string",
            "format": "date-time",
            "example": "2021-05-18T20:15:12.353Z"
          },
          "message": {
            "description": "An optional message containing information about the target.",
            "type": "string",
            "example": "This is a valid target. However, there is another target already defined with the same target endpoint."
          },
          "api_version": {
            "description": "The API version of the target.",
            "type": "integer",
            "example": 2,
            "minimum": 2,
            "maximum": 2
          },
          "managed_by": {
            "description": "Identifies who manages the target.\n",
            "type": "string",
            "enum": [
              "enterprise",
              "account"
            ],
            "example": "enterprise"
          }
        }
      },
      "TargetList": {
        "description": "A list of target resources.",
        "type": "object",
        "x-terraform-datasource-name": "atracker_targets",
        "x-terraform-datasource-filter": "name",
        "required": [
          "targets"
        ],
        "properties": {
          "targets": {
            "description": "A list of target resources.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Target"
            }
          }
        }
      },
      "RulePrototype": {
        "description": "A configuration to route events to pre-defined target.",
        "type": "object",
        "required": [
          "target_ids"
        ],
        "properties": {
          "target_ids": {
            "description": "The target ID List. All the events will be send to all targets listed in the rule. You can include targets from other regions.",
            "type": "array",
            "items": {
              "type": "string",
              "example": "c3af557f-fb0e-4476-85c3-0889e7fe7bc4",
              "pattern": "^[a-zA-Z0-9 -._:]+$",
              "minLength": 3,
              "maxLength": 1000,
              "x-linkback": "#/components/links/TargetId"
            }
          },
          "locations": {
            "description": "Logs from these locations will be sent to the targets specified. Locations is a superset of regions including global and *.",
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9 -._:]+$",
              "minLength": 1,
              "maxLength": 1000,
              "example": "us-south"
            }
          }
        }
      },
      "Rule": {
        "description": "A configuration to route events to pre-defined target.",
        "type": "object",
        "required": [
          "target_ids",
          "locations"
        ],
        "properties": {
          "target_ids": {
            "description": "The target ID List. All the events will be send to all targets listed in the rule. You can include targets from other regions.",
            "type": "array",
            "items": {
              "type": "string",
              "example": "c3af557f-fb0e-4476-85c3-0889e7fe7bc4",
              "pattern": "^[a-zA-Z0-9 -._:]+$",
              "minLength": 3,
              "maxLength": 1000,
              "x-linkback": "#/components/links/TargetId"
            }
          },
          "locations": {
            "description": "Logs from these locations will be sent to the targets specified. Locations is a superset of regions including global and *.",
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9 -._:]+$",
              "minLength": 3,
              "maxLength": 1000,
              "example": "us-south"
            }
          }
        }
      },
      "RoutePrototype": {
        "description": "The request payload to create a route.",
        "type": "object",
        "required": [
          "name",
          "rules"
        ],
        "properties": {
          "name": {
            "description": "The name of the route. The name must be 1000 characters or less and cannot include any special characters other than `(space) - . _ :`. Do not include any personal identifying information (PII) in any resource names.",
            "type": "string",
            "example": "my-route",
            "minLength": 1,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 -._:]+$"
          },
          "rules": {
            "description": "Routing rules that will be evaluated in their order of the array.",
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/RulePrototype"
            }
          },
          "managed_by": {
            "description": "Identifies who manages this route. Optional at create time.\nThe managed_by value is immutable and you cannot mingle account-managed and enterprise-managed resources.\n",
            "type": "string",
            "enum": [
              "enterprise",
              "account"
            ],
            "example": "enterprise"
          }
        }
      },
      "Route": {
        "description": "The route resource. The scope of the route is account wide. That means all the routes are evaluated in all regions, except the ones limited by region.",
        "type": "object",
        "required": [
          "id",
          "name",
          "crn",
          "rules",
          "created_at",
          "updated_at",
          "api_version"
        ],
        "x-terraform-resource-name": "atracker_route",
        "properties": {
          "id": {
            "description": "The uuid of the route resource.",
            "type": "string",
            "example": "c3af557f-fb0e-4476-85c3-0889e7fe7bc4"
          },
          "name": {
            "description": "The name of the route.",
            "type": "string",
            "example": "my-route"
          },
          "crn": {
            "description": "The crn of the route resource.",
            "type": "string",
            "example": "crn:v1:bluemix:public:atracker:global:a/11111111111111111111111111111111:b6eec08b-5201-08ca-451b-cd71523e3626:route:c3af557f-fb0e-4476-85c3-0889e7fe7bc4"
          },
          "version": {
            "description": "The version of the route.",
            "type": "integer",
            "maximum": 99999,
            "minimum": 0,
            "example": 0
          },
          "rules": {
            "description": "The routing rules that will be evaluated in their order of the array. Once a rule is matched, the remaining rules in the route definition will be skipped.",
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/Rule"
            }
          },
          "created_at": {
            "description": "The timestamp of the route creation time.",
            "type": "string",
            "format": "date-time",
            "example": "2021-05-18T20:15:12.353Z"
          },
          "updated_at": {
            "description": "The timestamp of the route last updated time.",
            "type": "string",
            "format": "date-time",
            "example": "2021-05-18T20:15:12.353Z"
          },
          "api_version": {
            "description": "The API version of the route.",
            "type": "integer",
            "example": 2,
            "minimum": 2,
            "maximum": 2
          },
          "message": {
            "description": "An optional message containing information about the route.",
            "type": "string",
            "example": "Route was created successfully."
          },
          "managed_by": {
            "description": "Present when the route is enterprise-managed (`managed_by: enterprise`).\n",
            "type": "string",
            "enum": [
              "enterprise",
              "account"
            ],
            "example": "enterprise"
          }
        }
      },
      "RouteList": {
        "description": "A list of route resources.",
        "type": "object",
        "x-terraform-datasource-name": "atracker_routes",
        "x-terraform-datasource-filter": "name",
        "required": [
          "routes"
        ],
        "properties": {
          "routes": {
            "description": "A list of route resources.",
            "type": "array",
            "minItems": 0,
            "maxItems": 30,
            "items": {
              "$ref": "#/components/schemas/Route"
            }
          }
        }
      },
      "SettingsPrototype": {
        "description": "Activity Tracker Event Routing settings request",
        "type": "object",
        "required": [
          "metadata_region_primary",
          "private_api_endpoint_only"
        ],
        "properties": {
          "default_targets": {
            "description": "The target ID List. In the event that no routing rule causes the event to be sent to a target, these targets will receive the event. Enterprise-managed targets are not supported.",
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 1028,
              "pattern": "^[a-zA-Z0-9 -]",
              "example": "c3af557f-fb0e-4476-85c3-0889e7fe7bc4",
              "x-linkback": "#/components/links/TargetId"
            }
          },
          "permitted_target_regions": {
            "description": "If present then only these regions may be used to define a target.",
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 1028,
              "pattern": "^[a-zA-Z0-9 -_]",
              "example": "us-south"
            }
          },
          "metadata_region_primary": {
            "description": "To store all your meta data in a single region.",
            "type": "string",
            "minLength": 3,
            "maxLength": 256,
            "pattern": "^[a-zA-Z0-9 -_]",
            "example": "us-south"
          },
          "metadata_region_backup": {
            "description": "To store all your meta data in a backup region.",
            "type": "string",
            "minLength": 3,
            "maxLength": 256,
            "pattern": "^[a-zA-Z0-9 -_]",
            "example": "eu-de"
          },
          "private_api_endpoint_only": {
            "description": "If you set this true then you cannot access api through public network.",
            "type": "boolean",
            "example": false
          }
        }
      },
      "Settings": {
        "description": "Activity Tracker Event Routing settings response",
        "type": "object",
        "x-terraform-resource-id": "metadata_region_primary",
        "x-terraform-resource-name": "atracker_settings",
        "x-terraform-resource-operations": {
          "create": "put_settings",
          "read": "get_settings",
          "update": "put_settings",
          "delete": "put_settings"
        },
        "required": [
          "metadata_region_primary",
          "default_targets",
          "permitted_target_regions",
          "private_api_endpoint_only",
          "api_version"
        ],
        "properties": {
          "default_targets": {
            "description": "The target ID List. In the event that no routing rule causes the event to be sent to a target, these targets will receive the event. Enterprise-managed targets are not supported.",
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 1028,
              "pattern": "^[a-zA-Z0-9 -]",
              "example": "c3af557f-fb0e-4476-85c3-0889e7fe7bc4",
              "x-linkback": "#/components/links/TargetId"
            }
          },
          "permitted_target_regions": {
            "description": "If present then only these regions may be used to define a target.",
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 1028,
              "pattern": "^[a-zA-Z0-9 -_]",
              "example": "us-south"
            }
          },
          "metadata_region_primary": {
            "description": "To store all your meta data in a single region.",
            "type": "string",
            "minLength": 3,
            "maxLength": 256,
            "pattern": "^[a-zA-Z0-9 -_]",
            "example": "us-south"
          },
          "metadata_region_backup": {
            "description": "To store all your meta data in a backup region.",
            "type": "string",
            "minLength": 3,
            "maxLength": 256,
            "pattern": "^[a-zA-Z0-9 -_]",
            "example": "eu-de"
          },
          "private_api_endpoint_only": {
            "description": "If you set this true then you cannot access api through public network.",
            "type": "boolean",
            "example": false
          },
          "api_version": {
            "description": "API version used for configuring IBM Cloud Activity Tracker Event Routing resources in the account.",
            "type": "integer",
            "example": 2,
            "minimum": 2,
            "maximum": 2
          },
          "message": {
            "description": "An optional message containing information about the audit log locations.",
            "type": "string",
            "example": "The route and target audit logs can be found in the metadata primary region and everything else can be found in the region it is being called from."
          }
        }
      }
    }
  }
}