Skip to content

Commit 8f0913a

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 4ed5a14 commit 8f0913a

File tree

2 files changed

+182
-8
lines changed

2 files changed

+182
-8
lines changed
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

src/data/endpoints/managed.yaml

Lines changed: 90 additions & 8 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
@@ -81,16 +80,99 @@ endpoints:
8180
"group": "Developers"
8281
}' \
8382
https://$api_root/$version/account/oauth-clients/$client_id
84-
/managed/history:
85-
group: History
83+
#/managed/history:
84+
# group: History
85+
# type: resource
86+
# description: >
87+
# A list of the issues created from monitoring your Services.
88+
# methods:
89+
# GET:
90+
# response: ManagedHistory
91+
# description: >
92+
# Returns your managed service issue history list.
93+
# examples:
94+
# curl: |
95+
# curl -H "Authorization: Bearer $TOKEN" \
96+
# https://$api_root/$version/managed/history
97+
/managed/services:
98+
group: Services
8699
type: resource
87100
description: >
88-
A list of the issues created from monitoring your Services.
101+
A list of the service monitors your account may access.
89102
methods:
90103
GET:
91-
response: ManagedHistory
104+
response: ManagedService
92105
description: >
93-
Returns your managed service issue history list.
106+
Returns your managed services list.
94107
examples:
95108
curl: |
96-
curl https://$api_root/$version/managed/history
109+
curl https://$api_root/$version/managed/services
110+
POST:
111+
description: >
112+
Registers a new service to monitor.
113+
params:
114+
label:
115+
description: A unique label for the service.
116+
type: String
117+
limit: 3-64 characters
118+
service_type:
119+
description: Which service type being used.
120+
type: String
121+
value: url
122+
address:
123+
description: The URL to request. If service_type is TCP, must include port number. For example, tcp://monitor.example.org:23
124+
type: String
125+
value: https://monitor.example.org
126+
timeout:
127+
description: Response must be received before this timeout or an alert will be triggered.
128+
value: 30
129+
limit: 1-255
130+
body:
131+
description: Response must contain this string or an alert will be triggered.
132+
type: String
133+
value: Success!
134+
limit: 0-100 chracters
135+
consultation_group:
136+
description: If we need help along the way, we'll contact someone from this group.
137+
value: Support
138+
limit: 0-50 characters
139+
region:
140+
description: Required if address is a private IP, otherwise not used.
141+
type: String
142+
value: us-east-1a
143+
notes:
144+
description: We'll refer to these instructions when responding to a service-related issue.
145+
type: String
146+
value: If the Linode needs to be rebooted, please contact us first.
147+
limit: 0-1000 characters
148+
examples:
149+
curl: |
150+
curl -H "Content-Type: application/json" \
151+
-H "Authorization: Bearer $TOKEN" \
152+
-X POST -d '{
153+
"label": "NewMonitor",
154+
"service_type": "url",
155+
"address": "https://monitor.example.org",
156+
"timeout": 30,
157+
"consultation_group": "Support",
158+
"region": "us-east-1a",
159+
"body": "Success!",
160+
"notes": "Please contact us if the Linode must be rebooted",
161+
"credentials": 12345,23456,34567
162+
}' \
163+
https://$api_root/$version/managed/contacts
164+
/managed/services/$id:
165+
group: Services
166+
type: resource
167+
authenticated: true
168+
description: >
169+
Manage a particular Managed service your account may access.
170+
methods:
171+
GET:
172+
response: ManagedService
173+
description: >
174+
Returns information about this service.
175+
examples:
176+
curl: |
177+
curl -H "Authorization: Bearer $TOKEN" \
178+
https://$api_root/$version/managed/services/$service_id

0 commit comments

Comments
 (0)