Skip to content

Commit cd199f5

Browse files
Josh SagerDorthu
authored andcommitted
Added managed service object and endpoints
Also commented out history, which will be replaced with issues but not in this iteration release Also commented out credentials, and should be uncommented for ARB-301
1 parent 4803f76 commit cd199f5

File tree

2 files changed

+182
-9
lines changed

2 files changed

+182
-9
lines changed

docs/src/data/endpoints/managed.yaml

Lines changed: 90 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ endpoints:
2424
name:
2525
description: The contact's full name.
2626
type: String
27-
limit: "1-64 characters"
27+
limit: 1-64 characters
2828
email:
2929
description: The email address for the contact.
3030
type: String
@@ -49,7 +49,6 @@ endpoints:
4949
"group": "Support",
5050
}' \
5151
https://$api_root/$version/managed/contacts
52-
5352
/managed/contacts/$id:
5453
group: Contacts
5554
type: resource
@@ -80,17 +79,99 @@ endpoints:
8079
"group": "Developers"
8180
}' \
8281
https://$api_root/$version/account/oauth-clients/$client_id
83-
/managed/history:
84-
group: History
82+
#/managed/history:
83+
# group: History
84+
# type: resource
85+
# description: >
86+
# A list of the issues created from monitoring your Services.
87+
# methods:
88+
# GET:
89+
# response: ManagedHistory
90+
# description: >
91+
# Returns your managed service issue history list.
92+
# examples:
93+
# curl: |
94+
# curl -H "Authorization: Bearer $TOKEN" \
95+
# https://$api_root/$version/managed/history
96+
/managed/services:
97+
group: Services
8598
type: resource
8699
description: >
87-
A list of the issues created from monitoring your Services.
100+
A list of the service monitors your account may access.
88101
methods:
89102
GET:
90-
response: ManagedHistory
103+
response: ManagedService
91104
description: >
92-
Returns your managed service issue history list.
105+
Returns your managed services list.
93106
examples:
94107
curl: |
95-
curl https://$api_root/$version/managed/history
96-
108+
curl https://$api_root/$version/managed/services
109+
POST:
110+
description: >
111+
Registers a new service to monitor.
112+
params:
113+
label:
114+
description: A unique label for the service.
115+
type: String
116+
limit: 3-64 characters
117+
service_type:
118+
description: Which service type being used.
119+
type: String
120+
value: url
121+
address:
122+
description: The URL to request. If service_type is TCP, must include port number. For example, tcp://monitor.example.org:23
123+
type: String
124+
value: https://monitor.example.org
125+
timeout:
126+
description: Response must be received before this timeout or an alert will be triggered.
127+
value: 30
128+
limit: 1-255
129+
body:
130+
description: Response must contain this string or an alert will be triggered.
131+
type: String
132+
value: Success!
133+
limit: 0-100 chracters
134+
consultation_group:
135+
description: If we need help along the way, we'll contact someone from this group.
136+
value: Support
137+
limit: 0-50 characters
138+
region:
139+
description: Required if address is a private IP, otherwise not used.
140+
type: String
141+
value: us-east-1a
142+
notes:
143+
description: We'll refer to these instructions when responding to a service-related issue.
144+
type: String
145+
value: If the Linode needs to be rebooted, please contact us first.
146+
limit: 0-1000 characters
147+
examples:
148+
curl: |
149+
curl -H "Content-Type: application/json" \
150+
-H "Authorization: Bearer $TOKEN" \
151+
-X POST -d '{
152+
"label": "NewMonitor",
153+
"service_type": "url",
154+
"address": "https://monitor.example.org",
155+
"timeout": 30,
156+
"consultation_group": "Support",
157+
"region": "us-east-1a",
158+
"body": "Success!",
159+
"notes": "Please contact us if the Linode must be rebooted",
160+
"credentials": 12345,23456,34567
161+
}' \
162+
https://$api_root/$version/managed/contacts
163+
/managed/services/$id:
164+
group: Services
165+
type: resource
166+
authenticated: true
167+
description: >
168+
Manage a particular Managed service your account may access.
169+
methods:
170+
GET:
171+
response: ManagedService
172+
description: >
173+
Returns information about this service.
174+
examples:
175+
curl: |
176+
curl -H "Authorization: Bearer $TOKEN" \
177+
https://$api_root/$version/managed/services/$service_id
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# vim: set et ts=2 sw=2 tw=80 :
2+
name: ManagedService
3+
prefix: managed/services
4+
description: >
5+
Managed Service objects describe monitoring services set up for your Linodes.
6+
schema:
7+
created:
8+
type: Datetime
9+
value: 2017-10-31T11:12:21
10+
updated:
11+
type: Datetime
12+
value: 2017-10-31T11:15:21
13+
service_type:
14+
type: Enum
15+
subtype: ManagedServiceType
16+
value: "url"
17+
description: >
18+
Defaults to HTTP in URL mode, TCP in TCP mode.
19+
label:
20+
type: String
21+
editable: true
22+
optional: false
23+
value: MonitorLabel
24+
description: >
25+
Unique label describing the service.
26+
timeout:
27+
type: Integer
28+
editable: true
29+
optional: false
30+
value: 30
31+
description: >
32+
Response must be received before this timeout or an alert will be triggered.
33+
address:
34+
type: String
35+
optional: false
36+
editable: true
37+
value: https://monitor.example.org/
38+
description: >
39+
The URL to request. If service_type is TCP, must include port number. For
40+
example, tcp://monitor.example.org:23
41+
body:
42+
type: String
43+
optional: true
44+
value: Success!
45+
editable: true
46+
description: >
47+
Response must contain this string or an alert will be triggered.
48+
consultation_group:
49+
type: String
50+
optional: true
51+
editable: true
52+
value: Support
53+
description: >
54+
If we need help along the way, we'll contact someone from this group.
55+
notes:
56+
type: String
57+
optional: true
58+
editable: true
59+
description: >
60+
We'll refer to these instructions when responding to a service-related issue.
61+
value: If the Linode needs to be rebooted, please contact us first.
62+
region:
63+
type: String
64+
optional: true
65+
editable: true
66+
description: >
67+
If the address is a private IP, you must use the region (as a slug) for the service being monitored. Otherwise, do not use.
68+
# TODO - uncomment in ARB-301
69+
#credentials:
70+
# type: String
71+
# isArray: true
72+
# subtype: integer
73+
# filterable: true
74+
# value: 12345,23456,34567
75+
# optional: true
76+
# description: >
77+
# An array of credentials associated with this service.
78+
enums:
79+
ManagedServiceStatus:
80+
new: A newly-created Service.
81+
active: An active Service to monitor.
82+
disabled: A disabled Service to monitor.
83+
ManagedServiceType:
84+
url: Monitor via HTTP or HTTPS.
85+
tcp: Monitor a port via TCP.
86+
ManagedServiceMethod:
87+
get: Monitor a specific URL/port via GET.
88+
post: Monitor a specific URL/port via POST.
89+
ManagedServiceProtocol:
90+
http: HTTP
91+
https: HTTPS
92+
tcp: TCP

0 commit comments

Comments
 (0)