Class: MistApi::MSPsSSO

Inherits:
BaseController show all
Defined in:
lib/mist_api/controllers/ms_ps_sso.rb

Overview

MSPsSSO

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent

Constructor Details

This class inherits a constructor from MistApi::BaseController

Instance Method Details

#create_msp_sso(msp_id, body: nil) ⇒ ApiResponse

Create MSP SSO profile here

Parameters:

  • msp_id (UUID | String)

    Required parameter: TODO: type description

  • body (Sso) (defaults to: nil)

    Optional parameter: Request Body

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/mist_api/controllers/ms_ps_sso.rb', line 52

def create_msp_sso(msp_id,
                   body: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/api/v1/msps/{msp_id}/ssos',
                                 Server::API_HOST)
               .template_param(new_parameter(msp_id, key: 'msp_id')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Or.new('apiToken', 'basicAuth', And.new('basicAuth', 'csrfToken'))))
    .response(new_response_handler
                .is_nullify404(true)
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(Sso.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Bad Syntax',
                             APIException)
                .local_error('401',
                             'Unauthorized',
                             APIException)
                .local_error('403',
                             'Permission Denied',
                             APIException)
                .local_error('404',
                             'Not found. The API endpoint doesn’t exist or resource doesn’ t'\
                              ' exist',
                             APIException)
                .local_error('429',
                             'Too Many Request. The API Token used for the request reached'\
                              ' the 5000 API Calls per hour threshold',
                             APIException))
    .execute
end

#delete_msp_sso(msp_id, sso_id) ⇒ ApiResponse

Delete MSP SSO Config here here

Parameters:

  • msp_id (UUID | String)

    Required parameter: TODO: type description

  • sso_id (UUID | String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/mist_api/controllers/ms_ps_sso.rb', line 95

def delete_msp_sso(msp_id,
                   sso_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::DELETE,
                                 '/api/v1/msps/{msp_id}/ssos/{sso_id}',
                                 Server::API_HOST)
               .template_param(new_parameter(msp_id, key: 'msp_id')
                                .should_encode(true))
               .template_param(new_parameter(sso_id, key: 'sso_id')
                                .should_encode(true))
               .auth(Or.new('apiToken', 'basicAuth', And.new('basicAuth', 'csrfToken'))))
    .response(new_response_handler
                .is_nullify404(true)
                .is_response_void(true)
                .is_api_response(true)
                .local_error('400',
                             'Bad Syntax',
                             APIException)
                .local_error('401',
                             'Unauthorized',
                             APIException)
                .local_error('403',
                             'Permission Denied',
                             APIException)
                .local_error('404',
                             'Not found. The API endpoint doesn’t exist or resource doesn’ t'\
                              ' exist',
                             APIException)
                .local_error('429',
                             'Too Many Request. The API Token used for the request reached'\
                              ' the 5000 API Calls per hour threshold',
                             APIException))
    .execute
end

#delete_msp_sso_admins(msp_id, sso_id, body: nil) ⇒ ApiResponse

Delete MSP SSO Admin users by email. This removes SSO-linked admin accounts from the organization. here here

Parameters:

  • msp_id (UUID | String)

    Required parameter: TODO: type description

  • sso_id (UUID | String)

    Required parameter: TODO: type description

  • body (SsoDeleteAdmins) (defaults to: nil)

    Optional parameter: Request Body

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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
# File 'lib/mist_api/controllers/ms_ps_sso.rb', line 227

def delete_msp_sso_admins(msp_id,
                          sso_id,
                          body: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/api/v1/msps/{msp_id}/ssos/{sso_id}/delete_admins',
                                 Server::API_HOST)
               .template_param(new_parameter(msp_id, key: 'msp_id')
                                .should_encode(true))
               .template_param(new_parameter(sso_id, key: 'sso_id')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Or.new('apiToken', 'basicAuth', And.new('basicAuth', 'csrfToken'))))
    .response(new_response_handler
                .is_nullify404(true)
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(SsoDeleteAdminsResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Bad Syntax',
                             APIException)
                .local_error('401',
                             'Unauthorized',
                             APIException)
                .local_error('403',
                             'Permission Denied',
                             APIException)
                .local_error('404',
                             'Not found. The API endpoint doesn’t exist or resource doesn’ t'\
                              ' exist',
                             APIException)
                .local_error('429',
                             'Too Many Request. The API Token used for the request reached'\
                              ' the 5000 API Calls per hour threshold',
                             APIException))
    .execute
end

#download_msp_saml_metadata(msp_id, sso_id) ⇒ ApiResponse

