Getting Started with env zero API
Introduction
This document describes the resources that make up the official env zero REST API.
Base URL
https://api.env0.com
Content types
All requests should be in JSON format and include the accept: application/json header.
Authentication
HTTP Basic authentication. Send the API Key ID as the username and the API Key Secret as the password. Keys are created under Organization Settings -> API Keys (Admin or User scope) or Personal Settings -> API Keys (Personal scope).
Scope of this document
This specification covers the environment drift-governance surface of the env zero API and the environment, deployment, template, configuration and project endpoints that support it. It was reconstructed from the OpenAPI fragments published on https://docs.envzero.com and is a subset of the full API.
Error responses
401 and 403 responses return { "message": string } and are documented on every operation. The upstream documentation does not define response bodies for other non-2xx status codes, so none are asserted here.
Install the Package
The package is compatible with Python versions 3.7+.
Install the package from PyPi using the following pip command:
pip install ezero-apimatic-sdk==0.0.1
You can also view the package at: https://pypi.python.org/pypi/ezero-apimatic-sdk/0.0.1
Initialize the API Client
Note: Documentation for the client can be found here.
The following parameters are configurable for the API Client:
| Parameter | Type | Description |
|---|---|---|
| http_client_instance | Union[Session, HttpClientProvider] |
The Http Client passed from the sdk user for making requests |
| override_http_client_configuration | bool |
The value which determines to override properties of the passed Http Client from the sdk user |
| http_call_back | HttpCallBack |
The callback value that is invoked before and after an HTTP call is made to an endpoint |
| timeout | float |
The value to use for connection timeout. Default: 30 |
| max_retries | int |
The number of times to retry an endpoint call if it fails. Default: 0 |
| backoff_factor | float |
A backoff factor to apply between attempts after the second try. Default: 2 |
| retry_statuses | Array of int |
The http statuses on which retry is to be done. Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524] |
| retry_methods | Array of string |
The http methods on which retry is to be done. Default: ["GET", "PUT"] |
| proxy_settings | ProxySettings |
Optional proxy configuration to route HTTP requests through a proxy server. |
| logging_configuration | LoggingConfiguration |
The SDK logging configuration for API calls |
| basic_auth_credentials | BasicAuthCredentials |
The credential object for Basic Authentication |
The API client can be initialized as follows:
Code-Based Client Initialization
import logging
from envzeroapi.configuration import Environment
from envzeroapi.envzeroapi_client import EnvzeroapiClient
from envzeroapi.http.auth.basic_auth import BasicAuthCredentials
from envzeroapi.logging.configuration.api_logging_configuration import LoggingConfiguration
from envzeroapi.logging.configuration.api_logging_configuration import RequestLoggingConfiguration
from envzeroapi.logging.configuration.api_logging_configuration import ResponseLoggingConfiguration
client = EnvzeroapiClient(
basic_auth_credentials=BasicAuthCredentials(
username='BasicAuthUserName',
password='BasicAuthPassword'
),
environment=Environment.PRODUCTION,
logging_configuration=LoggingConfiguration(
log_level=logging.INFO,
request_logging_config=RequestLoggingConfiguration(
log_body=True
),
response_logging_config=ResponseLoggingConfiguration(
log_headers=True
)
)
)
Environment-Based Client Initialization
from envzeroapi.envzeroapi_client import EnvzeroapiClient
# Specify the path to your .env file if it’s located outside the project’s root directory.
client = EnvzeroapiClient.from_environment(dotenv_path='/path/to/.env')
See the Environment-Based Client Initialization section for details.
Authorization
This API uses the following authentication schemes.
List of APIs
- Bulk Operations
- Deployment Logs
- Approval Policy
- Environment Outputs
- Environments
- Drift
- Scheduling
- Templates
- Configuration
- Projects
- Organization
- Notifications
- Credentials
SDK Infrastructure
Configuration
- ProxySettings
- Environment-Based Client Initialization
- AbstractLogger
- LoggingConfiguration
- RequestLoggingConfiguration
- ResponseLoggingConfiguration
HTTP
Utilities
Metadata
Release files for ezero-apimatic-sdk 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ezero_apimatic_sdk-0.0.1.tar.gz | 230.6 kB | Without provenance | Details for ezero_apimatic_sdk-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ezero_apimatic_sdk-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for ezero_apimatic_sdk-0.0.1-py3-none-any.whl |
Total release size: 736.7 kB
Release files / ezero_apimatic_sdk-0.0.1.tar.gz
| Download URL | ezero_apimatic_sdk-0.0.1.tar.gz |
|---|---|
| Size | 230.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2ffe79db3c929154989cb0def00cebc78374a0ee8de941f151560114836c977a
|
|
BLAKE2b-256 checksum How to use checksums |
1f412d4889a5b9f96ac55cde831f49cc59a1271db41fd0e52aaa91b05105b2aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.13
|
Release files / ezero_apimatic_sdk-0.0.1-py3-none-any.whl
| Download URL | ezero_apimatic_sdk-0.0.1-py3-none-any.whl |
|---|---|
| Size | 506.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
697baa5d87da84b76da06cc4d5b2cf98c65b3a4b6e21c4e5e9f06ae00c62f0d5
|
|
BLAKE2b-256 checksum How to use checksums |
a016cd91a9635d28a67aadbbc5fa9448cad30fc4e06654a42e34d07f56a5e71e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.13
|
Security for ezero-apimatic-sdk 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.