floe-servicenow 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rubocop_local.yml +5 -0
- data/.whitesource +3 -0
- data/CHANGELOG.md +24 -0
- data/LICENSE.txt +202 -0
- data/README.md +185 -0
- data/Rakefile +12 -0
- data/docs/cmdb.md +343 -0
- data/docs/incident.md +270 -0
- data/docs/oauth.md +98 -0
- data/docs/service_catalog.md +423 -0
- data/docs/table.md +320 -0
- data/examples/cmdb.asl +90 -0
- data/examples/create_server_ci.asl +43 -0
- data/examples/incident.asl +53 -0
- data/examples/oauth.asl +67 -0
- data/examples/service_catalog.asl +77 -0
- data/examples/table.asl +138 -0
- data/exe/floe-servicenow +9 -0
- data/lib/floe/service_now.rb +1 -0
- data/lib/floe/servicenow/cmdb.rb +282 -0
- data/lib/floe/servicenow/incident.rb +128 -0
- data/lib/floe/servicenow/methods.rb +73 -0
- data/lib/floe/servicenow/oauth.rb +39 -0
- data/lib/floe/servicenow/runner.rb +73 -0
- data/lib/floe/servicenow/service_catalog.rb +446 -0
- data/lib/floe/servicenow/table.rb +217 -0
- data/lib/floe/servicenow/version.rb +7 -0
- data/lib/floe/servicenow.rb +35 -0
- metadata +130 -0
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
# Service Catalog API Methods
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
|
|
5
|
+
| Method | Description |
|
|
6
|
+
|--------|-------------|
|
|
7
|
+
| [Submit Catalog Item](#submit-catalog-item) | Submit a catalog item order directly |
|
|
8
|
+
| [Get Request](#get-request) | Retrieve details of a service catalog request |
|
|
9
|
+
| [Get Requested Item](#get-requested-item) | Retrieve summary of a requested catalog item |
|
|
10
|
+
| [Get Catalogs](#get-catalogs) | Retrieve all available service catalogs |
|
|
11
|
+
| [Get Catalog](#get-catalog) | Retrieve details of a specific catalog |
|
|
12
|
+
| [Get Categories](#get-categories) | Retrieve all available catalog categories |
|
|
13
|
+
| [Get Category](#get-category) | Retrieve details of a specific category |
|
|
14
|
+
| [Get Items](#get-items) | Retrieve all available catalog items |
|
|
15
|
+
| [Get Item](#get-item) | Retrieve details of a specific catalog item |
|
|
16
|
+
| [Search Items](#search-items) | Search for catalog items by search term |
|
|
17
|
+
| [Get Cart](#get-cart) | Retrieve current shopping cart contents |
|
|
18
|
+
| [Add to Cart](#add-to-cart) | Add a catalog item to the shopping cart |
|
|
19
|
+
| [Update Cart Item](#update-cart-item) | Update a catalog item in the shopping cart |
|
|
20
|
+
| [Remove from Cart](#remove-from-cart) | Remove a catalog item from the shopping cart |
|
|
21
|
+
| [Empty Cart](#empty-cart) | Remove all items from the shopping cart |
|
|
22
|
+
| [Checkout Cart](#checkout-cart) | Checkout the shopping cart |
|
|
23
|
+
| [Submit Order](#submit-order) | Submit the shopping cart as an order |
|
|
24
|
+
|
|
25
|
+
## Submit Catalog Item
|
|
26
|
+
|
|
27
|
+
Submit a catalog item order directly without using the cart.
|
|
28
|
+
|
|
29
|
+
**Resource**: `servicenow://service_catalog/submit_catalog_item`
|
|
30
|
+
|
|
31
|
+
**Required Parameters**:
|
|
32
|
+
- `instance_id` (string): ServiceNow instance identifier
|
|
33
|
+
- `item_sys_id` (string): sys_id of the catalog item to order
|
|
34
|
+
|
|
35
|
+
**Optional Parameters**:
|
|
36
|
+
- `variables` (object): Hash of variable names and values for the catalog item
|
|
37
|
+
- Additional parameters as needed by the catalog item
|
|
38
|
+
|
|
39
|
+
**Example**:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"Resource": "servicenow://service_catalog/submit_catalog_item",
|
|
44
|
+
"Parameters": {
|
|
45
|
+
"instance_id": "dev12345",
|
|
46
|
+
"item_sys_id": "abc123",
|
|
47
|
+
"variables": {
|
|
48
|
+
"quantity": "1",
|
|
49
|
+
"requested_for": "user@example.com"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Get Request
|
|
56
|
+
|
|
57
|
+
Retrieve details of a service catalog request.
|
|
58
|
+
|
|
59
|
+
**Resource**: `servicenow://service_catalog/get_request`
|
|
60
|
+
|
|
61
|
+
**Required Parameters**:
|
|
62
|
+
- `instance_id` (string): ServiceNow instance identifier
|
|
63
|
+
- `request_id` (string): sys_id of the request
|
|
64
|
+
|
|
65
|
+
**Example**:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"Resource": "servicenow://service_catalog/get_request",
|
|
70
|
+
"Parameters": {
|
|
71
|
+
"instance_id": "dev12345",
|
|
72
|
+
"request_id": "req123"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Get Requested Item
|
|
78
|
+
|
|
79
|
+
Retrieve summary of a requested catalog item.
|
|
80
|
+
|
|
81
|
+
**Resource**: `servicenow://service_catalog/get_requested_item`
|
|
82
|
+
|
|
83
|
+
**Required Parameters**:
|
|
84
|
+
- `instance_id` (string): ServiceNow instance identifier
|
|
85
|
+
- `requested_item_id` (string): sys_id of the requested item
|
|
86
|
+
|
|
87
|
+
**Example**:
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"Resource": "servicenow://service_catalog/get_requested_item",
|
|
92
|
+
"Parameters": {
|
|
93
|
+
"instance_id": "dev12345",
|
|
94
|
+
"requested_item_id": "ritm123"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Get Catalogs
|
|
100
|
+
|
|
101
|
+
Retrieve all available service catalogs.
|
|
102
|
+
|
|
103
|
+
**Resource**: `servicenow://service_catalog/get_catalogs`
|
|
104
|
+
|
|
105
|
+
**Required Parameters**:
|
|
106
|
+
- `instance_id` (string): ServiceNow instance identifier
|
|
107
|
+
|
|
108
|
+
**Example**:
|
|
109
|
+
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"Resource": "servicenow://service_catalog/get_catalogs",
|
|
113
|
+
"Parameters": {
|
|
114
|
+
"instance_id": "dev12345"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Get Catalog
|
|
120
|
+
|
|
121
|
+
Retrieve details of a specific service catalog.
|
|
122
|
+
|
|
123
|
+
**Resource**: `servicenow://service_catalog/get_catalog`
|
|
124
|
+
|
|
125
|
+
**Required Parameters**:
|
|
126
|
+
- `instance_id` (string): ServiceNow instance identifier
|
|
127
|
+
- `catalog_id` (string): sys_id of the catalog
|
|
128
|
+
|
|
129
|
+
**Example**:
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"Resource": "servicenow://service_catalog/get_catalog",
|
|
134
|
+
"Parameters": {
|
|
135
|
+
"instance_id": "dev12345",
|
|
136
|
+
"catalog_id": "cat123"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Get Categories
|
|
142
|
+
|
|
143
|
+
Retrieve all available catalog categories.
|
|
144
|
+
|
|
145
|
+
**Resource**: `servicenow://service_catalog/get_categories`
|
|
146
|
+
|
|
147
|
+
**Required Parameters**:
|
|
148
|
+
- `instance_id` (string): ServiceNow instance identifier
|
|
149
|
+
|
|
150
|
+
**Example**:
|
|
151
|
+
|
|
152
|
+
```json
|
|
153
|
+
{
|
|
154
|
+
"Resource": "servicenow://service_catalog/get_categories",
|
|
155
|
+
"Parameters": {
|
|
156
|
+
"instance_id": "dev12345"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Get Category
|
|
162
|
+
|
|
163
|
+
Retrieve details of a specific catalog category.
|
|
164
|
+
|
|
165
|
+
**Resource**: `servicenow://service_catalog/get_category`
|
|
166
|
+
|
|
167
|
+
**Required Parameters**:
|
|
168
|
+
- `instance_id` (string): ServiceNow instance identifier
|
|
169
|
+
- `category_id` (string): sys_id of the category
|
|
170
|
+
|
|
171
|
+
**Example**:
|
|
172
|
+
|
|
173
|
+
```json
|
|
174
|
+
{
|
|
175
|
+
"Resource": "servicenow://service_catalog/get_category",
|
|
176
|
+
"Parameters": {
|
|
177
|
+
"instance_id": "dev12345",
|
|
178
|
+
"category_id": "category123"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Get Items
|
|
184
|
+
|
|
185
|
+
Retrieve all available catalog items.
|
|
186
|
+
|
|
187
|
+
**Resource**: `servicenow://service_catalog/get_items`
|
|
188
|
+
|
|
189
|
+
**Required Parameters**:
|
|
190
|
+
- `instance_id` (string): ServiceNow instance identifier
|
|
191
|
+
|
|
192
|
+
**Example**:
|
|
193
|
+
|
|
194
|
+
```json
|
|
195
|
+
{
|
|
196
|
+
"Resource": "servicenow://service_catalog/get_items",
|
|
197
|
+
"Parameters": {
|
|
198
|
+
"instance_id": "dev12345"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Get Item
|
|
204
|
+
|
|
205
|
+
Retrieve details of a specific catalog item.
|
|
206
|
+
|
|
207
|
+
**Resource**: `servicenow://service_catalog/get_item`
|
|
208
|
+
|
|
209
|
+
**Required Parameters**:
|
|
210
|
+
- `instance_id` (string): ServiceNow instance identifier
|
|
211
|
+
- `item_id` (string): sys_id of the catalog item
|
|
212
|
+
|
|
213
|
+
**Example**:
|
|
214
|
+
|
|
215
|
+
```json
|
|
216
|
+
{
|
|
217
|
+
"Resource": "servicenow://service_catalog/get_item",
|
|
218
|
+
"Parameters": {
|
|
219
|
+
"instance_id": "dev12345",
|
|
220
|
+
"item_id": "item123"
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## Search Items
|
|
226
|
+
|
|
227
|
+
Search for catalog items by search term.
|
|
228
|
+
|
|
229
|
+
**Resource**: `servicenow://service_catalog/search_items`
|
|
230
|
+
|
|
231
|
+
**Required Parameters**:
|
|
232
|
+
- `instance_id` (string): ServiceNow instance identifier
|
|
233
|
+
- `search_term` (string): Search term to find items
|
|
234
|
+
|
|
235
|
+
**Example**:
|
|
236
|
+
|
|
237
|
+
```json
|
|
238
|
+
{
|
|
239
|
+
"Resource": "servicenow://service_catalog/search_items",
|
|
240
|
+
"Parameters": {
|
|
241
|
+
"instance_id": "dev12345",
|
|
242
|
+
"search_term": "laptop"
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## Get Cart
|
|
248
|
+
|
|
249
|
+
Retrieve the current shopping cart contents.
|
|
250
|
+
|
|
251
|
+
**Resource**: `servicenow://service_catalog/get_cart`
|
|
252
|
+
|
|
253
|
+
**Required Parameters**:
|
|
254
|
+
- `instance_id` (string): ServiceNow instance identifier
|
|
255
|
+
|
|
256
|
+
**Example**:
|
|
257
|
+
|
|
258
|
+
```json
|
|
259
|
+
{
|
|
260
|
+
"Resource": "servicenow://service_catalog/get_cart",
|
|
261
|
+
"Parameters": {
|
|
262
|
+
"instance_id": "dev12345"
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## Add to Cart
|
|
268
|
+
|
|
269
|
+
Add a catalog item to the shopping cart.
|
|
270
|
+
|
|
271
|
+
**Resource**: `servicenow://service_catalog/add_to_cart`
|
|
272
|
+
|
|
273
|
+
**Required Parameters**:
|
|
274
|
+
- `instance_id` (string): ServiceNow instance identifier
|
|
275
|
+
- `item_id` (string): sys_id of the catalog item to add
|
|
276
|
+
|
|
277
|
+
**Optional Parameters**:
|
|
278
|
+
- `cart_id` (string): sys_id of the cart (defaults to "default")
|
|
279
|
+
- `quantity` (integer): Quantity to add
|
|
280
|
+
- `variables` (object): Hash of variable names and values
|
|
281
|
+
|
|
282
|
+
**Example**:
|
|
283
|
+
|
|
284
|
+
```json
|
|
285
|
+
{
|
|
286
|
+
"Resource": "servicenow://service_catalog/add_to_cart",
|
|
287
|
+
"Parameters": {
|
|
288
|
+
"instance_id": "dev12345",
|
|
289
|
+
"item_id": "item123",
|
|
290
|
+
"quantity": 2,
|
|
291
|
+
"variables": {
|
|
292
|
+
"color": "black",
|
|
293
|
+
"size": "15-inch"
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## Update Cart Item
|
|
300
|
+
|
|
301
|
+
Update a catalog item in the shopping cart.
|
|
302
|
+
|
|
303
|
+
**Resource**: `servicenow://service_catalog/update_cart_item`
|
|
304
|
+
|
|
305
|
+
**Required Parameters**:
|
|
306
|
+
- `instance_id` (string): ServiceNow instance identifier
|
|
307
|
+
- `cart_item_id` (string): sys_id of the cart item to update
|
|
308
|
+
|
|
309
|
+
**Optional Parameters**:
|
|
310
|
+
- `cart_id` (string): sys_id of the cart (defaults to "default")
|
|
311
|
+
- `quantity` (integer): New quantity
|
|
312
|
+
- `variables` (object): Updated variable values
|
|
313
|
+
|
|
314
|
+
**Example**:
|
|
315
|
+
|
|
316
|
+
```json
|
|
317
|
+
{
|
|
318
|
+
"Resource": "servicenow://service_catalog/update_cart_item",
|
|
319
|
+
"Parameters": {
|
|
320
|
+
"instance_id": "dev12345",
|
|
321
|
+
"cart_item_id": "cartitem123",
|
|
322
|
+
"quantity": 3
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
## Remove from Cart
|
|
328
|
+
|
|
329
|
+
Remove a catalog item from the shopping cart.
|
|
330
|
+
|
|
331
|
+
**Resource**: `servicenow://service_catalog/remove_from_cart`
|
|
332
|
+
|
|
333
|
+
**Required Parameters**:
|
|
334
|
+
- `instance_id` (string): ServiceNow instance identifier
|
|
335
|
+
- `cart_item_id` (string): sys_id of the cart item to remove
|
|
336
|
+
|
|
337
|
+
**Optional Parameters**:
|
|
338
|
+
- `cart_id` (string): sys_id of the cart (defaults to "default")
|
|
339
|
+
|
|
340
|
+
**Example**:
|
|
341
|
+
|
|
342
|
+
```json
|
|
343
|
+
{
|
|
344
|
+
"Resource": "servicenow://service_catalog/remove_from_cart",
|
|
345
|
+
"Parameters": {
|
|
346
|
+
"instance_id": "dev12345",
|
|
347
|
+
"cart_item_id": "cartitem123"
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
## Empty Cart
|
|
353
|
+
|
|
354
|
+
Remove all items from the shopping cart.
|
|
355
|
+
|
|
356
|
+
**Resource**: `servicenow://service_catalog/empty_cart`
|
|
357
|
+
|
|
358
|
+
**Required Parameters**:
|
|
359
|
+
- `instance_id` (string): ServiceNow instance identifier
|
|
360
|
+
|
|
361
|
+
**Optional Parameters**:
|
|
362
|
+
- `cart_id` (string): sys_id of the cart (defaults to "default")
|
|
363
|
+
|
|
364
|
+
**Example**:
|
|
365
|
+
|
|
366
|
+
```json
|
|
367
|
+
{
|
|
368
|
+
"Resource": "servicenow://service_catalog/empty_cart",
|
|
369
|
+
"Parameters": {
|
|
370
|
+
"instance_id": "dev12345"
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
## Checkout Cart
|
|
376
|
+
|
|
377
|
+
Checkout the shopping cart (prepare for order submission).
|
|
378
|
+
|
|
379
|
+
**Resource**: `servicenow://service_catalog/checkout_cart`
|
|
380
|
+
|
|
381
|
+
**Required Parameters**:
|
|
382
|
+
- `instance_id` (string): ServiceNow instance identifier
|
|
383
|
+
|
|
384
|
+
**Optional Parameters**:
|
|
385
|
+
- `cart_id` (string): sys_id of the cart
|
|
386
|
+
- `special_instructions` (string): Special instructions for the order
|
|
387
|
+
|
|
388
|
+
**Example**:
|
|
389
|
+
|
|
390
|
+
```json
|
|
391
|
+
{
|
|
392
|
+
"Resource": "servicenow://service_catalog/checkout_cart",
|
|
393
|
+
"Parameters": {
|
|
394
|
+
"instance_id": "dev12345",
|
|
395
|
+
"special_instructions": "Please deliver to building A"
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
## Submit Order
|
|
401
|
+
|
|
402
|
+
Submit the shopping cart as an order.
|
|
403
|
+
|
|
404
|
+
**Resource**: `servicenow://service_catalog/submit_order`
|
|
405
|
+
|
|
406
|
+
**Required Parameters**:
|
|
407
|
+
- `instance_id` (string): ServiceNow instance identifier
|
|
408
|
+
|
|
409
|
+
**Optional Parameters**:
|
|
410
|
+
- `cart_id` (string): sys_id of the cart
|
|
411
|
+
- `requested_for` (string): sys_id of the user the order is for
|
|
412
|
+
|
|
413
|
+
**Example**:
|
|
414
|
+
|
|
415
|
+
```json
|
|
416
|
+
{
|
|
417
|
+
"Resource": "servicenow://service_catalog/submit_order",
|
|
418
|
+
"Parameters": {
|
|
419
|
+
"instance_id": "dev12345",
|
|
420
|
+
"requested_for": "user123"
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
```
|