wxc_sdk.telephony.jobs package
Jobs API
- class wxc_sdk.telephony.jobs.StepExecutionStatus(*, id: str, startTime: datetime, endTime: datetime | None = None, lastUpdated: datetime, statusMessage: str, exitCode: str, name: str, timeElapsed: str)[source]
Bases:
ApiModelCreate a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- id: str
Unique identifier that identifies each step in a job.
- start_time: datetime
Step execution start time.
- end_time: datetime | None
Step execution end time.
- last_updated: datetime
Last updated time for a step.
- status_message: str
Displays status for a step.
- exit_code: str
ExitCode for a step.
- name: str
Step name.
- time_elapsed: str
Time lapsed since the step execution started.
- class wxc_sdk.telephony.jobs.JobExecutionStatus(*, id: str, startTime: datetime | None = None, endTime: datetime | None = None, lastUpdated: datetime, statusMessage: str, exitCode: str, createdTime: datetime, timeElapsed: str, stepExecutionStatuses: list[wxc_sdk.telephony.jobs.StepExecutionStatus] = None)[source]
Bases:
ApiModelCreate a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- id: str
Unique identifier that identifies each instance of the job.
- start_time: datetime | None
Step execution start time.
- end_time: datetime | None
Step execution end time.
- last_updated: datetime
Last updated time post one of the step execution completion.
- status_message: str
Displays status for overall steps that are part of the job.
- exit_code: str
Exit code for a job.
- created_time: datetime
Job creation time.
- time_elapsed: str
Time lapsed since the job execution started.
- step_execution_statuses: list[wxc_sdk.telephony.jobs.StepExecutionStatus]
Status of each step within a job.
- class wxc_sdk.telephony.jobs.StartJobResponse(*, name: str | None = None, id: str, trackingId: str, sourceUserId: str, sourceCustomerId: str, targetCustomerId: str, instanceId: str, jobExecutionStatus: list[wxc_sdk.telephony.jobs.JobExecutionStatus], latestExecutionStatus: str, locationCustomizationsEnabled: bool, target: str, locationId: str, locationName: str | None = None, percentageComplete: str, deviceCount: int | None = None)[source]
Bases:
ApiModelCreate a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- name: str | None
Job name.
- id: str
Unique identifier of the job.
- tracking_id: str
Unique identifier to track the flow of HTTP requests.
- source_user_id: str
Unique identifier to identify which user has run the job.
- source_customer_id: str
Unique identifier to identify the customer who has run the job.
- target_customer_id: str
Unique identifier to identify the customer for which the job was run.
- instance_id: str
Unique identifier to identify the instance of the job.
- job_execution_status: list[wxc_sdk.telephony.jobs.JobExecutionStatus]
Displays the most recent step’s execution status. Contains execution statuses of all the steps involve in the execution of the job.
- latest_execution_status: str
Indicates the most recent status (STARTING, STARTED, COMPLETED, or FAILED) of the job at the time of invocation.
- location_customizations_enabled: bool
indicates if all the devices within this location will be customized with new requested customizations(if set to true) or will be overridden with the one at organization level (if set to false or any other value). This field has no effect when the job is being triggered at organization level.
- target: str
Indicates if the job was run at organization level (‘CUSTOMER’) or location (‘LOCATION’) level.
- location_id: str
Unique location identifier for which the job was run.
- location_name: str | None
name of location for which the job was run, only present for target LOCATION
- percentage_complete: str
Displays job completion percentage
- device_count: int | None
- class wxc_sdk.telephony.jobs.JobErrorMessage(*, description: str, code: str | None = None, location: str | None = None, locationId: str | None = None)[source]
Bases:
ApiModelCreate a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- description: str
Error message.
- code: str | None
Internal error code.
- location: str | None
Message describing the location or point of failure.
- location_id: str | None
- class wxc_sdk.telephony.jobs.JobError(*, key: str, message: list[wxc_sdk.telephony.jobs.JobErrorMessage])[source]
Bases:
ApiModelCreate a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- key: str
HTTP error code.
- message: list[wxc_sdk.telephony.jobs.JobErrorMessage]
- class wxc_sdk.telephony.jobs.JobErrorItem(*, itemNumber: int, trackingId: str, error: JobError)[source]
Bases:
ApiModelCreate a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- item_number: int
Index of error number.
- tracking_id: str
Unique identifier to track the HTTP requests.
- class wxc_sdk.telephony.jobs.JobsApi(*, session: RestSession)[source]
Bases:
ApiChildJobs API
- base = 'telephony/config/jobs'
- device_settings: DeviceSettingsJobsApi
API for device settings jobs
- manage_numbers: ManageNumbersJobsApi
API for manage numbers jobs
- class wxc_sdk.telephony.jobs.DeviceSettingsJobsApi(*, session: RestSession, base: str | None = None)[source]
Bases:
ApiChildAPI for jobs to update device settings at the location and organization level
- change(location_id: str | None, customization: DeviceCustomization, org_id: str | None = None) StartJobResponse[source]
Change device settings across organization or locations jobs.
Performs bulk and asynchronous processing for all types of device settings initiated by organization and system admins in a stateful persistent manner. This job will modify the requested device settings across all the devices. Whenever a location ID is specified in the request, it will modify the requested device settings only for the devices that are part of the provided location within an organization.
Returns a unique job ID which can then be utilized further to retrieve status and errors for the same.
Only one job per customer can be running at any given time within the same organization. An attempt to run multiple jobs at the same time will result in a 409 error response.
Running a job requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
location_id (str) – Location within an organization where changes of device settings will be applied to all the devices within it.
customization (DeviceCustomization) – customization. Atttribute custom_enabled Indicates if all the devices within this location will be customized with new requested customizations(if set to true) or will be overridden with the one at organization level (if set to false or any other value). This field has no effect when the job is being triggered at organization level.
org_id (str) – Apply change device settings for all the devices under this organization.
- Returns:
information about the created job
- Return type:
- list(org_id: str | None = None, **params) Generator[StartJobResponse, None, None][source]
List change device settings jobs.
Lists all the jobs for jobType calldevicesettings for the given organization in order of most recent one to oldest one irrespective of its status.
This API requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
org_id (str) – Retrieve list of ‘calldevicesettings’ jobs for this organization.
params – optional parameters
- Returns:
Generator of
StartJobResponseinstances
- get_status(job_id: str, org_id: str | None = None) StartJobResponse[source]
Get change device settings job status.
Provides details of the job with jobId of jobType calldevicesettings.
This API requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
job_id (str) – Retrieve job details for this jobId.
org_id (str) – Retrieve job details for this org
- Returns:
job details
- Return type:
- job_errors(job_id: str, org_id: str | None = None) Generator[JobErrorItem, None, None][source]
List change device settings job errors.
Lists all error details of the job with jobId of jobType calldevicesettings.
This API requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
job_id – Retrieve job details for this jobId.
org_id – Retrieve list of jobs for this organization.
- Returns:
- base = 'telephony/config/jobs/devices/callDeviceSettings'
- session: RestSession
REST session
- class wxc_sdk.telephony.jobs.NumberItem(*, locationId: str | None = None, numbers: list[str] | None = None)[source]
Bases:
ApiModelCreate a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- location_id: str | None
The source location of the numbers to be moved.
- numbers: list[str] | None
Indicates the numbers to be moved from one location to another location.
- class wxc_sdk.telephony.jobs.MoveNumberCounts(*, totalNumbers: int | None = None, numbersDeleted: int | None = None, numbersMoved: int | None = None, numbersFailed: int | None = None)[source]
Bases:
ApiModelCreate a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- total_numbers: int | None
Indicates the total number of phone numbers requested to be moved.
- numbers_deleted: int | None
Indicates the total number of phone numbers successfully deleted.
- numbers_moved: int | None
Indicates the total number of phone numbers successfully moved.
- numbers_failed: int | None
Indicates the total number of phone numbers failed.
- class wxc_sdk.telephony.jobs.NumberJob(*, id: str | None = None, name: str | None = None, jobType: str | None = None, trackingId: str | None = None, sourceUserId: str | None = None, sourceCustomerId: str | None = None, targetCustomerId: str | None = None, instanceId: int | None = None, jobExecutionStatus: list[wxc_sdk.telephony.jobs.JobExecutionStatus] | None = None, latestExecutionStatus: str | None = None, operationType: str | None = None, sourceLocationId: str | None = None, targetLocationId: str | None = None, sourceLocationName: str | None = None, targetLocationName: str | None = None, counts: MoveNumberCounts | None = None)[source]
Bases:
ApiModelCreate a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- id: str | None
Unique identifier of the job.
- name: str | None
job name
- job_type: str | None
Job type.
- tracking_id: str | None
Unique identifier to track the flow of HTTP requests.
- source_user_id: str | None
Unique identifier to identify which user has run the job.
- source_customer_id: str | None
Unique identifier to identify the customer who has run the job.
- target_customer_id: str | None
Unique identifier to identify the customer for which the job was run.
- instance_id: int | None
Unique identifier to identify the instance of the job.
- job_execution_status: list[wxc_sdk.telephony.jobs.JobExecutionStatus] | None
- latest_execution_status: str | None
Indicates the most recent status (STARTING, STARTED, COMPLETED, FAILED) of the job at the time of invocation.
- operation_type: str | None
Indicates operation type that was carried out.
- source_location_id: str | None
Unique location identifier for which the job was run.
- target_location_id: str | None
Unique location identifier for which the numbers have been moved.
- source_location_name: str | None
The location name for which the job was run.
- target_location_name: str | None
The location name for which the numbers have been moved.
- counts: MoveNumberCounts | None
Job statistics.
- class wxc_sdk.telephony.jobs.ErrorMessageObject(*, code: str | None = None, description: str | None = None, locationId: str | None = None)[source]
Bases:
ApiModelCreate a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- code: str | None
- description: str | None
- location_id: str | None
- class wxc_sdk.telephony.jobs.ErrorObject(*, key: str | None = None, message: list[wxc_sdk.telephony.jobs.ErrorMessageObject] | None = None)[source]
Bases:
ApiModelCreate a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- key: str | None
HTTP error code.
- message: list[wxc_sdk.telephony.jobs.ErrorMessageObject] | None
- class wxc_sdk.telephony.jobs.ManageNumberErrorItem(*, item: str | None = None, itemNumber: int | None = None, trackingId: str | None = None, error: ErrorObject | None = None)[source]
Bases:
ApiModelCreate a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- item: str | None
Phone number
- item_number: int | None
Index of error number.
- tracking_id: str | None
Unique identifier to track the HTTP requests.
- error: ErrorObject | None
- class wxc_sdk.telephony.jobs.ManageNumbersJobsApi(*, session: RestSession, base: str | None = None)[source]
Bases:
ApiChildAPI for jobs to manage numbers
- list_jobs(org_id: str | None = None, **params) Generator[NumberJob, None, None][source]
Lists all Manage Numbers jobs for the given organization in order of most recent one to oldest one irrespective of its status. The public API only supports initiating jobs which move numbers between locations. Via Control Hub they can initiate both the move and delete, so this listing can show both. This API requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
org_id (str) – Retrieve list of Manage Number jobs for this organization.
- initiate_job(operation: str, target_location_id: str, number_list: list[wxc_sdk.telephony.jobs.NumberItem]) NumberJob[source]
Starts the numbers move from one location to another location. Although jobs can do both MOVE and DELETE actions internally, only MOVE is supported publicly. In order to move a number, For example, you can move from Cisco PSTN to Cisco PSTN, but you cannot move from Cisco PSTN to a location with Cloud Connected PSTN. This API requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
operation (str) – Indicates the kind of operation to be carried out.
target_location_id (str) – The target location within organization where the unassigned numbers will be moved from the source location.
number_list (list[NumberItem]) – Indicates the numbers to be moved from source to target locations.
- job_status(job_id: str | None = None) NumberJob[source]
Returns the status and other details of the job. This API requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
job_id (str) – Retrieve job details for this jobId.
- pause_job(job_id: str | None = None, org_id: str | None = None)[source]
Pause the running Manage Numbers Job. A paused job can be resumed or abandoned. This API requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
job_id (str) – Pause the Manage Numbers job for this jobId.
org_id (str) – Pause the Manage Numbers job for this organization.
- resume_job(job_id: str | None = None, org_id: str | None = None)[source]
Resume the paused Manage Numbers Job. A paused job can be resumed or abandoned. This API requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
job_id (str) – Resume the Manage Numbers job for this jobId.
org_id (str) – Resume the Manage Numbers job for this organization.
- abandon_job(job_id: str | None = None, org_id: str | None = None)[source]
Abandon the Manage Numbers Job. This API requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters:
job_id (str) – Abandon the Manage Numbers job for this jobId.
org_id (str) – Abandon the Manage Numbers job for this organization.
- list_job_errors(job_id: str | None = None, org_id: str | None = None, **params) Generator[ManageNumberErrorItem, None, None][source]
Lists all error details of Manage Numbers job. This will not list any errors if exitCode is COMPLETED. If the status is COMPLETED_WITH_ERRORS then this lists the cause of failures. List of possible Errors: This API requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters:
job_id (str) – Retrieve the error details for this jobId.
org_id (str) – Retrieve list of jobs for this organization.
- base = 'telephony/config/jobs/numbers'
- session: RestSession
REST session