POLICY API REST API SERVICE API

TENANT API

This page describes the K2HR3 TENANT API. The purpose of the TENANT API is to create and update and get and delete a Local Tenant of K2HR3 Cluster. See the Feature about the TENANT.

Note

The TENANT API is an API to operate K2HR3 cluster Local Tenant.
The TENANT of the K2HR3 system uses tenants cooperated with IaaS (OpenStack tenant/project, Kubernetes namespace).
If the K2HR3 cluster Local Tenant function is enabled in the K2HR3 REST API configuration(localtenants value is true), you can create/edit/delete your own TENANT.

POST (Create)

Specify Unscoped User Token or Scoped User Token and create a new K2HR3 cluster Local Tenant(TENANT).

Note

All TENANT APIs require an Unscoped User Token or a Scoped User Token.
If a Scoped User Token is specified, the tenant indicated by that token will be ignored and only the USER information will be used as with the Unscoped User Token.

Endpoint(URL)

http(s)://API SERVER:PORT/v1/tenant

Content-Type: application/json
x-auth-token: U=<Unscoped User Token> or <Scoped User Token>

Request Body

{
    tenant:    {
        name:     <tenant name>
        desc:     <description for tenant>
        display:  <display name for tenant>
        users:    [<user name>, ...]
    }
}

Response status

201, 40x

Response Body(JSON)

{
    result:     <true/false>
    message:    <null or error message string>
}

PUT (Create)

Specify Unscoped User Token or Scoped User Token and create a new K2HR3 cluster Local Tenant(TENANT).

Note

All TENANT APIs require an Unscoped User Token or a Scoped User Token.
If a Scoped User Token is specified, the tenant indicated by that token will be ignored and only the USER information will be used as with the Unscoped User Token.

Endpoint(URL)

http(s)://API SERVER:PORT/v1/tenant?name=tenant name&…

Header

Content-Type: application/json
x-auth-token: U=<Unscoped User Token> or <Scoped User Token>

URL Arguments

Response status

201, 40x

Response Body(JSON)

{
    result:     <true/false>
    message:    <null or error message string>
}

POST (Update)

Specify Unscoped User Token or Scoped User Token and update the K2HR3 cluster Local Tenant(TENANT).

Note

All TENANT APIs require an Unscoped User Token or a Scoped User Token.
If a Scoped User Token is specified, the tenant indicated by that token will be ignored and only the USER information will be used as with the Unscoped User Token.

Endpoint(URL)

http(s)://API SERVER:PORT/v1/tenant/tenant name

Header

Content-Type: application/json
x-auth-token: U=<Unscoped User Token> or <Scoped User Token>

Request Body

{
    tenant:    {
        id:       <tenant id>
        desc:     <description for tenant>
        display:  <display name for tenant>
        users:    [<user name>, ...]
    }
}

Response status

201, 40x

Response Body(JSON)

{
    result:     <true/false>
    message:    <null or error message string>
}

PUT (Update)

Specify Unscoped User Token or Scoped User Token and update the K2HR3 cluster Local Tenant(TENANT).

Note

All TENANT APIs require an Unscoped User Token or a Scoped User Token.
If a Scoped User Token is specified, the tenant indicated by that token will be ignored and only the USER information will be used as with the Unscoped User Token.

Endpoint(URL)

http(s)://API SERVER:PORT/v1/tenant/tenant name?id=tenant id

Header

Content-Type: application/json
x-auth-token: U=<Unscoped User Token> or <Scoped User Token>

URL Arguments

Response status

201, 40x

Response Body(JSON)

{
    result:     <true/false>
    message:    <null or error message string>
}

GET (List)

Specify Unscoped User Token or Scoped User Token and list the K2HR3 cluster Local Tenant(TENANT).
The list of TENANTs that can be obtained is limited to the TENANT that the USER is permitted to use.

Note

All TENANT APIs require an Unscoped User Token or a Scoped User Token.
If a Scoped User Token is specified, the tenant indicated by that token will be ignored and only the USER information will be used as with the Unscoped User Token.

Endpoint(URL)

http(s)://API SERVER:PORT/v1/tenant?expand=true or false

Header

Content-Type: application/json
x-auth-token: U=<Scoped User Token>

URL argument

Response status

200, 40x

Response Body(JSON)

GET (Tenant)

Specify Unscoped User Token or Scoped User Token and get the K2HR3 cluster Local Tenant(TENANT) information.
The list of TENANTs that can be obtained is limited to the TENANT that the USER is permitted to use.

Note

All TENANT APIs require an Unscoped User Token or a Scoped User Token.
If a Scoped User Token is specified, the tenant indicated by that token will be ignored and only the USER information will be used as with the Unscoped User Token.

Endpoint(URL)

http(s)://API SERVER:PORT/v1/tenant/tenant name

Header

Content-Type: application/json
x-auth-token: U=<Scoped User Token>

Response status

200, 40x

Response Body(JSON)

{
    result:        <true/false>
    message:       <null or error message string>
    tenant: {
        name:      <tenant name>,
        id:        <tenant id>,
        desc:      <description for tenant>,
        display:   <display name for tenant>,
        users:      [user, ...]
    }
}

Specify Unscoped User Token or Scoped User Token and check the existence of the K2HR3 cluster Local Tenant(TENANT).
The list of TENANTs that can be obtained is limited to the TENANT that the USER is permitted to use.

Note

All TENANT APIs require an Unscoped User Token or a Scoped User Token.
If a Scoped User Token is specified, the tenant indicated by that token will be ignored and only the USER information will be used as with the Unscoped User Token.

Endpoint(URL)

http(s)://API SERVER:PORT/v1/tenant/tenant name

Header

Content-Type: application/json
x-auth-token: U=<Scoped User Token>

Response status

204, 40x

Response Body(JSON)

Empty

DELETE (Tenant)

Specify Unscoped User Token or Scoped User Token and completely delete the Local Tenant(TENANT).
If the User(USER) specifies a Local Tenant(TENANT) that is not permitted to use, it will fail.

Note

All TENANT APIs require an Unscoped User Token or a Scoped User Token.
If a Scoped User Token is specified, the tenant indicated by that token will be ignored and only the USER information will be used as with the Unscoped User Token.

Endpoint(URL)

http(s)://API SERVER:PORT/v1/tenant?tenant=tenant name?id=tenant id

Header

Content-Type: application/json
x-auth-token: U=<Scoped User Token>

URL argument

Response status

204, 40x

Response Body(JSON)

Empty

DELETE (User)

Specify Unscoped User Token or Scoped User Token and make the USER unavailable to the K2HR3 cluster Local Tenant(TENANT).
As a result of this process, if there are no more USER that can use the K2HR3 cluster Local Tenant(TENANT), the TENANT will be deleted.
If the User(USER) specifies a Local Tenant(TENANT) that is not permitted to use, it will fail.

Note

All TENANT APIs require an Unscoped User Token or a Scoped User Token.
If a Scoped User Token is specified, the tenant indicated by that token will be ignored and only the USER information will be used as with the Unscoped User Token.

Endpoint(URL)

http(s)://API SERVER:PORT/v1/tenant/tenant name?id=tenant id

Header

Content-Type: application/json
x-auth-token: U=<Scoped User Token>

URL argument

Response status

204, 40x

Response Body(JSON)

Empty

POLICY API REST API SERVICE API