API Client represents a low level interface for Endpoint API. All API operation be can performed using this.
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
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)
{
"endpoint_id": "pnt-abc1111111111111",
"custom_alias": "default",
"service_id": "ser-abc2222222222222"
}
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>
response = api_client.delete_endpoint(organization_id='1111111111111',
deployment_id='1111111111111', endpoint='pnt-abc1111111111111')
{
"message": "pnt-abc1111111111111 deleted"
}
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>
response = api_client.get_endpoint(organization_id='1111111111111', deployment_id='1111111111111',
endpoint='pnt-abc1111111111111')
{
"endpoint_id": "pnt-d28322af41a14e16",
"custom_alias": "default",
"service_id": "ser-57e40a4c681a4a09"
}
get_endpoints
(organization_id: str, deployment_id: str) → dict¶Get endpoints entries
API reference: GET /organizations/<organization_id>/deployments/<deployment_id>/endpoints
response = api_client.get_endpoints(organization_id='1111111111111', deployment_id='1111111111111')
{
"entries": [
{
"endpoint_id": "pnt-abc1111111111111",
"custom_alias": "default",
"service_id": "ser-abc1111111111111"
}
]
}
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>
response = api_client.update_endpoint(organization_id='1111111111111',
deployment_id='1111111111111',
endpoint='pnt-abc1111111111111',
service_id='ser-abc1111111111111')
{
"message": "pnt-1111111111111111 updated"
}