wxc_sdk.devices package

Devices represent cloud-registered Webex RoomOS devices. Devices may be associated with Workspaces.

Searching and viewing details for your devices requires an auth token with the spark:devices_read scope. Updating or deleting your devices requires an auth token with the spark:devices_write scope. Viewing the list of all devices in an organization requires an administrator auth token with the spark-admin:devices_read scope. Adding, updating, or deleting all devices in an organization requires an administrator auth token with the spark-admin:devices_write scope. Generating an activation code requires an auth token with the identity:placeonetimepassword_create scope.

class wxc_sdk.devices.DevicesApi(*, session: RestSession)[source]

Bases: ApiChild

Devices represent cloud-registered Webex RoomOS devices or IP Phones. Devices may be associated with Workspaces or People.

The following scopes are required for performing the specified actions:

Searching and viewing details for devices requires an auth token with the spark:devices_read scope.

Updating or deleting your devices requires an auth token with the spark:devices_write scope.

Viewing the list of all devices in an organization requires an administrator auth token with the spark-admin:devices_read scope.

Adding, updating, or deleting all devices in an organization requires an administrator auth token with the spark-admin:devices_write scope.

Generating an activation code requires an auth token with the identity:placeonetimepassword_create scope.

settings_jobs: DeviceSettingsJobsApi

device jobs Api

list(person_id: str | None = None, workspace_id: str | None = None, workspace_location_id: str | None = None, display_name: str | None = None, product: str | None = None, product_type: str | None = None, tag: str | None = None, connection_status: str | None = None, serial: str | None = None, software: str | None = None, upgrade_channel: str | None = None, error_code: str | None = None, capability: str | None = None, permission: str | None = None, org_id: str | None = None, **params) Generator[Device, None, None][source]

List Devices

Lists all active Webex devices associated with the authenticated user, such as devices activated in personal mode. Administrators can list all devices within an organization.

Parameters:
  • person_id (str) – List devices by person ID.

  • workspace_id (str) – List devices by workspace ID.

  • workspace_location_id (str) – List devices by workspace location ID.

  • display_name (str) – List devices with this display name.

  • product (str) – List devices with this product name.

  • product_type (str) – List devices with this type. Possible values: roomdesk, phone, accessory, webexgo, unknown

  • tag (str separating the tag values or adding several tag parameters.) – List devices which have a tag. Searching for multiple tags (logical AND) can be done by comma

  • connection_status (str) – List devices with this connection statu

  • serial (str) – List devices with this serial number.

  • software (str) – List devices with this software version.

  • upgrade_channel (str) – List devices with this upgrade channel.

  • error_code (str) – List devices with this error code.

  • capability (str) – List devices with this capability.

  • permission (str) – List devices with this permission.

  • org_id (str) – List devices in this organization. Only admin users of another organization (such as partners) may use this parameter.

Returns:

Generator yielding Device instances

details(device_id: str, org_id: str | None = None) Device[source]

Get Device Details Shows details for a device, by ID.

Specify the device ID in the deviceId parameter in the URI.

Parameters:
  • device_id (str) – A unique identifier for the device.

  • org_id (str) –

Returns:

Device details

Return type:

Device

delete(device_id: str, org_id: str | None = None)[source]

Delete a Device

Deletes a device, by ID.

Specify the device ID in the deviceId parameter in the URI.

Parameters:
  • device_id (str) – A unique identifier for the device.

  • org_id (str) –

modify_device_tags(device_id: str, op: TagOp, value: List[str], org_id: str | None = None) Device[source]

Modify Device Tags

Update requests use JSON Patch syntax.

Parameters:
  • device_id (str) – A unique identifier for the device.

  • op (TagOp) – tag operation

  • value (list[str]) – list of tags

  • org_id (str) –

Returns:

device details

Return type:

Device

activation_code(workspace_id: str | None = None, person_id: str | None = None, model: str | None = None, org_id: str | None = None) ActivationCodeResponse[source]

