solarwinds-itsm-api-definitions 0.1.3 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Redocly/development.html +126 -0
- data/Redocly/index.html +126 -0
- data/Redocly/redoc/favicon.ico +0 -0
- data/Redocly/redoc/schema/resolved_schema.json +1 -0
- data/lib/definitions/common/components.json +270 -58
- data/lib/definitions/common/examples/catalog_item.json +70 -0
- data/lib/definitions/common/examples/change.json +127 -0
- data/lib/definitions/common/examples/change_catalog.json +92 -0
- data/lib/definitions/common/examples/configuration_item.json +108 -0
- data/lib/definitions/common/examples/hardware.json +125 -0
- data/lib/definitions/common/examples/incident.json +134 -109
- data/lib/definitions/common/examples/problem.json +126 -102
- data/lib/definitions/common/examples/release.json +150 -0
- data/lib/definitions/common/examples/service_request.json +28 -0
- data/lib/definitions/common/examples/solution.json +49 -0
- data/lib/definitions/common/examples/user.json +100 -70
- data/lib/definitions/common/schemas/analytics/audit.json +28 -0
- data/lib/definitions/common/schemas/analytics/risk.json +28 -0
- data/lib/definitions/common/schemas/inventory/hardware.json +104 -0
- data/lib/definitions/common/schemas/inventory/mobile.json +73 -0
- data/lib/definitions/common/schemas/inventory/other_asset.json +74 -0
- data/lib/definitions/common/schemas/inventory/printer.json +41 -0
- data/lib/definitions/common/schemas/inventory/software.json +28 -0
- data/lib/definitions/common/schemas/inventory/warranty.json +40 -0
- data/lib/definitions/common/schemas/procurement/contract.json +67 -0
- data/lib/definitions/common/schemas/procurement/item.json +51 -0
- data/lib/definitions/common/schemas/procurement/purchase.json +57 -0
- data/lib/definitions/common/schemas/procurement/purchase_order.json +85 -0
- data/lib/definitions/common/schemas/procurement/vendor.json +67 -0
- data/lib/definitions/common/schemas/service_desk/catalog_item.json +71 -0
- data/lib/definitions/common/schemas/service_desk/change.json +88 -0
- data/lib/definitions/common/schemas/service_desk/change_catalog.json +77 -0
- data/lib/definitions/common/schemas/service_desk/comment.json +52 -0
- data/lib/definitions/common/schemas/service_desk/configuration_item.json +117 -0
- data/lib/definitions/common/schemas/service_desk/incident.json +99 -0
- data/lib/definitions/common/schemas/service_desk/problem.json +81 -0
- data/lib/definitions/common/schemas/service_desk/release.json +86 -0
- data/lib/definitions/common/schemas/service_desk/service_request.json +31 -0
- data/lib/definitions/common/schemas/service_desk/solution.json +61 -0
- data/lib/definitions/common/schemas/service_desk/time_track.json +37 -0
- data/lib/definitions/common/schemas/setup/category.json +54 -0
- data/lib/definitions/common/schemas/setup/department.json +48 -0
- data/lib/definitions/common/schemas/setup/group.json +65 -0
- data/lib/definitions/common/schemas/setup/role.json +51 -0
- data/lib/definitions/common/schemas/setup/site.json +64 -0
- data/lib/definitions/common/schemas/setup/user.json +67 -0
- data/lib/definitions/common/schemas/tasks/task.json +52 -0
- data/lib/definitions/openapi.json +100 -8
- data/lib/definitions/paths/attachments/attachments.json +12 -0
- data/lib/definitions/paths/audits/audits.json +35 -0
- data/lib/definitions/paths/audits/audits_by_id.json +37 -0
- data/lib/definitions/paths/catalog_items/catalog_item_by_id.json +83 -0
- data/lib/definitions/paths/catalog_items/catalog_items.json +69 -0
- data/lib/definitions/paths/categories/categories.json +62 -0
- data/lib/definitions/paths/categories/category_by_id.json +70 -0
- data/lib/definitions/paths/change_catalogs/change_catalog_by_id.json +83 -0
- data/lib/definitions/paths/change_catalogs/change_catalogs.json +69 -0
- data/lib/definitions/paths/changes/change_by_id.json +83 -0
- data/lib/definitions/paths/changes/changes.json +69 -0
- data/lib/definitions/paths/comments/comment_by_id.json +65 -0
- data/lib/definitions/paths/comments/comments.json +31 -0
- data/lib/definitions/paths/configuration_items/append_dependent_assets.json +24 -0
- data/lib/definitions/paths/configuration_items/configuration_item_by_id.json +83 -0
- data/lib/definitions/paths/configuration_items/configuration_items.json +69 -0
- data/lib/definitions/paths/configuration_items/delete_asset_link.json +24 -0
- data/lib/definitions/paths/contracts/contract_by_id.json +74 -0
- data/lib/definitions/paths/contracts/contracts.json +62 -0
- data/lib/definitions/paths/contracts/item_by_id.json +75 -0
- data/lib/definitions/paths/contracts/items.json +30 -0
- data/lib/definitions/paths/departments/department_by_id.json +70 -0
- data/lib/definitions/paths/departments/departments.json +62 -0
- data/lib/definitions/paths/groups/group_by_id.json +70 -0
- data/lib/definitions/paths/groups/groups.json +62 -0
- data/lib/definitions/paths/hardwares/hardware_by_id.json +83 -0
- data/lib/definitions/paths/hardwares/hardwares.json +69 -0
- data/lib/definitions/paths/hardwares/warranties.json +64 -0
- data/lib/definitions/paths/hardwares/warranty_by_id.json +75 -0
- data/lib/definitions/paths/incidents/incident_by_id.json +7 -7
- data/lib/definitions/paths/incidents/incidents.json +10 -10
- data/lib/definitions/paths/memberships/membership_by_id.json +20 -0
- data/lib/definitions/paths/memberships/memberships.json +29 -0
- data/lib/definitions/paths/mobiles/mobile_by_id.json +74 -0
- data/lib/definitions/paths/mobiles/mobiles.json +62 -0
- data/lib/definitions/paths/other_assets/other_asset_by_id.json +74 -0
- data/lib/definitions/paths/other_assets/other_assets.json +62 -0
- data/lib/definitions/paths/printers/printer_by_id.json +53 -0
- data/lib/definitions/paths/printers/printers.json +36 -0
- data/lib/definitions/paths/problems/problem_by_id.json +7 -8
- data/lib/definitions/paths/problems/problems.json +10 -10
- data/lib/definitions/paths/purchase_orders/purchase_order_by_id.json +74 -0
- data/lib/definitions/paths/purchase_orders/purchase_orders.json +62 -0
- data/lib/definitions/paths/purchases/purchase_by_id.json +65 -0
- data/lib/definitions/paths/purchases/purchases.json +31 -0
- data/lib/definitions/paths/releases/release_by_id.json +83 -0
- data/lib/definitions/paths/releases/releases.json +69 -0
- data/lib/definitions/paths/risks/risks.json +34 -0
- data/lib/definitions/paths/roles/role_by_id.json +70 -0
- data/lib/definitions/paths/roles/roles.json +62 -0
- data/lib/definitions/paths/service_requests/request_by_id.json +37 -0
- data/lib/definitions/paths/sites/site_by_id.json +74 -0
- data/lib/definitions/paths/sites/sites.json +62 -0
- data/lib/definitions/paths/softwares/software_by_id.json +24 -0
- data/lib/definitions/paths/softwares/softwares.json +36 -0
- data/lib/definitions/paths/solutions/solution_by_id.json +83 -0
- data/lib/definitions/paths/solutions/solutions.json +69 -0
- data/lib/definitions/paths/tasks/task_by_id.json +65 -0
- data/lib/definitions/paths/tasks/tasks.json +31 -0
- data/lib/definitions/paths/time_tracks/time_track_by_id.json +65 -0
- data/lib/definitions/paths/time_tracks/time_tracks.json +66 -0
- data/lib/definitions/paths/users/user_by_id.json +8 -9
- data/lib/definitions/paths/users/users.json +11 -11
- data/lib/definitions/paths/vendors/vendor_by_id.json +74 -0
- data/lib/definitions/paths/vendors/vendors.json +62 -0
- data/lib/solarwinds/itsm/api/definitions.rb +52 -3
- metadata +104 -6
- data/lib/definitions/common/schemas/incident.json +0 -70
- data/lib/definitions/common/schemas/problem.json +0 -67
- data/lib/definitions/common/schemas/user.json +0 -54
- data/lib/resolved_schema/resolved_schema.json +0 -1
@@ -0,0 +1,66 @@
|
|
1
|
+
{
|
2
|
+
"get": {
|
3
|
+
"operationId": "getTimeTracks",
|
4
|
+
"description": "List of time tracks",
|
5
|
+
"tags": ["Time Track"],
|
6
|
+
"parameters": [
|
7
|
+
{ "$ref": "../../common/components.json#/components/request/parameters/token_param" },
|
8
|
+
{ "$ref": "../../common/components.json#/components/request/parameters/id_param" },
|
9
|
+
{ "$ref": "../../common/components.json#/components/request/parameters/object_param" }
|
10
|
+
],
|
11
|
+
"responses": {
|
12
|
+
"200": {
|
13
|
+
"description": "Object was returned correctly",
|
14
|
+
"content": {
|
15
|
+
"application/json": {
|
16
|
+
"schema": {
|
17
|
+
"description": "List of time tracks",
|
18
|
+
"type": "array",
|
19
|
+
"items": { "$ref": "../../common/schemas/service_desk/time_track.json#/components/schemas/response" }
|
20
|
+
}
|
21
|
+
},
|
22
|
+
"application/xml": {
|
23
|
+
"schema": {
|
24
|
+
"description": "List of time tracks",
|
25
|
+
"type": "array",
|
26
|
+
"xml": { "name": "/", "wrapped": true },
|
27
|
+
"items": { "$ref": "../../common/schemas/service_desk/time_track.json#/components/schemas/response" }
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
31
|
+
},
|
32
|
+
"400": { "description": "Bad request" },
|
33
|
+
"404": { "description": "Not found" },
|
34
|
+
"500": { "description": "Server error" }
|
35
|
+
}
|
36
|
+
},
|
37
|
+
"post": {
|
38
|
+
"operationId": "createTimeTrack",
|
39
|
+
"description": "Create new time track",
|
40
|
+
"tags": ["Time Track"],
|
41
|
+
"parameters": [
|
42
|
+
{ "$ref": "../../common/components.json#/components/request/parameters/token_param" },
|
43
|
+
{ "$ref": "../../common/components.json#/components/request/parameters/id_param" },
|
44
|
+
{ "$ref": "../../common/components.json#/components/request/parameters/object_param" }
|
45
|
+
],
|
46
|
+
"requestBody": {
|
47
|
+
"required": true,
|
48
|
+
"description": "Time track fields to fill",
|
49
|
+
"content": {
|
50
|
+
"application/json": { "schema": { "$ref": "../../common/schemas/service_desk/time_track.json#/components/schemas/request" } },
|
51
|
+
"application/xml": { "schema": { "$ref": "../../common/schemas/service_desk/time_track.json#/components/schemas/request" } }
|
52
|
+
}
|
53
|
+
},
|
54
|
+
"responses": {
|
55
|
+
"200": {
|
56
|
+
"description": "Object created and returned correctly",
|
57
|
+
"content": {
|
58
|
+
"application/json": { "schema": { "$ref": "../../common/schemas/service_desk/time_track.json#/components/schemas/response" } },
|
59
|
+
"application/xml": { "schema": { "$ref": "../../common/schemas/service_desk/time_track.json#/components/schemas/response" } }
|
60
|
+
}
|
61
|
+
},
|
62
|
+
"400": { "description": "Bad request" },
|
63
|
+
"500": { "description": "Server error" }
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
@@ -12,10 +12,10 @@
|
|
12
12
|
"description": "Object was returned correctly",
|
13
13
|
"content": {
|
14
14
|
"application/json": {
|
15
|
-
"schema": { "$ref": "../../common/schemas/user.json#/components/schemas/
|
15
|
+
"schema": { "$ref": "../../common/schemas/setup/user.json#/components/schemas/response" },
|
16
16
|
"example": { "$ref": "../../common/examples/user.json#/examples/response/json" }
|
17
17
|
},
|
18
|
-
"application/xml": { "schema": { "$ref": "../../common/schemas/user.json#/components/schemas/
|
18
|
+
"application/xml": { "schema": { "$ref": "../../common/schemas/setup/user.json#/components/schemas/response" } }
|
19
19
|
}
|
20
20
|
},
|
21
21
|
"400": { "description": "Bad request" },
|
@@ -36,10 +36,10 @@
|
|
36
36
|
"description": "User fields to update",
|
37
37
|
"content": {
|
38
38
|
"application/json": {
|
39
|
-
"schema": { "$ref": "../../common/schemas/user.json#/components/schemas/
|
39
|
+
"schema": { "$ref": "../../common/schemas/setup/user.json#/components/schemas/request/put" },
|
40
40
|
"example": { "$ref": "../../common/examples/user.json#/examples/request/json" }
|
41
41
|
},
|
42
|
-
"application/xml": { "schema": { "$ref": "../../common/schemas/user.json#/components/schemas/
|
42
|
+
"application/xml": { "schema": { "$ref": "../../common/schemas/setup/user.json#/components/schemas/request/put" } }
|
43
43
|
}
|
44
44
|
},
|
45
45
|
"responses": {
|
@@ -47,10 +47,10 @@
|
|
47
47
|
"description": "Object was updated correctly",
|
48
48
|
"content": {
|
49
49
|
"application/json": {
|
50
|
-
"schema": { "$ref": "../../common/schemas/user.json#/components/schemas/
|
50
|
+
"schema": { "$ref": "../../common/schemas/setup/user.json#/components/schemas/response" },
|
51
51
|
"example": { "$ref": "../../common/examples/user.json#/examples/response/json" }
|
52
52
|
},
|
53
|
-
"application/xml": { "schema": { "$ref": "../../common/schemas/user.json#/components/schemas/
|
53
|
+
"application/xml": { "schema": { "$ref": "../../common/schemas/setup/user.json#/components/schemas/response" } }
|
54
54
|
}
|
55
55
|
},
|
56
56
|
"400": { "description": "Bad request" },
|
@@ -68,10 +68,10 @@
|
|
68
68
|
],
|
69
69
|
"responses": {
|
70
70
|
"200": {
|
71
|
-
"description": "
|
71
|
+
"description": "Message regarding a successful operation",
|
72
72
|
"content": {
|
73
73
|
"application/json": {
|
74
|
-
"example": { "messages": { "message": "Deleted user
|
74
|
+
"example": { "messages": { "message": "Deleted user" } }
|
75
75
|
}
|
76
76
|
}
|
77
77
|
},
|
@@ -81,4 +81,3 @@
|
|
81
81
|
}
|
82
82
|
}
|
83
83
|
}
|
84
|
-
|
@@ -7,22 +7,23 @@
|
|
7
7
|
{ "$ref": "../../common/components.json#/components/request/parameters/token_param" }
|
8
8
|
],
|
9
9
|
"responses": {
|
10
|
-
"200": {
|
10
|
+
"200": {
|
11
11
|
"description": "Object was returned correctly",
|
12
12
|
"content": {
|
13
13
|
"application/json": {
|
14
|
-
"schema": {
|
14
|
+
"schema": {
|
15
15
|
"description": "List of users",
|
16
16
|
"type": "array",
|
17
|
-
"items": { "allOf": [{ "$ref": "../../common/schemas/user.json#/components/schemas/
|
17
|
+
"items": { "allOf": [{ "$ref": "../../common/schemas/setup/user.json#/components/schemas/response" }] }
|
18
18
|
},
|
19
19
|
"example": [{ "$ref": "../../common/examples/user.json#/examples/response/json" }]
|
20
20
|
},
|
21
21
|
"application/xml": {
|
22
|
-
"schema": {
|
22
|
+
"schema": {
|
23
23
|
"description": "List of users",
|
24
24
|
"type": "array",
|
25
|
-
"
|
25
|
+
"xml": { "name": "/", "wrapped": true },
|
26
|
+
"items": { "$ref": "../../common/schemas/setup/user.json#/components/schemas/response" }
|
26
27
|
}
|
27
28
|
}
|
28
29
|
}
|
@@ -44,21 +45,21 @@
|
|
44
45
|
"description": "User fields to fill",
|
45
46
|
"content": {
|
46
47
|
"application/json": {
|
47
|
-
"schema": { "$ref": "../../common/schemas/user.json#/components/schemas/
|
48
|
+
"schema": { "$ref": "../../common/schemas/setup/user.json#/components/schemas/request/post" },
|
48
49
|
"example": { "$ref": "../../common/examples/user.json#/examples/request/json" }
|
49
50
|
},
|
50
|
-
"application/xml": { "schema": { "$ref": "../../common/schemas/user.json#/components/schemas/
|
51
|
+
"application/xml": { "schema": { "$ref": "../../common/schemas/setup/user.json#/components/schemas/request/post" } }
|
51
52
|
}
|
52
53
|
},
|
53
54
|
"responses": {
|
54
|
-
"200": {
|
55
|
+
"200": {
|
55
56
|
"description": "Object created and returned correctly",
|
56
57
|
"content": {
|
57
58
|
"application/json": {
|
58
|
-
"schema": { "$ref": "../../common/schemas/user.json#/components/schemas/
|
59
|
+
"schema": { "$ref": "../../common/schemas/setup/user.json#/components/schemas/response" },
|
59
60
|
"example": { "$ref": "../../common/examples/user.json#/examples/response/json" }
|
60
61
|
},
|
61
|
-
"application/xml": { "schema": { "$ref": "../../common/schemas/user.json#/components/schemas/
|
62
|
+
"application/xml": { "schema": { "$ref": "../../common/schemas/setup/user.json#/components/schemas/response" } }
|
62
63
|
}
|
63
64
|
},
|
64
65
|
"400": { "description": "Bad request" },
|
@@ -66,4 +67,3 @@
|
|
66
67
|
}
|
67
68
|
}
|
68
69
|
}
|
69
|
-
|
@@ -0,0 +1,74 @@
|
|
1
|
+
{
|
2
|
+
"get": {
|
3
|
+
"operationId": "getVendorById",
|
4
|
+
"description": "Get vendor",
|
5
|
+
"tags": ["Vendor"],
|
6
|
+
"parameters": [
|
7
|
+
{ "$ref": "../../common/components.json#/components/request/parameters/token_param" },
|
8
|
+
{ "$ref": "../../common/components.json#/components/request/parameters/id_param" }
|
9
|
+
],
|
10
|
+
"responses": {
|
11
|
+
"200": {
|
12
|
+
"description": "Object was returned correctly",
|
13
|
+
"content": {
|
14
|
+
"application/json": { "schema": { "$ref": "../../common/schemas/procurement/vendor.json#/components/schemas/response" } },
|
15
|
+
"application/xml": { "schema": { "$ref": "../../common/schemas/procurement/vendor.json#/components/schemas/response" } }
|
16
|
+
}
|
17
|
+
},
|
18
|
+
"400": { "description": "Bad request" },
|
19
|
+
"404": { "description": "Not found" },
|
20
|
+
"500": { "description": "Internal Server Error" }
|
21
|
+
}
|
22
|
+
},
|
23
|
+
"put": {
|
24
|
+
"operationId": "updateVendorById",
|
25
|
+
"description": "Update vendor with specified fields",
|
26
|
+
"tags": ["Vendor"],
|
27
|
+
"parameters": [
|
28
|
+
{ "$ref": "../../common/components.json#/components/request/parameters/token_param" },
|
29
|
+
{ "$ref": "../../common/components.json#/components/request/parameters/id_param" }
|
30
|
+
],
|
31
|
+
"requestBody": {
|
32
|
+
"required": true,
|
33
|
+
"description": "Vendor fields to update",
|
34
|
+
"content": {
|
35
|
+
"application/json": { "schema": { "$ref": "../../common/schemas/procurement/vendor.json#/components/schemas/request/put" } },
|
36
|
+
"application/xml": { "schema": { "$ref": "../../common/schemas/procurement/vendor.json#/components/schemas/request/put" } }
|
37
|
+
}
|
38
|
+
},
|
39
|
+
"responses": {
|
40
|
+
"200": {
|
41
|
+
"description": "Object was updated correctly",
|
42
|
+
"content": {
|
43
|
+
"application/json": { "schema": { "$ref": "../../common/schemas/procurement/vendor.json#/components/schemas/response" } },
|
44
|
+
"application/xml": { "schema": { "$ref": "../../common/schemas/procurement/vendor.json#/components/schemas/response" } }
|
45
|
+
}
|
46
|
+
},
|
47
|
+
"400": { "description": "Bad request" },
|
48
|
+
"404": { "description": "Not found" },
|
49
|
+
"500": { "description": "Internal Server Error" }
|
50
|
+
}
|
51
|
+
},
|
52
|
+
"delete": {
|
53
|
+
"operationId": "deleteVendorById",
|
54
|
+
"description": "Delete vendor",
|
55
|
+
"tags": ["Vendor"],
|
56
|
+
"parameters": [
|
57
|
+
{ "$ref": "../../common/components.json#/components/request/parameters/token_param" },
|
58
|
+
{ "$ref": "../../common/components.json#/components/request/parameters/id_param" }
|
59
|
+
],
|
60
|
+
"responses": {
|
61
|
+
"200": {
|
62
|
+
"description": "Returns the deleted vendor's id",
|
63
|
+
"content": {
|
64
|
+
"application/json": {
|
65
|
+
"example": { "deleted_ids": ["1"] }
|
66
|
+
}
|
67
|
+
}
|
68
|
+
},
|
69
|
+
"400": { "description": "Bad request" },
|
70
|
+
"404": { "description": "Not found" },
|
71
|
+
"500": { "description": "Internal Server Error" }
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
{
|
2
|
+
"get": {
|
3
|
+
"operationId": "getVendors",
|
4
|
+
"description": "List of vendors",
|
5
|
+
"tags": ["Vendor"],
|
6
|
+
"parameters": [
|
7
|
+
{ "$ref": "../../common/components.json#/components/request/parameters/token_param" }
|
8
|
+
],
|
9
|
+
"responses": {
|
10
|
+
"200": {
|
11
|
+
"description": "Object was returned correctly",
|
12
|
+
"content": {
|
13
|
+
"application/json": {
|
14
|
+
"schema": {
|
15
|
+
"description": "List of vendors",
|
16
|
+
"type": "array",
|
17
|
+
"items": { "$ref": "../../common/schemas/procurement/vendor.json#/components/schemas/response" }
|
18
|
+
}
|
19
|
+
},
|
20
|
+
"application/xml": {
|
21
|
+
"schema": {
|
22
|
+
"description": "List of vendors",
|
23
|
+
"type": "array",
|
24
|
+
"xml": { "name": "/", "wrapped": true },
|
25
|
+
"items": { "$ref": "../../common/schemas/procurement/vendor.json#/components/schemas/response" }
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
},
|
30
|
+
"400": { "description": "Bad request" },
|
31
|
+
"404": { "description": "Not found" },
|
32
|
+
"500": { "description": "Server error" }
|
33
|
+
}
|
34
|
+
},
|
35
|
+
"post": {
|
36
|
+
"operationId": "createVendor",
|
37
|
+
"description": "Create new vendor",
|
38
|
+
"tags": ["Vendor"],
|
39
|
+
"parameters": [
|
40
|
+
{ "$ref": "../../common/components.json#/components/request/parameters/token_param" }
|
41
|
+
],
|
42
|
+
"requestBody": {
|
43
|
+
"required": true,
|
44
|
+
"description": "Vendor fields to fill",
|
45
|
+
"content": {
|
46
|
+
"application/json": { "schema": { "$ref": "../../common/schemas/procurement/vendor.json#/components/schemas/request/post" } },
|
47
|
+
"application/xml": { "schema": { "$ref": "../../common/schemas/procurement/vendor.json#/components/schemas/request/post" } }
|
48
|
+
}
|
49
|
+
},
|
50
|
+
"responses": {
|
51
|
+
"200": {
|
52
|
+
"description": "Object created and returned correctly",
|
53
|
+
"content": {
|
54
|
+
"application/json": { "schema": { "$ref": "../../common/schemas/procurement/vendor.json#/components/schemas/response" } },
|
55
|
+
"application/xml": { "schema": { "$ref": "../../common/schemas/procurement/vendor.json#/components/schemas/response" } }
|
56
|
+
}
|
57
|
+
},
|
58
|
+
"400": { "description": "Bad request" },
|
59
|
+
"500": { "description": "Server error" }
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
@@ -6,7 +6,7 @@ module Solarwinds
|
|
6
6
|
module Api
|
7
7
|
module Definitions
|
8
8
|
LIB_DIR = Pathname.new(File.join(__dir__, '../../..')).cleanpath.to_s
|
9
|
-
|
9
|
+
REDOC_DIR = Pathname.new(File.join(__dir__, '../../../../Redocly/redoc/schema')).cleanpath.to_s
|
10
10
|
|
11
11
|
def self.base_schema
|
12
12
|
path = File.join(LIB_DIR, 'definitions/openapi.json')
|
@@ -18,10 +18,10 @@ module Solarwinds
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.resolved_schema_path
|
21
|
-
File.join(
|
21
|
+
File.join(REDOC_DIR, 'resolved_schema.json')
|
22
22
|
end
|
23
23
|
|
24
|
-
def self.write_resolved_schema(path =
|
24
|
+
def self.write_resolved_schema(path = REDOC_DIR, name = 'resolved_schema.json')
|
25
25
|
File.write(File.join(path, name), resolved_schema.to_json)
|
26
26
|
end
|
27
27
|
|
@@ -31,6 +31,9 @@ module Solarwinds
|
|
31
31
|
return schema unless schema.is_a?(Array) || schema.is_a?(Hash)
|
32
32
|
|
33
33
|
schema.each_with_object({}) do |(key, value), resolved_schema|
|
34
|
+
if key == 'application/xml'
|
35
|
+
value['example'] = generate_xml_example(value, resolved_schema)
|
36
|
+
end
|
34
37
|
if key == '$ref'
|
35
38
|
reference = [*value].each_with_object({}) do |referred_path, result|
|
36
39
|
split_path = referred_path.split('#/')
|
@@ -53,6 +56,52 @@ module Solarwinds
|
|
53
56
|
end
|
54
57
|
end
|
55
58
|
end
|
59
|
+
|
60
|
+
def self.generate_xml_example(value, resolved_schema)
|
61
|
+
if value['schema']['type'] == 'array'
|
62
|
+
items = resolved_schema['application/json']['schema']['items']
|
63
|
+
properties = (items['allOf'] && items['allOf'][0]['properties']) || items['properties']
|
64
|
+
return "<>\n\t#{recursive_xml_properties(properties, 1)}\n<>"
|
65
|
+
end
|
66
|
+
|
67
|
+
properties = resolved_schema['application/json']['schema']['properties']
|
68
|
+
recursive_xml_properties(properties)
|
69
|
+
end
|
70
|
+
|
71
|
+
def self.recursive_xml_properties(properties, levels = 0)
|
72
|
+
return unless properties
|
73
|
+
|
74
|
+
xml_example = ''
|
75
|
+
tabs = tabs_count(levels)
|
76
|
+
|
77
|
+
properties.each do |k, val|
|
78
|
+
value_example = case val['type']
|
79
|
+
when 'object'
|
80
|
+
items = val['oneOf'] || val['anyOf']
|
81
|
+
properties = items && items.first['properties'] || val['properties']
|
82
|
+
"\n\t#{tabs}#{recursive_xml_properties(properties, levels + 1)}"
|
83
|
+
when 'string'
|
84
|
+
val['example'] || 'string example'
|
85
|
+
when 'integer'
|
86
|
+
val['example'] || '1'
|
87
|
+
when 'boolean'
|
88
|
+
val['example'] || 'true'
|
89
|
+
else
|
90
|
+
types_array = val['anyOf'] || val['oneOf']
|
91
|
+
next unless types_array
|
92
|
+
types_array.first['example'] || '1'
|
93
|
+
end
|
94
|
+
|
95
|
+
xml_example = "#{xml_example}<#{k}>#{value_example}</#{k}>\n#{tabs}"
|
96
|
+
end
|
97
|
+
xml_example.chop
|
98
|
+
end
|
99
|
+
|
100
|
+
def self.tabs_count(levels)
|
101
|
+
tabs = ''
|
102
|
+
levels.times { tabs = "#{tabs}\t" }
|
103
|
+
tabs
|
104
|
+
end
|
56
105
|
end
|
57
106
|
end
|
58
107
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solarwinds-itsm-api-definitions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Goldstein
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2021-05-11 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: SolarWinds ITSM OpenAPI definitions gem
|
16
16
|
email:
|
@@ -20,21 +20,119 @@ executables: []
|
|
20
20
|
extensions: []
|
21
21
|
extra_rdoc_files: []
|
22
22
|
files:
|
23
|
+
- Redocly/development.html
|
24
|
+
- Redocly/index.html
|
25
|
+
- Redocly/redoc/favicon.ico
|
26
|
+
- Redocly/redoc/schema/resolved_schema.json
|
23
27
|
- lib/definitions/common/components.json
|
28
|
+
- lib/definitions/common/examples/catalog_item.json
|
29
|
+
- lib/definitions/common/examples/change.json
|
30
|
+
- lib/definitions/common/examples/change_catalog.json
|
31
|
+
- lib/definitions/common/examples/configuration_item.json
|
32
|
+
- lib/definitions/common/examples/hardware.json
|
24
33
|
- lib/definitions/common/examples/incident.json
|
25
34
|
- lib/definitions/common/examples/problem.json
|
35
|
+
- lib/definitions/common/examples/release.json
|
36
|
+
- lib/definitions/common/examples/service_request.json
|
37
|
+
- lib/definitions/common/examples/solution.json
|
26
38
|
- lib/definitions/common/examples/user.json
|
27
|
-
- lib/definitions/common/schemas/
|
28
|
-
- lib/definitions/common/schemas/
|
29
|
-
- lib/definitions/common/schemas/
|
39
|
+
- lib/definitions/common/schemas/analytics/audit.json
|
40
|
+
- lib/definitions/common/schemas/analytics/risk.json
|
41
|
+
- lib/definitions/common/schemas/inventory/hardware.json
|
42
|
+
- lib/definitions/common/schemas/inventory/mobile.json
|
43
|
+
- lib/definitions/common/schemas/inventory/other_asset.json
|
44
|
+
- lib/definitions/common/schemas/inventory/printer.json
|
45
|
+
- lib/definitions/common/schemas/inventory/software.json
|
46
|
+
- lib/definitions/common/schemas/inventory/warranty.json
|
47
|
+
- lib/definitions/common/schemas/procurement/contract.json
|
48
|
+
- lib/definitions/common/schemas/procurement/item.json
|
49
|
+
- lib/definitions/common/schemas/procurement/purchase.json
|
50
|
+
- lib/definitions/common/schemas/procurement/purchase_order.json
|
51
|
+
- lib/definitions/common/schemas/procurement/vendor.json
|
52
|
+
- lib/definitions/common/schemas/service_desk/catalog_item.json
|
53
|
+
- lib/definitions/common/schemas/service_desk/change.json
|
54
|
+
- lib/definitions/common/schemas/service_desk/change_catalog.json
|
55
|
+
- lib/definitions/common/schemas/service_desk/comment.json
|
56
|
+
- lib/definitions/common/schemas/service_desk/configuration_item.json
|
57
|
+
- lib/definitions/common/schemas/service_desk/incident.json
|
58
|
+
- lib/definitions/common/schemas/service_desk/problem.json
|
59
|
+
- lib/definitions/common/schemas/service_desk/release.json
|
60
|
+
- lib/definitions/common/schemas/service_desk/service_request.json
|
61
|
+
- lib/definitions/common/schemas/service_desk/solution.json
|
62
|
+
- lib/definitions/common/schemas/service_desk/time_track.json
|
63
|
+
- lib/definitions/common/schemas/setup/category.json
|
64
|
+
- lib/definitions/common/schemas/setup/department.json
|
65
|
+
- lib/definitions/common/schemas/setup/group.json
|
66
|
+
- lib/definitions/common/schemas/setup/role.json
|
67
|
+
- lib/definitions/common/schemas/setup/site.json
|
68
|
+
- lib/definitions/common/schemas/setup/user.json
|
69
|
+
- lib/definitions/common/schemas/tasks/task.json
|
30
70
|
- lib/definitions/openapi.json
|
71
|
+
- lib/definitions/paths/attachments/attachments.json
|
72
|
+
- lib/definitions/paths/audits/audits.json
|
73
|
+
- lib/definitions/paths/audits/audits_by_id.json
|
74
|
+
- lib/definitions/paths/catalog_items/catalog_item_by_id.json
|
75
|
+
- lib/definitions/paths/catalog_items/catalog_items.json
|
76
|
+
- lib/definitions/paths/categories/categories.json
|
77
|
+
- lib/definitions/paths/categories/category_by_id.json
|
78
|
+
- lib/definitions/paths/change_catalogs/change_catalog_by_id.json
|
79
|
+
- lib/definitions/paths/change_catalogs/change_catalogs.json
|
80
|
+
- lib/definitions/paths/changes/change_by_id.json
|
81
|
+
- lib/definitions/paths/changes/changes.json
|
82
|
+
- lib/definitions/paths/comments/comment_by_id.json
|
83
|
+
- lib/definitions/paths/comments/comments.json
|
84
|
+
- lib/definitions/paths/configuration_items/append_dependent_assets.json
|
85
|
+
- lib/definitions/paths/configuration_items/configuration_item_by_id.json
|
86
|
+
- lib/definitions/paths/configuration_items/configuration_items.json
|
87
|
+
- lib/definitions/paths/configuration_items/delete_asset_link.json
|
88
|
+
- lib/definitions/paths/contracts/contract_by_id.json
|
89
|
+
- lib/definitions/paths/contracts/contracts.json
|
90
|
+
- lib/definitions/paths/contracts/item_by_id.json
|
91
|
+
- lib/definitions/paths/contracts/items.json
|
92
|
+
- lib/definitions/paths/departments/department_by_id.json
|
93
|
+
- lib/definitions/paths/departments/departments.json
|
94
|
+
- lib/definitions/paths/groups/group_by_id.json
|
95
|
+
- lib/definitions/paths/groups/groups.json
|
96
|
+
- lib/definitions/paths/hardwares/hardware_by_id.json
|
97
|
+
- lib/definitions/paths/hardwares/hardwares.json
|
98
|
+
- lib/definitions/paths/hardwares/warranties.json
|
99
|
+
- lib/definitions/paths/hardwares/warranty_by_id.json
|
31
100
|
- lib/definitions/paths/incidents/incident_by_id.json
|
32
101
|
- lib/definitions/paths/incidents/incidents.json
|
102
|
+
- lib/definitions/paths/memberships/membership_by_id.json
|
103
|
+
- lib/definitions/paths/memberships/memberships.json
|
104
|
+
- lib/definitions/paths/mobiles/mobile_by_id.json
|
105
|
+
- lib/definitions/paths/mobiles/mobiles.json
|
106
|
+
- lib/definitions/paths/other_assets/other_asset_by_id.json
|
107
|
+
- lib/definitions/paths/other_assets/other_assets.json
|
108
|
+
- lib/definitions/paths/printers/printer_by_id.json
|
109
|
+
- lib/definitions/paths/printers/printers.json
|
33
110
|
- lib/definitions/paths/problems/problem_by_id.json
|
34
111
|
- lib/definitions/paths/problems/problems.json
|
112
|
+
- lib/definitions/paths/purchase_orders/purchase_order_by_id.json
|
113
|
+
- lib/definitions/paths/purchase_orders/purchase_orders.json
|
114
|
+
- lib/definitions/paths/purchases/purchase_by_id.json
|
115
|
+
- lib/definitions/paths/purchases/purchases.json
|
116
|
+
- lib/definitions/paths/releases/release_by_id.json
|
117
|
+
- lib/definitions/paths/releases/releases.json
|
118
|
+
- lib/definitions/paths/risks/risks.json
|
119
|
+
- lib/definitions/paths/roles/role_by_id.json
|
120
|
+
- lib/definitions/paths/roles/roles.json
|
121
|
+
- lib/definitions/paths/service_requests/request_by_id.json
|
122
|
+
- lib/definitions/paths/sites/site_by_id.json
|
123
|
+
- lib/definitions/paths/sites/sites.json
|
124
|
+
- lib/definitions/paths/softwares/software_by_id.json
|
125
|
+
- lib/definitions/paths/softwares/softwares.json
|
126
|
+
- lib/definitions/paths/solutions/solution_by_id.json
|
127
|
+
- lib/definitions/paths/solutions/solutions.json
|
128
|
+
- lib/definitions/paths/tasks/task_by_id.json
|
129
|
+
- lib/definitions/paths/tasks/tasks.json
|
130
|
+
- lib/definitions/paths/time_tracks/time_track_by_id.json
|
131
|
+
- lib/definitions/paths/time_tracks/time_tracks.json
|
35
132
|
- lib/definitions/paths/users/user_by_id.json
|
36
133
|
- lib/definitions/paths/users/users.json
|
37
|
-
- lib/
|
134
|
+
- lib/definitions/paths/vendors/vendor_by_id.json
|
135
|
+
- lib/definitions/paths/vendors/vendors.json
|
38
136
|
- lib/solarwinds/itsm/api/definitions.rb
|
39
137
|
homepage: https://rubygems.org/gems/solarwinds-itsm-api-definitions
|
40
138
|
licenses:
|