API Client

API Client represents a low level interface for Endpoint API. All API operation be can performed using this.

class abeja.endpoints.APIClient(credential: typing.Union[dict, NoneType] = None, timeout: typing.Union[int, NoneType] = None, max_retry_count: typing.Union[int, NoneType] = None)

A low-level client for Endpoint API

from abeja.endpoints import APIClient

api_client = APIClient()
create_endpoint(organization_id: str, deployment_id: str, service_id: str, custom_alias: str = 'default') → dict

create a endpoint

API reference: POST /organizations/{organization_id}/deployments/{deployment_id}/endpoints

Request Syntax:
organization_id = "1111111111111"
deployment_id = "2222222222222"
service_id = "ser-abc3333333333333"
custom_alias = "default"

response = api_client.create_endpoint(organization_id, deployment_id, service_id, custom_alias)
Params:
  • organization_id (str): organization identifier
  • deployment_id (str): deployment identifier
  • service_id (str): service identifier for alias
  • custom_alias (str): custom alias name
Return type:
dict
Returns:
Response Syntax:
{
    "endpoint_id": "pnt-abc1111111111111",
    "custom_alias": "default",
    "service_id": "ser-abc2222222222222"
}
Raises:
  • BadRequest: the resource already exists or parameters is insufficient or invalid.
  • Unauthorized: Authentication failed
  • InternalServerError
delete_endpoint(organization_id: str, deployment_id: str, endpoint: str) → dict

delete a endpoint

API reference: DELETE /organizations/<organization_id>/deployments/<deployment_id>/endpoints/<endpoint>

Request syntax:
response = api_client.delete_endpoint(organization_id='1111111111111',
                                      deployment_id='1111111111111', endpoint='pnt-abc1111111111111')
Params:
  • organization_id (str): organization_id
  • deployment_id (str): deployment identifier
  • endpoint (str): endpoint identifier or custom alias
Return type:
dict
Responses:
Response syntax:
{
    "message": "pnt-abc1111111111111 deleted"
}
Raises:
  • NotFound: endpoint not found
  • Unauthorized: Authentication failed
  • InternalServerError
get_endpoint(organization_id: str, deployment_id: str, endpoint: str) → dict

get a endpoint

API reference: GET /organizations/<organization_id>/deployments/<deployment_id>/endpoints/<endpoint>

Request Syntax:
response = api_client.get_endpoint(organization_id='1111111111111', deployment_id='1111111111111',
                                   endpoint='pnt-abc1111111111111')
Params:
  • organization_id (str): organization_id
  • deployment_id (str): deployment identifier
  • endpoint (str): endpoint identifier or custom alias
Return type:
dict
Returns:
Response Syntax:
{
    "endpoint_id": "pnt-d28322af41a14e16",
    "custom_alias": "default",
     "service_id": "ser-57e40a4c681a4a09"
}
Raises:
  • NotFound: endpoint not found
  • Unauthorized: Authentication failed
  • InternalServerError
get_endpoints(organization_id: str, deployment_id: str) → dict

Get endpoints entries

API reference: GET /organizations/<organization_id>/deployments/<deployment_id>/endpoints

Request syntax:
response = api_client.get_endpoints(organization_id='1111111111111', deployment_id='1111111111111')
Params:
  • organization_id (str): organization_id
  • deployment_id (str): deployment identifier
Return type:
dict
Returns:
Return syntax:
{
    "entries": [
        {
            "endpoint_id": "pnt-abc1111111111111",
            "custom_alias": "default",
            "service_id": "ser-abc1111111111111"
        }
    ]
}
Raises:
  • Unauthorized: Authentication failed
  • InternalServerError
update_endpoint(organization_id: str, deployment_id: str, endpoint: str, service_id: str) → dict

update a endpoint

API reference: PATCH /organizations/<organization_id>/deployments/<deployment_id>/endpoints/<endpoint>

Request syntax:
response = api_client.update_endpoint(organization_id='1111111111111',
                                      deployment_id='1111111111111',
                                      endpoint='pnt-abc1111111111111',
                                      service_id='ser-abc1111111111111')
Params:
  • organization_id (str): organization_id
  • deployment_id (str): deployment identifier
  • endpoint (str): endpoint identifier or custom alias
  • service_id (str): service identifier
Return type:
dict
Responses:
Response syntax:
{
    "message": "pnt-1111111111111111 updated"
}
Raises:
  • NotFound: endpoint not found
  • Unauthorized: Authentication failed
  • InternalServerError