Create a Device Activation Code

Generate an activation code for a device in a specific workspace by workspaceId. Currently, activation codes may only be generated for shared workspaces–personal mode is not supported.

Parameters:
  • workspace_id (str) – The ID of the workspace where the device will be activated.

  • person_id (str) – The ID of the person who will own the device once activated.

  • model (str) – The model of the device being created.

  • org_id (str) – The organization associated with the activation code generated.

Return type:

ActivationCodeResponse

base = 'devices'
create_by_mac_address(mac: str, workspace_id: str | None = None, person_id: str | None = None, model: str | None = None, password: str | None = None, org_id: str | None = None) Device[source]

Create a phone by it’s MAC address in a specific workspace or for a person. Specify the mac, model and either workspaceId or personId.

Parameters:
  • mac (str) – The MAC address of the device being created.

  • workspace_id (str) – The ID of the workspace where the device will be activated.

  • person_id (str) – The ID of the person who will own the device once activated.

  • model (str) – The model of the device being created.

  • password (str) – SIP password to be configured for the phone, only required with third party devices.

  • org_id (str) – The organization associated with the device.

Returns:

created device information

Return type:

Device

class wxc_sdk.devices.Device(*, id: str, displayName: str, workspaceId: str | None = None, workspaceLocationId: str | None = None, personId: str | None = None, orgId: str, capabilities: list[str], permissions: list[str], connectionStatus: str, product: str, type: str, tags: list[str], ip: str | None = None, activeInterface: str | None = None, mac: str | None = None, primarySipUrl: str | None = None, sipUrls: list[Any], errorCodes: list[Any] | None = None, serial: str | None = None, software: str | None = None, upgradeChannel: str | None = None, created: datetime | None = None, firstSeen: datetime | None = None, lastSeen: datetime | None = None, managedBy: str | None = None, manufacturer: str | None = None, linePort: str | None = None, outboundProxy: str | None = None, sipUserName: str | None = None)[source]

Bases: ApiModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.

device_id: str

A unique identifier for the device.

display_name: str

A friendly name for the device

workspace_id: str | None

The workspace associated with the device.

workspace_location_id: str | None

The workspace location associated with the device.

person_id: str | None

The person associated with the device.

org_id: str

The organization associated with the device

capabilities: list[str]

The capabilities of the device.

permissions: list[str]

The permissions the user has for this device. For example, xapi means this user is entitled to using the xapi against this device.

connection_status: str

The connection status of the device.

product: str

The product name. A display friendly version of the device’s model.

product_type: str

The product type.

tags: list[str]

Tags assigned to the device.

ip: str | None

The current IP address of the device.

active_interface: str | None

The current network connectivty for the device.

mac: str | None

The unique address for the network adapter.

primary_sip_url: str | None

The primary SIP address to dial this device.

sip_urls: list[Any]

All SIP addresses to dial this device.

error_codes: list[Any] | None
serial: str | None

Serial number for the device.

software: str | None

The operating system name data and version tag.

upgrade_channel: str | None

The upgrade channel the device is assigned to.

created: datetime | None

The date and time that the device was registered, in ISO8601 format.

first_seen: datetime | None

The date and time that the device was first seen, in ISO8601 format.

last_seen: datetime | None

The date and time that the device was last seen, in ISO8601 format.

managed_by: str | None

Device manager(s)

manufacturer: str | None

Manufacturer of the device only for 3rd party devices

line_port: str | None

The Line/Port identifies a device endpoint in standalone mode or a SIP URI public identity in IMS mode only for 3rd party devices

outbound_proxy: str | None

Contains the body of the HTTP response received following the request to the Console API. Not set if the response has no body. only for 3rd party devices

sip_user_name: str | None

SIP authentication user name for the owner of the device. only for 3rd party devices

