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
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 ezero_apimatic_sdk-0.0.1.tar.gz.
File metadata
- Download URL: ezero_apimatic_sdk-0.0.1.tar.gz
- Upload date:
- Size: 230.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ffe79db3c929154989cb0def00cebc78374a0ee8de941f151560114836c977a
|
|
| MD5 |
7bea0fb3e2c0fe2d207f529e1bef02f5
|
|
| BLAKE2b-256 |
1f412d4889a5b9f96ac55cde831f49cc59a1271db41fd0e52aaa91b05105b2aa
|
File details
Details for the file ezero_apimatic_sdk-0.0.1-py3-none-any.whl.
File metadata
- Download URL: ezero_apimatic_sdk-0.0.1-py3-none-any.whl
- Upload date:
- Size: 506.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
697baa5d87da84b76da06cc4d5b2cf98c65b3a4b6e21c4e5e9f06ae00c62f0d5
|
|
| MD5 |
ec21031472433a22f45636a66aecde24
|
|
| BLAKE2b-256 |
a016cd91a9635d28a67aadbbc5fa9448cad30fc4e06654a42e34d07f56a5e71e
|