Download MSP SAML Metadata Example of metadata.xml: “‘xml <?xml version=“1.0” encoding=“UTF-8”?><md:EntityDescriptor xmlns:md=“urn:oasis:names:tc:SAML:2.0:metadata” entityID=“api.mist.com/api/v1/saml/5hdF5g/login” validUntil=“2027-10-12T21:59:01Z” xmlns:ds=“www.w3.org/2000/09/xmldsig#”>

<md:SPSSODescriptor AuthnRequestsSigned="false"

WantAssertionsSigned=“true” protocolSupportEnumeration=“urn:oasis:names:tc:SAML:2.0:protocol”>

<md:SingleLogoutService

Binding=“urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST” Location=“api.mist.com/api/v1/saml/5hdF5g/logout” />

<md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</md :NameIDFormat>

<md:AssertionConsumerService

Binding=“urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST” Location=“api.mist.com/api/v1/saml/5hdF5g/login” index=“0” isDefault=“true”/>

<md:AttributeConsumingService index="0">
    <md:ServiceName xml:lang="en-US">Mist</md:ServiceName>
    <md:RequestedAttribute Name="Role"

NameFormat=“urn:oasis:names:tc:SAML:2.0:attrname-format:basic” isRequired=“true”/>

<md:RequestedAttribute Name="FirstName"

NameFormat=“urn:oasis:names:tc:SAML:2.0:attrname-format:basic” isRequired=“false”/>

<md:RequestedAttribute Name="LastName"

NameFormat=“urn:oasis:names:tc:SAML:2.0:attrname-format:basic” isRequired=“false”/>

    </md:AttributeConsumingService>
</md:SPSSODescriptor>

</md:EntityDescriptor> “‘ here here

Parameters:

  • msp_id (UUID | String)

    Required parameter: TODO: type description

  • sso_id (UUID | String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
# File 'lib/mist_api/controllers/ms_ps_sso.rb', line 392

def (msp_id,
                               sso_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/api/v1/msps/{msp_id}/ssos/{sso_id}/metadata.xml',
                                 Server::API_HOST)
               .template_param(new_parameter(msp_id, key: 'msp_id')
                                .should_encode(true))
               .template_param(new_parameter(sso_id, key: 'sso_id')
                                .should_encode(true))
               .auth(Or.new('apiToken', 'basicAuth', And.new('basicAuth', 'csrfToken'))))
    .response(new_response_handler
                .is_nullify404(true)
                .is_api_response(true)
                .local_error('400',
                             'Bad Syntax',
                             APIException)
                .local_error('401',
                             'Unauthorized',
                             APIException)
                .local_error('403',
                             'Permission Denied',
                             APIException)
                .local_error('404',
                             'Not found. The API endpoint doesn’t exist or resource doesn’ t'\
                              ' exist',
                             APIException)
                .local_error('429',
                             'Too Many Request. The API Token used for the request reached'\
                              ' the 5000 API Calls per hour threshold',
                             APIException))
    .execute
end

#get_msp_saml_metadata(msp_id, sso_id) ⇒ ApiResponse

Get MSP SAML Metadata here here

Parameters:

  • msp_id (UUID | String)

    Required parameter: TODO: type description

  • sso_id (UUID | String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/mist_api/controllers/ms_ps_sso.rb', line 315

def (msp_id,
                          sso_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/api/v1/msps/{msp_id}/ssos/{sso_id}/metadata',
                                 Server::API_HOST)
               .template_param(new_parameter(msp_id, key: 'msp_id')
                                .should_encode(true))
               .template_param(new_parameter(sso_id, key: 'sso_id')
                                .should_encode(true))
               .auth(Or.new('apiToken', 'basicAuth', And.new('basicAuth', 'csrfToken'))))
    .response(new_response_handler
                .is_nullify404(true)
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(SamlMetadata.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Bad Syntax',
                             APIException)
                .local_error('401',
                             'Unauthorized',
                             APIException)
                .local_error('403',
                             'Permission Denied',
                             APIException)
                .local_error('404',
                             'Not found. The API endpoint doesn’t exist or resource doesn’ t'\
                              ' exist',
                             APIException)
                .local_error('429',
                             'Too Many Request. The API Token used for the request reached'\
                              ' the 5000 API Calls per hour threshold',
                             APIException))
    .execute
end

#get_msp_sso(msp_id, sso_id) ⇒ ApiResponse

Get MSP SSO Config here here

