summaryrefslogtreecommitdiffstats
path: root/ansible_collections/cisco/ise/plugins/modules/reservation.py
blob: 9682fcf3a171344b85ea52042957f1df491e3b5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/usr/bin/python
# -*- coding: utf-8 -*-

# Copyright (c) 2021, Cisco Systems
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)

DOCUMENTATION = r"""
---
module: reservation
short_description: Resource module for Reservation
description:
- Manage operations create, update and delete of the resource Reservation.
- Reserve given number of SGTs in a continuous range for the given Client.
- Delete the reserved range of SGT for the given Client.
- Update the reserved ranges of a specific Client by giving the custom start and end index.
version_added: '1.0.0'
extends_documentation_fragment:
  - cisco.ise.module
author: Rafael Campos (@racampos)
options:
  clientID:
    description: ClientID path parameter. Unique name for a Client.
    type: str
  clientId:
    description: Unique ID of the given client.
    type: str
  clientName:
    description: Name of the given client.
    type: str
  endIndex:
    description: End index of the reserved range.
    type: int
  numberOfTags:
    description: Nummber of tags required to be reserved in ISE.
    type: int
  startIndex:
    description: Start index of the reserved range.
    type: int
requirements:
- ciscoisesdk >= 2.2.1
- python >= 3.5
notes:
  - SDK Method used are
    sgt_range_reservation.SgtRangeReservation.delete_sgt_reserve_range,
    sgt_range_reservation.SgtRangeReservation.reserve_sgt_range,
    sgt_range_reservation.SgtRangeReservation.update_reserved_range,

  - Paths used are
    post /api/v1/sgt/reservation/reserveRange,
    delete /api/v1/sgt/reservation/{clientID},
    put /api/v1/sgt/reservation/{clientID},

"""

EXAMPLES = r"""
- name: Create
  cisco.ise.reservation:
    ise_hostname: "{{ise_hostname}}"
    ise_username: "{{ise_username}}"
    ise_password: "{{ise_password}}"
    ise_verify: "{{ise_verify}}"
    state: present
    clientName: string
    numberOfTags: 0

- name: Update by id
  cisco.ise.reservation:
    ise_hostname: "{{ise_hostname}}"
    ise_username: "{{ise_username}}"
    ise_password: "{{ise_password}}"
    ise_verify: "{{ise_verify}}"
    state: present
    clientID: string
    clientId: string
    endIndex: 0
    startIndex: 0

- name: Delete by id
  cisco.ise.reservation:
    ise_hostname: "{{ise_hostname}}"
    ise_username: "{{ise_username}}"
    ise_password: "{{ise_password}}"
    ise_verify: "{{ise_verify}}"
    state: absent
    clientID: string

"""

RETURN = r"""
ise_response:
  description: A dictionary or list with the response returned by the Cisco ISE Python SDK
  returned: always
  type: dict
  sample: >
    {
      "clientId": "string",
      "clientName": "string",
      "endIndex": 0,
      "startIndex": 0
    }

ise_update_response:
  description: A dictionary or list with the response returned by the Cisco ISE Python SDK
  returned: always
  version_added: '1.1.0'
  type: dict
  sample: >
    {
      "success": {
        "message": "string"
      },
      "version": "string"
    }
"""