Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting Started with Verizon

Introduction

"The Connection Planner is a service that provides devices windows to connect to their backend APIs. The service validates device access permissions and processes valid devices asynchronously. For each batch, it retrieves device connectivity windows from the RAN KPI Data Application, and sends callbacks back to customers via UWS-Callback for both successful and failed device requests."

Best Practices for Callbacks: https://thingspace.verizon.com/documentation/apis/connectivity-management/working-with-verizon/about-callback-services/best-practices.html

Install the Package

The package is compatible with Python versions 3.7+. Install the package from PyPi using the following pip command:

pip install sdksio-verizon-apis-sdk==2.0.0

You can also view the package at: https://pypi.python.org/pypi/sdksio-verizon-apis-sdk/2.0.0

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
environment Environment The API environment.
Default: Environment.PRODUCTION
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: 60
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.
thingspace_oauth_credentials ThingspaceOauthCredentials The credential object for OAuth 2 Client Credentials Grant
vz_m2m_token_credentials VZM2mTokenCredentials The credential object for Custom Header Signature
session_token_credentials SessionTokenCredentials The credential object for Custom Header Signature
thingspace_oauth_1_credentials ThingspaceOauth1Credentials The credential object for OAuth 2 Client Credentials Grant

The API client can be initialized as follows:

Code-Based Client Initialization

from verizon.configuration import Environment
from verizon.http.auth.session_token import SessionTokenCredentials
from verizon.http.auth.thingspace_oauth import ThingspaceOauthCredentials
from verizon.http.auth.thingspace_oauth_1 import ThingspaceOauth1Credentials
from verizon.http.auth.vz_m2m_token import VZM2mTokenCredentials
from verizon.verizon_client import VerizonClient

client = VerizonClient(
    thingspace_oauth_credentials=ThingspaceOauthCredentials(
        oauth_client_id='OAuthClientId',
        oauth_client_secret='OAuthClientSecret'
    ),
    vz_m2m_token_credentials=VZM2mTokenCredentials(
        vz_m2m_token='VZ-M2M-Token'
    ),
    session_token_credentials=SessionTokenCredentials(
        session_token='SessionToken'
    ),
    thingspace_oauth_1_credentials=ThingspaceOauth1Credentials(
        oauth_client_id='OAuthClientId',
        oauth_client_secret='OAuthClientSecret'
    ),
    environment=Environment.PRODUCTION
)

Environment-Based Client Initialization

from verizon.verizon_client import VerizonClient

# Specify the path to your .env file if it’s located outside the project’s root directory.
client = VerizonClient.from_environment(dotenv_path='/path/to/.env')

See the Environment-Based Client Initialization section for details.

Environments

The SDK can be configured to use a different environment for making API calls. Available environments are:

Fields

Name Description
PRODUCTION Default
STAGING -
DEV -
QA -
MOCK_SERVER_FOR_LIMITED_AVAILABILITY_SEE_QUICK_START -

Authorization

This API uses the following authentication schemes.

List of APIs

SDK Infrastructure

Configuration

HTTP

Utilities

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages