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: <key> [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: <key> [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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kps_api-1.3.6.tar.gz.
File metadata
- Download URL: kps_api-1.3.6.tar.gz
- Upload date:
- Size: 274.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ea486a2c3d11425b136911cbbf3680c39370683037ad87caf079377ea7a70dc
|
|
| MD5 |
e9dc7a6407177fe5408e1a43d928469e
|
|
| BLAKE2b-256 |
46bfebc5d4375588e9e35924a5811c26fedb4c252efcfd0a9dce6890db0c72ab
|
File details
Details for the file kps_api-1.3.6-py3-none-any.whl.
File metadata
- Download URL: kps_api-1.3.6-py3-none-any.whl
- Upload date:
- Size: 897.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5c9c9c1a0f64690443401aa26e512b3a607788a22444a67ac4c352c80591d8a
|
|
| MD5 |
3a43f724118f8916c7d05ae83b3e33cf
|
|
| BLAKE2b-256 |
ffb5ec5574aa328e89928ad0640657fa4b561ed78388a292b0bc8229bb104e96
|