Class: Verizon::ServiceEndpointsController

Inherits:
BaseController show all
Defined in:
lib/verizon/controllers/service_endpoints_controller.rb

Overview

ServiceEndpointsController

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_api_call_builder, #new_parameter, #new_request_builder, #new_response_handler, user_agent

Constructor Details

This class inherits a constructor from Verizon::BaseController

Instance Method Details

#deregister_service_endpoint(service_endpoints_id) ⇒ DeregisterServiceEndpointResult

Deregister an application’s Service Endpoint from the MEC Platform(s). string identifier representing one or more registered Service Endpoints.

Parameters:

  • service_endpoints_id (String)

    Required parameter: A system-defined

Returns:



198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/verizon/controllers/service_endpoints_controller.rb', line 198

def deregister_service_endpoint(service_endpoints_id)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::DELETE,
                                 '/serviceendpoints/{serviceEndpointsId}',
                                 Server::EDGE_DISCOVERY)
               .template_param(new_parameter(service_endpoints_id, key: 'serviceEndpointsId')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('oAuth2')))
    .response(new_response_handler
               .deserializer(APIHelper.method(:custom_type_deserializer))
               .deserialize_into(DeregisterServiceEndpointResult.method(:from_hash))
               .is_api_response(true)
               .local_error('400',
                            'HTTP 400 Bad Request.',
                            EdgeDiscoveryResultException)
               .local_error('401',
                            'HTTP 401 Unauthorized.',
                            EdgeDiscoveryResultException)
               .local_error('default',
                            'HTTP 500 Internal Server Error.',
                            EdgeDiscoveryResultException))
    .execute
end

#get_service_endpoint(service_endpoints_id) ⇒ Array[ResourcesEdgeHostedServiceWithProfileId]

Returns endpoint information for all Service Endpoints registered to a specified serviceEndpointId. string identifier representing one or more registered Service Endpoints.

Parameters:

  • service_endpoints_id (String)

    Required parameter: A system-defined

Returns:



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/verizon/controllers/service_endpoints_controller.rb', line 128

def get_service_endpoint(service_endpoints_id)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/serviceendpoints/{serviceEndpointsId}',
                                 Server::EDGE_DISCOVERY)
               .template_param(new_parameter(service_endpoints_id, key: 'serviceEndpointsId')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('oAuth2')))
    .response(new_response_handler
               .deserializer(APIHelper.method(:custom_type_deserializer))
               .deserialize_into(ResourcesEdgeHostedServiceWithProfileId.method(:from_hash))
               .is_api_response(true)
               .is_response_array(true)
               .local_error('400',
                            'HTTP 400 Bad Request.',
                            EdgeDiscoveryResultException)
               .local_error('401',
                            'HTTP 401 Unauthorized.',
                            EdgeDiscoveryResultException)
               .local_error('default',
                            'HTTP 500 Internal Server Error.',
                            EdgeDiscoveryResultException))
    .execute
end

#list_all_service_endpointsListAllServiceEndpointsResult

Returns a list of all registered service endpoints.

Returns:



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/verizon/controllers/service_endpoints_controller.rb', line 100

def list_all_service_endpoints
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/serviceendpointsall',
                                 Server::EDGE_DISCOVERY)
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('oAuth2')))
    .response(new_response_handler
               .deserializer(APIHelper.method(:custom_type_deserializer))
               .deserialize_into(ListAllServiceEndpointsResult.method(:from_hash))
               .is_api_response(true)
               .local_error('400',
                            'HTTP 400 Bad Request.',
                            EdgeDiscoveryResultException)
               .local_error('401',
                            'HTTP 401 Unauthorized.',
                            EdgeDiscoveryResultException)
               .local_error('default',
                            'HTTP 500 Internal Server Error.',
                            EdgeDiscoveryResultException))
    .execute
end

#list_optimal_service_endpoints(region: nil, subscriber_density: nil, ue_identity_type: nil, ue_identity: nil, service_endpoints_ids: nil) ⇒ ListOptimalServiceEndpointsResult

