cisco.catalystcenter.network_device_maintenance_schedules module -- Resource module for Network Device Maintenance Schedules

Note

This module is part of the cisco.catalystcenter collection (version 2.11.0).

To install it, use: ansible-galaxy collection install cisco.catalystcenter. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: cisco.catalystcenter.network_device_maintenance_schedules.

New in cisco.catalystcenter 2.0.0

Synopsis

  • Manage operations create, update and delete of the resource Network Device Maintenance Schedules. - > API to create maintenance schedule for network devices. The state of network device can be queried using API `GET /dna/intent/api/v1/networkDevices`. The `managementState` attribute of the network device will be updated to `UNDER_MAINTENANCE` when the maintenance window starts. - > API to delete maintenance schedule by id. Deletion is allowed if the maintenance window is in the `UPCOMING`, `COMPLETED`, or `FAILED` state. Deletion of maintenance schedule is not allowed if the maintenance window is currently `IN_PROGRESS`. To delete the maintenance schedule while it is `IN_PROGRESS`, first exit the current maintenance window using `PUT /dna/intent/api/v1/networkDeviceMaintenanceSchedules/{id}` API, and then proceed to delete the maintenance schedule.

  • API to update the maintenance schedule for the network devices.

Note

This module has a corresponding action plugin.

Requirements

The below requirements are needed on the host that executes this module.

  • catalystcentersdk >= 3.2.3.0.0

  • python >= 3.12

Parameters

Parameter

Comments

catalystcenter_debug

aliases: dnac_debug

boolean

Flag for Cisco Catalyst Center SDK to enable debugging.

Choices:

catalystcenter_host

aliases: dnac_host

string / required

The Cisco Catalyst Center hostname.

catalystcenter_password

aliases: dnac_password

string

The Cisco Catalyst Center password to authenticate.

catalystcenter_port

aliases: dnac_port, catalystcenter_api_port

integer

The Cisco Catalyst Center port.

Default: :ansible-option-default:`443`

catalystcenter_username

aliases: dnac_username, user

string

The Cisco Catalyst Center username to authenticate.

Default: :ansible-option-default:`"admin"`

catalystcenter_verify

aliases: dnac_verify

boolean

Flag to enable or disable SSL certificate verification.

Choices:

catalystcenter_version

aliases: dnac_version

string

Informs the SDK which version of Cisco Catalyst Center to use.

Default: :ansible-option-default:`"3.1.6.0"`

description

string

A brief narrative describing the maintenance schedule.

id

string

Id of the schedule maintenance window.

maintenanceSchedule

dictionary

Contains all the details necessary to define the maintenance window and its recurrence.

endId

string

Activity id of end schedule of the maintenance window. To check the status of the end schedule, use `GET /dna/intent/api/v1/activities/{id}`. `endId` remains same for every occurrence of recurrence instance.

endTime

integer

End time indicates the ending of the maintenance window in Unix epoch time in milliseconds.

recurrence

dictionary

Details about the recurrence of the maintenance schedule.

interval

integer

Interval for recurrence in days. The interval must be longer than the duration of the schedules. The maximum allowed interval is 365 days.

recurrenceEndTime

integer

The end date for the recurrence in Unix epoch time in milliseconds. Recurrence end time should be greater than maintenance end date/time.

startId

string

Activity id of start schedule of the maintenance window. To check the status of the start schedule, use `GET /dna/intent/api/v1/activities/{id}`. `startId` remains same for every occurrence of recurrence instance.

startTime

integer

Start time indicates the beginning of the maintenance window in Unix epoch time in milliseconds.

status

string

The status of the maintenance schedule. Possible values are - `UPCOMING` The maintenance is scheduled and pending execution. - `IN_PROGRESS` The maintenance is currently in progress. - `COMPLETED` The maintenance window has been fully completed (For recurring maintenance, this indicates completion of the most recent occurrence). - `FAILED` Updating the device's management state was not successful. If the status of startId or endId is `FAILED`, this will be indicated as failed. To check the status of startId or endId, refer to `GET /intent/api/v1/activities/{id}`.

