Skip to main content

opsduty-client

<openapi_python_client.schema.untrusted_string.UntrustedString object at 0x107fc2660>

Usage

First, create a client:

from opsduty_client import Client

client = Client(base_url="https://opsduty.io")

If the endpoints you're going to hit require authentication, use AuthenticatedClient instead:

from opsduty_client import AuthenticatedClient

client = AuthenticatedClient(base_url="https://opsduty.io", token="oAuth2 access token")

Now call your endpoint and use your models:

from opsduty_client.models import MyDataModel
from opsduty_client.api.my_tag import get_my_data_model
from opsduty_client.types import Response

with client as client:
    my_data: MyDataModel = get_my_data_model.sync(client=client)
    # or if you need more info (e.g. status_code)
    response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client)

Or do the same thing with an async version:

from opsduty_client.models import MyDataModel
from opsduty_client.api.my_tag import get_my_data_model
from opsduty_client.types import Response

async with client as client:
    my_data: MyDataModel = await get_my_data_model.asyncio(client=client)
    response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client)

Advanced customizations

There are more settings on the generated Client class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying httpx.Client or httpx.AsyncClient (depending on your use-case):

from opsduty_client import Client

def log_request(request):
    print(f"Request event hook: {request.method} {request.url} - Waiting for response")

def log_response(response):
    request = response.request
    print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}")

client = Client(
    base_url="https://opsduty.io",
    httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}},
)

# Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client()

You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url):

import httpx
from opsduty_client import Client

client = Client(
    base_url="https://opsduty.io",
)
# Note that base_url needs to be re-set, as would any shared cookies, headers, etc.
client.set_httpx_client(httpx.Client(base_url="https://opsduty.io", proxies="http://localhost:8030"))

Metadata

Release files for opsduty-client 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opsduty-client 0.1.0
File Size Uploaded Provenance Actions
opsduty_client-0.1.0.tar.gz 58.9 kB Without provenance Details for opsduty_client-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for opsduty-client 0.1.0
File Interpreter ABI Platform Actions
opsduty_client-0.1.0-py3-none-any.whl Python 3 none any Details for opsduty_client-0.1.0-py3-none-any.whl

Total release size: 320.4 kB

Release files / opsduty_client-0.1.0.tar.gz

Download URL opsduty_client-0.1.0.tar.gz
Size 58.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b3a60bf87d8d2f939e262f569d9417366cdf18205da92707de26358a1a2c4318
BLAKE2b-256 checksum
How to use checksums
f37ae3b6c82fcae11b8e6ab1b122905ab0c537da41fe11bd63cd7f454165f99d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.12.3 Linux/6.17.0-1022-azure

Release files / opsduty_client-0.1.0-py3-none-any.whl

Download URL opsduty_client-0.1.0-py3-none-any.whl
Size 261.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98c64ed5fec187f1c7c5803b35a63680a2e6932af858674d3182b70c1c35bdd5
BLAKE2b-256 checksum
How to use checksums
e6fee35e84711a4b7d7b9b2f5a263bdfbf904c2a3f9990ac765ddd3ff3b2086a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.12.3 Linux/6.17.0-1022-azure

Security for opsduty-client 0.1.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page