Skip to main content

Nutanix Karbon Platform Services

Project description

KPS API

Documentation for Nutanix Karbon Platform Services python sdk.

Requirements.

Python 3.4+

Installation & Usage

The python package is hosted on PyPi

pip install kps-api

(you may need to run pip with root permission: sudo pip install kps-api)

Then import the package:

import kps_api 

Getting Started

from __future__ import print_function
import time
import kps_api
from kps_api.rest import ApiException
from pprint import pprint

# Configure API key authorization: BearerToken
configuration = kps_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = kps_api.ApplicationApi(kps_api.ApiClient(configuration))
body = kps_api.ApplicationV2() # ApplicationV2 | Describes the application creation request.
authorization = 'authorization_example' # str | Format: Bearer <token>, with <token> from login API response.

try:
    # Create an application.
    api_response = api_instance.application_create_v2(body, authorization)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ApplicationApi->application_create_v2: %s\n" % e)

# Configure API key authorization: BearerToken
configuration = kps_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = kps_api.ApplicationApi(kps_api.ApiClient(configuration))
authorization = 'authorization_example' # str | Format: Bearer <token>, with <token> from login API response.
id = 'id_example' # str | ID of the entity

try:
    # Delete application specified by the application ID.
    api_response = api_instance.application_delete_v2(authorization, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ApplicationApi->application_delete_v2: %s\n" % e)

# Configure API key authorization: BearerToken
configuration = kps_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = kps_api.ApplicationApi(kps_api.ApiClient(configuration))
authorization = 'authorization_example' # str | Format: Bearer <token>, with <token> from login API response.
id = 'id_example' # str | ID of the entity

try:
    # Get application by application ID.
    api_response = api_instance.application_get_v2(authorization, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ApplicationApi->application_get_v2: %s\n" % e)

# Configure API key authorization: BearerToken
configuration = kps_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = kps_api.ApplicationApi(kps_api.ApiClient(configuration))
authorization = 'authorization_example' # str | Format: Bearer <token>, with <token> from login API response.
page_index = 789 # int | 0-based index of the page to fetch results. (optional)
page_size = 789 # int | Item count of each page. (optional)
order_by = ['order_by_example'] # list[str] | Specify result order. Zero or more entries with format: &ltkey> [desc] where orderByKeys lists allowed keys in each response. (optional)
filter = 'filter_example' # str | Specify result filter. Format is similar to a SQL WHERE clause. For example, to filter object by name with prefix foo, use: name LIKE 'foo%'. Supported filter keys are the same as order by keys. (optional)

try:
    # Get all applications.
    api_response = api_instance.application_list_v2(authorization, page_index=page_index, page_size=page_size, order_by=order_by, filter=filter)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ApplicationApi->application_list_v2: %s\n" % e)

# Configure API key authorization: BearerToken
configuration = kps_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = kps_api.ApplicationApi(kps_api.ApiClient(configuration))
body = kps_api.ApplicationV2() # ApplicationV2 | 
authorization = 'authorization_example' # str | Format: Bearer <token>, with <token> from login API response.
id = 'id_example' # str | ID of the entity

try:
    # Update a specific application with ID {id}.
    api_response = api_instance.application_update_v3(body, authorization, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ApplicationApi->application_update_v3: %s\n" % e)

# Configure API key authorization: BearerToken
configuration = kps_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = kps_api.ApplicationApi(kps_api.ApiClient(configuration))
authorization = 'authorization_example' # str | Format: Bearer <token>, with <token> from login API response.
id = 'id_example' # str | ID of the entity
edge_id = 'edge_id_example' # str | ID for the edge

try:
    # Get containers of an application specified by Application ID running on a specific edge.
    api_response = api_instance.get_application_containers(authorization, id, edge_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ApplicationApi->get_application_containers: %s\n" % e)

# Configure API key authorization: BearerToken
configuration = kps_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = kps_api.ApplicationApi(kps_api.ApiClient(configuration))
authorization = 'authorization_example' # str | Format: Bearer <token>, with <token> from login API response.
project_id = 'project_id_example' # str | ID for the project
page_index = 789 # int | 0-based index of the page to fetch results. (optional)
page_size = 789 # int | Item count of each page. (optional)
order_by = ['order_by_example'] # list[str] | Specify result order. Zero or more entries with format: &ltkey> [desc] where orderByKeys lists allowed keys in each response. (optional)
filter = 'filter_example' # str | Specify result filter. Format is similar to a SQL WHERE clause. For example, to filter object by name with prefix foo, use: name LIKE 'foo%'. Supported filter keys are the same as order by keys. (optional)

try:
    # Get all applications in a project according to project ID.
    api_response = api_instance.project_get_applications_v2(authorization, project_id, page_index=page_index, page_size=page_size, order_by=order_by, filter=filter)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ApplicationApi->project_get_applications_v2: %s\n" % e)

Documentation for API Endpoints

The documentation for the Nutanix Karbon Platform Services API endpoints can be found on Nutanix.dev

BearerToken

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Author

karbon-platform-services-api@nutanix.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kps_api-1.3.7.tar.gz (309.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kps_api-1.3.7-py3-none-any.whl (865.0 kB view details)

Uploaded Python 3

File details

Details for the file kps_api-1.3.7.tar.gz.

File metadata

  • Download URL: kps_api-1.3.7.tar.gz
  • Upload date:
  • Size: 309.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for kps_api-1.3.7.tar.gz
Algorithm Hash digest
SHA256 ca4358f9c6a571d52f4b0de7bcc711861c7cbdfba3715ae4718abcbe9715e8db
MD5 89ba03dce68b15816bc480e1f09ff894
BLAKE2b-256 e235eb1ecbc0daa50a1d0c4c7061383c9d57751f369c2ee9b798c2b6fd76741c

See more details on using hashes here.

File details

Details for the file kps_api-1.3.7-py3-none-any.whl.

File metadata

  • Download URL: kps_api-1.3.7-py3-none-any.whl
  • Upload date:
  • Size: 865.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for kps_api-1.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 64f8f911611f4c0fc4c11cbfca66ca6b8cac026e79baedbc277fe480a18b9a9d
MD5 d7de123e735bddb588ee850902858496
BLAKE2b-256 95226d61dbba95991ed52e29235823774f6b9522037b065d6317ce96b3123e2a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page