networkDeviceIds

list / elements=string

Network Device Maintenance Schedules's networkDeviceIds.

validate_response_schema

boolean

Flag for Cisco Catalyst Center SDK to enable the validation of request bodies against a JSON schema.

Choices:

Notes

Note

  • SDK Method used are devices.Devices.create_maintenance_schedule_for_network_devices, devices.Devices.delete_maintenance_schedule, devices.Devices.updates_the_maintenance_schedule_information,

  • Paths used are post /dna/intent/api/v1/networkDeviceMaintenanceSchedules, delete /dna/intent/api/v1/networkDeviceMaintenanceSchedules/{id}, put /dna/intent/api/v1/networkDeviceMaintenanceSchedules/{id},

  • Does not support check_mode

  • The plugin runs on the control node and does not use any ansible connection plugins,

  • but instead uses the embedded connection manager from Cisco CATALYST SDK

  • Requires Python >= 3.10, matching the controller Python versions supported by the collection's minimum ansible-core version (see the collection README for the current ansible-core / Python compatibility range)

See Also

See also

Cisco Catalyst Center documentation for Devices CreateMaintenanceScheduleForNetworkDevices

Complete reference of the CreateMaintenanceScheduleForNetworkDevices API.

Cisco Catalyst Center documentation for Devices DeleteMaintenanceSchedule

Complete reference of the DeleteMaintenanceSchedule API.

Cisco Catalyst Center documentation for Devices UpdatesTheMaintenanceScheduleInformation

Complete reference of the UpdatesTheMaintenanceScheduleInformation API.

Examples

---
- name: Create
  cisco.catalystcenter.network_device_maintenance_schedules:
    catalystcenter_host: "{{catalystcenter_host}}"
    catalystcenter_username: "{{catalystcenter_username}}"
    catalystcenter_password: "{{catalystcenter_password}}"
    catalystcenter_verify: "{{catalystcenter_verify}}"
    catalystcenter_port: "{{catalystcenter_port}}"
    catalystcenter_version: "{{catalystcenter_version}}"
    catalystcenter_debug: "{{catalystcenter_debug}}"
    state: present
    description: string
    id: string
    maintenanceSchedule:
      endId: string
      endTime: {}
      recurrence:
        interval: 0
        recurrenceEndTime: {}
      startId: string
      startTime: {}
      status: string
    networkDeviceIds:
      - string
- name: Update by id
  cisco.catalystcenter.network_device_maintenance_schedules:
    catalystcenter_host: "{{catalystcenter_host}}"
    catalystcenter_username: "{{catalystcenter_username}}"
    catalystcenter_password: "{{catalystcenter_password}}"
    catalystcenter_verify: "{{catalystcenter_verify}}"
    catalystcenter_port: "{{catalystcenter_port}}"
    catalystcenter_version: "{{catalystcenter_version}}"
    catalystcenter_debug: "{{catalystcenter_debug}}"
    state: present
    description: string
    id: string
    maintenanceSchedule:
      endId: string
      endTime: {}
      recurrence:
        interval: 0
        recurrenceEndTime: {}
      startId: string
      startTime: {}
      status: string
    networkDeviceIds:
      - string
- name: Delete by id
  cisco.catalystcenter.network_device_maintenance_schedules:
    catalystcenter_host: "{{catalystcenter_host}}"
    catalystcenter_username: "{{catalystcenter_username}}"
    catalystcenter_password: "{{catalystcenter_password}}"
    catalystcenter_verify: "{{catalystcenter_verify}}"
    catalystcenter_port: "{{catalystcenter_port}}"
    catalystcenter_version: "{{catalystcenter_version}}"
    catalystcenter_debug: "{{catalystcenter_debug}}"
    state: absent
    id: string

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

catalystcenter_response

dictionary

A dictionary or list with the response returned by the Cisco Catalyst Center Python SDK

Returned: always

Sample: :ansible-rv-sample-value:`{"response": {"taskId": "string", "url": "string"}, "version": "string"}`

Authors

  • Bryan Vargas (@bvargasre)