classmethod pop_place_id(values)[source]
model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'forbid', 'populate_by_name': True, 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'active_interface': FieldInfo(annotation=Union[str, NoneType], required=False, alias='activeInterface', alias_priority=1), 'capabilities': FieldInfo(annotation=list[str], required=True, alias='capabilities', alias_priority=1), 'connection_status': FieldInfo(annotation=str, required=True, alias='connectionStatus', alias_priority=1), 'created': FieldInfo(annotation=Union[datetime, NoneType], required=False, alias='created', alias_priority=1), 'device_id': FieldInfo(annotation=str, required=True, alias='id', alias_priority=2), 'display_name': FieldInfo(annotation=str, required=True, alias='displayName', alias_priority=1), 'error_codes': FieldInfo(annotation=Union[list[Any], NoneType], required=False, alias='errorCodes', alias_priority=1), 'first_seen': FieldInfo(annotation=Union[datetime, NoneType], required=False, alias='firstSeen', alias_priority=1), 'ip': FieldInfo(annotation=Union[str, NoneType], required=False, alias='ip', alias_priority=1), 'last_seen': FieldInfo(annotation=Union[datetime, NoneType], required=False, alias='lastSeen', alias_priority=1), 'line_port': FieldInfo(annotation=Union[str, NoneType], required=False, alias='linePort', alias_priority=1), 'mac': FieldInfo(annotation=Union[str, NoneType], required=False, alias='mac', alias_priority=1), 'managed_by': FieldInfo(annotation=Union[str, NoneType], required=False, alias='managedBy', alias_priority=1), 'manufacturer': FieldInfo(annotation=Union[str, NoneType], required=False, alias='manufacturer', alias_priority=1), 'org_id': FieldInfo(annotation=str, required=True, alias='orgId', alias_priority=1), 'outbound_proxy': FieldInfo(annotation=Union[str, NoneType], required=False, alias='outboundProxy', alias_priority=1), 'permissions': FieldInfo(annotation=list[str], required=True, alias='permissions', alias_priority=1), 'person_id': FieldInfo(annotation=Union[str, NoneType], required=False, alias='personId', alias_priority=1), 'primary_sip_url': FieldInfo(annotation=Union[str, NoneType], required=False, alias='primarySipUrl', alias_priority=1), 'product': FieldInfo(annotation=str, required=True, alias='product', alias_priority=1), 'product_type': FieldInfo(annotation=str, required=True, alias='type', alias_priority=2), 'serial': FieldInfo(annotation=Union[str, NoneType], required=False, alias='serial', alias_priority=1), 'sip_urls': FieldInfo(annotation=list[Any], required=True, alias='sipUrls', alias_priority=1), 'sip_user_name': FieldInfo(annotation=Union[str, NoneType], required=False, alias='sipUserName', alias_priority=1), 'software': FieldInfo(annotation=Union[str, NoneType], required=False, alias='software', alias_priority=1), 'tags': FieldInfo(annotation=list[str], required=True, alias='tags', alias_priority=1), 'upgrade_channel': FieldInfo(annotation=Union[str, NoneType], required=False, alias='upgradeChannel', alias_priority=1), 'workspace_id': FieldInfo(annotation=Union[str, NoneType], required=False, alias='workspaceId', alias_priority=1), 'workspace_location_id': FieldInfo(annotation=Union[str, NoneType], required=False, alias='workspaceLocationId', alias_priority=1)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class wxc_sdk.devices.TagOp(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, SafeEnum

An enumeration.

add = 'add'
remove = 'remove'
replace = 'replace'
class wxc_sdk.devices.ActivationCodeResponse(*, code: str, expiryTime: datetime)[source]

Bases: ApiModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.

code: str

The activation code.

expiry_time: datetime

The date and time the activation code expires.

model_config: ClassVar[ConfigDict] = {'alias_generator': <function to_camel>, 'extra': 'forbid', 'populate_by_name': True, 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'code': FieldInfo(annotation=str, required=True, alias='code', alias_priority=1), 'expiry_time': FieldInfo(annotation=datetime, required=True, alias='expiryTime', alias_priority=1)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.