List tenants
GET /tenants
List tenants
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following action.
logs-router.tenant.read
Auditing
Calling this method generates the following auditing event.
logs-router.tenant.read
Request
Path Parameters
Query Parameters
name
Optional: The name of a tenant
Response
200 - Successful operation
tenants
array
List of tenants in the account
401 - Unauthorized
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
403 - Forbidden
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
404 - Not found
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
415 - Wrong Content-Type
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
500 - Internal server error
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
Create (onboard) a tenant
POST /tenants
Create (onboard) a tenant
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following action.
logs-router.tenant.create
Auditing
Calling this method generates the following auditing event.
logs-router.tenant.create
Request
Request Body
TenantPrototype
Target type, log-sink endpoint and authentication
name
Required *
string
The name for this tenant. The name is regionally unique across all tenants in the account.
targets
Required *
array
List of targets.<br>Two targets must not be of the same type. The supported target type is <b>logs</b> (IBM Cloud Logs).
Path Parameters
Query Parameters
Response
201 - Successfully created
id
string
Unique ID of the tenant
created_at
string
Timestamp the tenant was originally created
updated_at
string
Timestamp the tenant was last updated
crn
string
Cloud resource name of the tenant. Must be a valid CRN
name
string
The name for this tenant. The name is regionally unique across all tenants in the account.
etag
string
Resource version identifier
targets
array
List of targets
write_status
WriteStatus
The status of the write attempt to the target with the provided endpoint parameters.
400 - Bad Request - invalid body
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
401 - Unauthorized
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
403 - Forbidden
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
415 - Wrong Content-Type
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
500 - Internal server error
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
Retrieve a tenant
GET /tenants/{tenant_id}
Retrieve a tenant
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following action.
logs-router.tenant.read
Auditing
Calling this method generates the following auditing event.
logs-router.tenant.read
Request
Response
200 - Successful operation
id
string
Unique ID of the tenant
created_at
string
Timestamp the tenant was originally created
updated_at
string
Timestamp the tenant was last updated
crn
string
Cloud resource name of the tenant. Must be a valid CRN
name
string
The name for this tenant. The name is regionally unique across all tenants in the account.
etag
string
Resource version identifier
targets
array
List of targets
write_status
WriteStatus
The status of the write attempt to the target with the provided endpoint parameters.
401 - Unauthorized
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
403 - Forbidden
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
404 - Not found
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
415 - Wrong Content-Type
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
500 - Internal server error
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
Delete (offboard) a tenant
DELETE /tenants/{tenant_id}
Delete (offboard) a tenant
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following action.
logs-router.tenant.delete
Auditing
Calling this method generates the following auditing event.
logs-router.tenant.delete
Request
Response
204 - Successfully deleted
400 - Invalid tenant ID
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
401 - Unauthorized
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
403 - Forbidden
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
404 - Not found
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
500 - Internal server error
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
Update a tenant
PATCH /tenants/{tenant_id}
Update a tenant. To update a target please refer to the <b>targets</b> section.
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following action.
logs-router.tenant.update
Auditing
Calling this method generates the following auditing event.
logs-router.tenant.update
Request
Request Body
Update of a tenant.
Path Parameters
Query Parameters
Response
200 - Successful operation
id
string
Unique ID of the tenant
created_at
string
Timestamp the tenant was originally created
updated_at
string
Timestamp the tenant was last updated
crn
string
Cloud resource name of the tenant. Must be a valid CRN
name
string
The name for this tenant. The name is regionally unique across all tenants in the account.
etag
string
Resource version identifier
targets
array
List of targets
write_status
WriteStatus
The status of the write attempt to the target with the provided endpoint parameters.
401 - Unauthorized
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
403 - Forbidden
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
404 - Not found
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
412 - Precondition failed
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
415 - Wrong Content-Type
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
500 - Internal server error
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
List targets for a tenant
GET /tenants/{tenant_id}/targets
List targets for a tenant
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following action.
logs-router.tenant.read
Auditing
Calling this method generates the following auditing event.
logs-router.tenant.read
Request
Path Parameters
Query Parameters
name
Optional: Name of the tenant target
Response
200 - Successful operation
targets
array
List of targets of a tenant
401 - Unauthorized
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
403 - Forbidden
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
404 - Not found
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
415 - Wrong Content-Type
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
500 - Internal server error
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
Create a target
POST /tenants/{tenant_id}/targets
Create a new target for a tenant.<br><b>Note:</b> The tenant must not already have a target of the specified type. The supported target type is <b>logs</b> (IBM Cloud Logs).
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following action.
logs-router.tenant.update
Auditing
Calling this method generates the following auditing event.
logs-router.tenant.update
Request
Request Body
TargetPrototype
log-sink endpoint and authentication
name
Required *
string
The name for this tenant target. The name must be unique across all targets for this tenant.
Path Parameters
Query Parameters
Response
201 - Successfully created
id
string
Unique ID of the target
name
string
The name for this tenant target. The name must be unique across all targets for this tenant.
etag
string
Resource version identifier
type
string
Type of log-sink. Identical to the <code>service-name</code> segment of <code>log_sink_crn</code>.
created_at
string
Timestamp the target was originally created
updated_at
string
Timestamp the target was last updated
400 - Bad Request - invalid body
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
401 - Unauthorized
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
403 - Forbidden
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
415 - Wrong Content-Type
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
500 - Internal server error
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
Retrieve a target
GET /tenants/{tenant_id}/targets/{target_id}
Retrieve a target
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following action.
logs-router.tenant.read
Auditing
Calling this method generates the following auditing event.
logs-router.tenant.read
Request
Response
200 - Successful operation
id
string
Unique ID of the target
name
string
The name for this tenant target. The name must be unique across all targets for this tenant.
etag
string
Resource version identifier
type
string
Type of log-sink. Identical to the <code>service-name</code> segment of <code>log_sink_crn</code>.
created_at
string
Timestamp the target was originally created
updated_at
string
Timestamp the target was last updated
401 - Unauthorized
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
403 - Forbidden
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
404 - Not found
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
415 - Wrong Content-Type
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
500 - Internal server error
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
Update a target
PATCH /tenants/{tenant_id}/targets/{target_id}
Update a target.<br><b>Note:</b>A change of the target type is only supported for tenants with a single target.
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following action.
logs-router.tenant.update
Auditing
Calling this method generates the following auditing event.
logs-router.tenant.update
Request
Request Body
Updates a target of a tenant.
Path Parameters
Query Parameters
Response
200 - Successful operation
id
string
Unique ID of the target
name
string
The name for this tenant target. The name must be unique across all targets for this tenant.
etag
string
Resource version identifier
type
string
Type of log-sink. Identical to the <code>service-name</code> segment of <code>log_sink_crn</code>.
created_at
string
Timestamp the target was originally created
updated_at
string
Timestamp the target was last updated
400 - Bad Request
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
401 - Unauthorized
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
403 - Forbidden
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
404 - Not found
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
412 - Precondition failed
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
415 - Wrong Content-Type
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
500 - Internal server error
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
Delete a target
DELETE /tenants/{tenant_id}/targets/{target_id}
Delete a target.<br><b>Note:</b> The last target is not allowed to be deleted.
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following action.
logs-router.tenant.update
Auditing
Calling this method generates the following auditing event.
logs-router.tenant.update
Request
Response
204 - Successfully deleted
400 - Invalid tenant ID
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
401 - Unauthorized
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
403 - Forbidden
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
404 - Not found
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info
500 - Internal server error
errors
array
Array of errors
status_code
integer
HTTP status code
trace
string
Error trace info