Returns a list of optimal Service Endpoints that client devices can connect to. Note: If a query is sent with all of the parameters, it will fail with a “400” error. You can search based on the following parameter combinations - Region plus Service Endpoints IDs and Subscriber density (density is optional but recommended), Region plus Service Endpoints IDs and UEIdentity(Including UEIdentity Type) and Service Endpoints IDs plus UEIdentity(Including UEIdentity Type). values are US_WEST_2 and US_EAST_1. 4G/5G subscribers per square kilometer. parameter: Type of User Equipment identifier used in ‘UEIdentity`. User Equipment. The type of identifier is defined by the ’UEIdentityType’ parameter. The`IPAddress`format can be IPv4 or IPv6. string identifier representing one or more registered Service Endpoints.

Parameters:

  • region (String) (defaults to: nil)

    Optional parameter: MEC region name. Current valid

  • subscriber_density (Integer) (defaults to: nil)

    Optional parameter: Minimum number of

  • ue_identity_type (UserEquipmentIdentityTypeEnum) (defaults to: nil)

    Optional

  • ue_identity (String) (defaults to: nil)

    Optional parameter: The identifier value for

  • service_endpoints_ids (String) (defaults to: nil)

    Optional parameter: A system-defined

Returns:



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/verizon/controllers/service_endpoints_controller.rb', line 28

def list_optimal_service_endpoints(region: nil,
                                   subscriber_density: nil,
                                   ue_identity_type: nil,
                                   ue_identity: nil,
                                   service_endpoints_ids: nil)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/serviceendpoints',
                                 Server::EDGE_DISCOVERY)
               .query_param(new_parameter(region, key: 'region'))
               .query_param(new_parameter(subscriber_density, key: 'subscriberDensity'))
               .query_param(new_parameter(ue_identity_type, key: 'UEIdentityType'))
               .query_param(new_parameter(ue_identity, key: 'UEIdentity'))
               .query_param(new_parameter(service_endpoints_ids, key: 'serviceEndpointsIds'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('oAuth2')))
    .response(new_response_handler
               .deserializer(APIHelper.method(:custom_type_deserializer))
               .deserialize_into(ListOptimalServiceEndpointsResult.method(:from_hash))
               .is_api_response(true)
               .local_error('400',
                            'HTTP 400 Bad Request.',
                            EdgeDiscoveryResultException)
               .local_error('401',
                            'HTTP 401 Unauthorized.',
                            EdgeDiscoveryResultException)
               .local_error('default',
                            'HTTP 500 Internal Server Error.',
                            EdgeDiscoveryResultException))
    .execute
end

#register_service_endpoints(body) ⇒ RegisterServiceEndpointResult

Register Service Endpoints of a deployed application to specified MEC Platforms. parameter: An array of Service Endpoint data for a deployed application. The request body passes all of the needed parameters to create a service endpoint. Parameters will be edited here rather than the Parameters section above. The ‘ern`,`applicationServerProviderId`, `applicationId` and `serviceProfileID` parameters are required. Note: Currently, the only valid value for `applicationServerProviderId`is AWS. Also, if you do not know one of the optional values (i.e. URI), you can erase the line from the query by back-spacing over it.

Parameters:

Returns:



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/verizon/controllers/service_endpoints_controller.rb', line 72

def register_service_endpoints(body)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/serviceendpoints',
                                 Server::EDGE_DISCOVERY)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('oAuth2')))
    .response(new_response_handler
               .deserializer(APIHelper.method(:custom_type_deserializer))
               .deserialize_into(RegisterServiceEndpointResult.method(:from_hash))
               .is_api_response(true)
               .local_error('400',
                            'HTTP 400 Bad Request.',
                            EdgeDiscoveryResultException)
               .local_error('401',
                            'HTTP 401 Unauthorized.',
                            EdgeDiscoveryResultException)
               .local_error('default',
                            'HTTP 500 Internal Server Error.',
                            EdgeDiscoveryResultException))
    .execute
end

#update_service_endpoint(service_endpoints_id, body) ⇒ UpdateServiceEndpointResult

Update registered Service Endpoint information. string identifier representing one or more registered Service Endpoints. parameter: Data needed for Service Endpoint information. The request body passes the rest of the needed parameters to create a service endpoint. Parameters other than ‘serviceEndpointsId` will be edited here rather than the Parameters section above. The `ern`,`applicationServerProviderId` and `applicationId` parameters are required. Note: Currently, the only valid value for `applicationServerProviderId`is AWS.

Parameters:

Returns:



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/verizon/controllers/service_endpoints_controller.rb', line 165

def update_service_endpoint(service_endpoints_id,
                            body)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/serviceendpoints/{serviceEndpointsId}',
                                 Server::EDGE_DISCOVERY)
               .template_param(new_parameter(service_endpoints_id, key: 'serviceEndpointsId')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('oAuth2')))
    .response(new_response_handler
               .deserializer(APIHelper.method(:custom_type_deserializer))
               .deserialize_into(UpdateServiceEndpointResult.method(:from_hash))
               .is_api_response(true)
               .local_error('400',
                            'HTTP 400 Bad Request.',
                            EdgeDiscoveryResultException)
               .local_error('401',
                            'HTTP 401 Unauthorized.',
                            EdgeDiscoveryResultException)
               .local_error('default',
                            'HTTP 500 Internal Server Error.',
                            EdgeDiscoveryResultException))
    .execute
end