This API manages CDN distributions.
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 1.2.0
- Package version: 1.0.0-beta.2
- Generator version: 7.13.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Python 3.9+
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/ionos-cloud/sdk-python.git(you may need to run pip with root permission: sudo pip install git+https://github.com/ionos-cloud/sdk-python.git)
Then import the package:
import ionoscloud_cdnInstall via Setuptools.
python setup.py install --user(or sudo python setup.py install to install the package for all users)
Then import the package:
import ionoscloud_cdnExecute pytest to run the tests.
Please follow the installation procedure and then run the following:
import ionoscloud_cdn
from ionoscloud_cdn.rest import ApiException
from pprint import pprint
import os
# Defining the host is optional and defaults to https://cdn.de-fra.ionos.com
# See configuration.py for a list of all supported configuration parameters.
configuration = ionoscloud_cdn.Configuration(
host = "https://cdn.de-fra.ionos.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization (JWT): tokenAuth
configuration = ionoscloud_cdn.Configuration(
token = os.environ["IONOS_TOKEN"]
)
# Enter a context with an instance of the API client
with ionoscloud_cdn.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = ionoscloud_cdn.DistributionsApi(api_client)
distribution_id = '9ba15778-16c4-543c-8775-e52acf4853f5' # str | The ID (UUID) of the Distribution.
try:
# Delete Distribution
api_instance.distributions_delete(distribution_id)
except ApiException as e:
print("Exception when calling DistributionsApi->distributions_delete: %s\n" % e)All URIs are relative to https://cdn.de-fra.ionos.com
| Class | Method | HTTP request | Description |
|---|---|---|---|
| DistributionsApi | distributions_delete | DELETE /distributions/{distributionId} | Delete Distribution |
| DistributionsApi | distributions_find_by_id | GET /distributions/{distributionId} | Retrieve Distribution |
| DistributionsApi | distributions_get | GET /distributions | Retrieve all Distributions |
| DistributionsApi | distributions_post | POST /distributions | Create Distribution |
| DistributionsApi | distributions_put | PUT /distributions/{distributionId} | Ensure Distribution |
- Distribution
- DistributionCreate
- DistributionMetadata
- DistributionProperties
- DistributionUpdate
- Distributions
- Error
- ErrorMessagesInner
- IpAddresses
- Links
- Metadata
- Pagination
- ResourceState
- RoutingRule
- Upstream
- UpstreamGeoRestrictions
Authentication schemes defined for the API:
- Type: Bearer authentication (JWT)