Parameters:

  • msp_id (UUID | String)

    Required parameter: TODO: type description

  • sso_id (UUID | String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/mist_api/controllers/ms_ps_sso.rb', line 136

def get_msp_sso(msp_id,
                sso_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/api/v1/msps/{msp_id}/ssos/{sso_id}',
                                 Server::API_HOST)
               .template_param(new_parameter(msp_id, key: 'msp_id')
                                .should_encode(true))
               .template_param(new_parameter(sso_id, key: 'sso_id')
                                .should_encode(true))
               .auth(Or.new('apiToken', 'basicAuth', And.new('basicAuth', 'csrfToken'))))
    .response(new_response_handler
                .is_nullify404(true)
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(Sso.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Bad Syntax',
                             APIException)
                .local_error('401',
                             'Unauthorized',
                             APIException)
                .local_error('403',
                             'Permission Denied',
                             APIException)
                .local_error('404',
                             'Not found. The API endpoint doesn’t exist or resource doesn’ t'\
                              ' exist',
                             APIException)
                .local_error('429',
                             'Too Many Request. The API Token used for the request reached'\
                              ' the 5000 API Calls per hour threshold',
                             APIException))
    .execute
end

#list_msp_sso_latest_failures(msp_id, sso_id) ⇒ ApiResponse

Get List of MSP SSO Latest Failures here here

Parameters:

  • msp_id (UUID | String)

    Required parameter: TODO: type description

  • sso_id (UUID | String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
# File 'lib/mist_api/controllers/ms_ps_sso.rb', line 273

def list_msp_sso_latest_failures(msp_id,
                                 sso_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/api/v1/msps/{msp_id}/ssos/{sso_id}/failures',
                                 Server::API_HOST)
               .template_param(new_parameter(msp_id, key: 'msp_id')
                                .should_encode(true))
               .template_param(new_parameter(sso_id, key: 'sso_id')
                                .should_encode(true))
               .auth(Or.new('apiToken', 'basicAuth', And.new('basicAuth', 'csrfToken'))))
    .response(new_response_handler
                .is_nullify404(true)
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(ResponseSsoFailureSearch.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Bad Syntax',
                             APIException)
                .local_error('401',
                             'Unauthorized',
                             APIException)
                .local_error('403',
                             'Permission Denied',
                             APIException)
                .local_error('404',
                             'Not found. The API endpoint doesn’t exist or resource doesn’ t'\
                              ' exist',
                             APIException)
                .local_error('429',
                             'Too Many Request. The API Token used for the request reached'\
                              ' the 5000 API Calls per hour threshold',
                             APIException))
    .execute
end

#list_msp_ssos(msp_id) ⇒ ApiResponse

List MSP SSO Configs here

Parameters:

  • msp_id (UUID | String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/mist_api/controllers/ms_ps_sso.rb', line 13

def list_msp_ssos(msp_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/api/v1/msps/{msp_id}/ssos',
                                 Server::API_HOST)
               .template_param(new_parameter(msp_id, key: 'msp_id')
                                .should_encode(true))
               .auth(Or.new('apiToken', 'basicAuth', And.new('basicAuth', 'csrfToken'))))
    .response(new_response_handler
                .is_nullify404(true)
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(Sso.method(:from_hash))
                .is_api_response(true)
                .is_response_array(true)
                .local_error('400',
                             'Bad Syntax',
                             APIException)
                .local_error('401',
                             'Unauthorized',
                             APIException)
                .local_error('403',
                             'Permission Denied',
                             APIException)
                .local_error('404',
                             'Not found. The API endpoint doesn’t exist or resource doesn’ t'\
                              ' exist',
                             APIException)
                .local_error('429',
                             'Too Many Request. The API Token used for the request reached'\
                              ' the 5000 API Calls per hour threshold',
                             APIException))
    .execute
end

#update_msp_sso(msp_id, sso_id, body: nil) ⇒ ApiResponse

Update MSP SSO config here here

Parameters:

  • msp_id (UUID | String)

    Required parameter: TODO: type description

  • sso_id (UUID | String)

    Required parameter: TODO: type description

  • body (Sso) (defaults to: nil)

    Optional parameter: Request Body

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/mist_api/controllers/ms_ps_sso.rb', line 179

def update_msp_sso(msp_id,
                   sso_id,
                   body: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/api/v1/msps/{msp_id}/ssos/{sso_id}',
                                 Server::API_HOST)
               .template_param(new_parameter(msp_id, key: 'msp_id')
                                .should_encode(true))
               .template_param(new_parameter(sso_id, key: 'sso_id')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Or.new('apiToken', 'basicAuth', And.new('basicAuth', 'csrfToken'))))
    .response(new_response_handler
                .is_nullify404(true)
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(Sso.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Bad Syntax',
                             APIException)
                .local_error('401',
                             'Unauthorized',
                             APIException)
                .local_error('403',
                             'Permission Denied',
                             APIException)
                .local_error('404',
                             'Not found. The API endpoint doesn’t exist or resource doesn’ t'\
                              ' exist',
                             APIException)
                .local_error('429',
                             'Too Many Request. The API Token used for the request reached'\
                              ' the 5000 API Calls per hour threshold',
                             APIException))
    .execute
end