205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
|
# File 'lib/flapjack/data/tag.rb', line 205
def self.jsonapi_associations
unless instance_variable_defined?('@jsonapi_associations')
@jsonapi_associations = {
:checks => Flapjack::Gateways::JSONAPI::Data::JoinDescriptor.new(
:post => true, :get => true, :patch => true, :delete => true,
:number => :multiple, :link => true, :includable => true,
:descriptions => {
:post => "Associate checks with this tag.",
:get => "Returns all checks linked to this tag.",
:patch => "Update the checks associated with this tag.",
:delete => "Delete associations between checks and this tag."
}
),
:contacts => Flapjack::Gateways::JSONAPI::Data::JoinDescriptor.new(
:post => true, :get => true, :patch => true, :delete => true,
:number => :multiple, :link => true, :includable => true,
:descriptions => {
:post => "Associate contacts with this tag.",
:get => "Returns all contacts linked to this tag.",
:patch => "Update the contacts associated with this tag.",
:delete => "Delete associations between contacts and this tag."
}
),
:rules => Flapjack::Gateways::JSONAPI::Data::JoinDescriptor.new(
:post => true, :get => true, :patch => true, :delete => true,
:number => :multiple, :link => true, :includable => true,
:descriptions => {
:post => "Associate rules with this tag.",
:get => "Returns all rules linked to this tag.",
:patch => "Update the rules associated with this tag.",
:delete => "Delete associations between rules and this tag."
}
),
:scheduled_maintenances => Flapjack::Gateways::JSONAPI::Data::JoinDescriptor.new(
:get => true,
:number => :multiple, :link => true, :includable => false,
:type => 'scheduled_maintenance',
:klass => Flapjack::Data::ScheduledMaintenance,
:descriptions => {
:get => "Returns all scheduled maintenance periods for " \
"checks linked to this tag; default sort order is " \
"newest first."
}
),
:states => Flapjack::Gateways::JSONAPI::Data::JoinDescriptor.new(
:get => true,
:number => :multiple, :link => true, :includable => false,
:type => 'state',
:klass => Flapjack::Data::State,
:descriptions => {
:get => "Returns all state records for all checks linked to " \
"this tag; default sort order is newest first."
}
),
:unscheduled_maintenances => Flapjack::Gateways::JSONAPI::Data::JoinDescriptor.new(
:get => true,
:number => :multiple, :link => true, :includable => false,
:type => 'unscheduled_maintenance',
:klass => Flapjack::Data::UnscheduledMaintenance,
:descriptions => {
:get => "Returns all unscheduled maintenance periods for " \
"checks linked to this tag; default sort order is " \
"newest first."
}
)
}
populate_association_data(@jsonapi_associations)
end
@jsonapi_associations
end
|