This repo contains the python language bindings for the REST APIs exposed by AMD Pensando Policy and Services Manager (PSM). Client bindings differ and thus reflect the functions in various PSM distributions:
- Requirements
Python >= 3.6
- Use pip to install the desired distribution
pip install pensando-cloud
- import the cloud APIs and start fetching the objects
import os
from pensando_dss.psm.apis import ClusterV1Api
from pensando_dss.psm import configuration, api_client
from pprint import pprint
import warnings
warnings.simplefilter("ignore")
configuration = configuration.Configuration(
psm_config_path = os.environ['HOME'] + "/.psm/config.json",
interactive_mode = True
)
configuration.verify_ssl = False
client = api_client.ApiClient(configuration)
api_instance = ClusterV1Api(client)
response = api_instance.get_cluster()
pprint (response)
[...]
More apps here using python apis.
- Concepts: API structure or in PSM installation at
https://<PSM IP Address>/docs
- PSM API specification: Swagger schema at
https://<PSM IP Address>/generated/swaggeruri.html
- PSM GUI
Admin
menu, allowsEnable Live Capture
to see the the APIs used when an operation is performed in PSM GUI
The AMD Pensando Python SDK is auto generated from the PSM swagger spec. Please do not fork/modify any code in this repository, instead head over to https://github.com/pensando/psm-tools to generate the appropriate code.
Please submit an issue at https://github.com/pensando/psm-tools/issues if you find a bug or want to request an enhancement.