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.5.tar.gz (3.1 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.5-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kps_api-1.3.5.tar.gz
  • Upload date:
  • Size: 3.1 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.5.tar.gz
Algorithm Hash digest
SHA256 7b719daf7a468edf0bb9e4509ec9705f8ab42fc0206df8472a3812530cd7c8ea
MD5 b473f792a1df4edbf1fb0e5e97c8d95c
BLAKE2b-256 288f24089b03077616325d3e0819d72035705d2d9c6b20c436988b82a60390fb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kps_api-1.3.5-py3-none-any.whl
  • Upload date:
  • Size: 2.5 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b6b390198c68d2886de89ee4aef1da2a762948b43462d1f1f1a5f71f65f760ef
MD5 750ec8e04d318c4f596c3fd84fa896b1
BLAKE2b-256 036b28af2c9bce9643a3641f552874c6d24ba71e8ba9779b3646e668157729f1

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