Fastly/LoggingOpenstackApi.pm untested

filter: Statementstmt 0.0% 0 / 290 Branchbran 0.0% 0 / 142 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 15 Podpod 0.0% 0 / 6 totaltotal 0.0% 0 / 462 CC 72 SCAR 60.0
CC
72
Cov
0%
update_log_openstack
702.0
create_log_openstack
600.0
delete_log_openstack
90.0
CRAP 403.4
1 =begin comment
2  
3 Fastly API
4  
5 Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/)
6  
7 The version of the API Spec document: 1.0.0
8 Contact: oss@fastly.com
9  
10 =end comment
11  
12 =cut
13  
14 #
15 # NOTE: This class is auto generated.
16 # Do not edit the class manually.
17 #
18 package WebService::Fastly::LoggingOpenstackApi;
19  
20 require 5.6.0;
21 use strict;
22 use warnings;
23 use utf8;
24 use Exporter;
25 use Carp qw( croak );
26 use Log::Any qw($log);
27  
28 use WebService::Fastly::ApiClient;
29  
30 use base "Class::Data::Inheritable";
31  
32 __PACKAGE__->mk_classdata('method_documentation' => {});
33  
34 sub new {
35 my $class = shift;
36 my $api_client;
37  
38 if ($_[0] && ref $_[0] && ref $_[0] eq 'WebService::Fastly::ApiClient' ) {
39 $api_client = $_[0];
40 } else {
41 $api_client = WebService::Fastly::ApiClient->new(@_);
42 }
43  
44 bless { api_client => $api_client }, $class;
45  
46 }
47  
48  
49 #
50 # create_log_openstack
51 #
52 # Create an OpenStack log endpoint
53 #
54 # @param string $service_id Alphanumeric string identifying the service. (required)
55 # @param int $version_id Integer identifying a service version. (required)
56 # @param string $name The name for the real-time logging configuration. (optional)
57 # @param string $placement Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. (optional)
58 # @param string $response_condition The name of an existing condition in the configured endpoint, or leave blank to always execute. (optional)
59 # @param string $format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). (optional, default to '%h %l %u %t "%r" %>s %b')
60 # @param string $log_processing_region The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global. (optional, default to 'none')
61 # @param int $format_version The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (optional, default to 2)
62 # @param string $message_type How the message should be formatted. (optional, default to 'blank')
63 # @param string $timestamp_format A timestamp format (optional)
64 # @param string $compression_codec The codec used for compressing your logs. Valid values are `zstd`, `snappy`, and `gzip`. Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error. (optional)
65 # @param int $period How frequently log files are finalized so they can be available for reading (in seconds). (optional, default to 3600)
66 # @param int $gzip_level The level of gzip encoding when sending logs (default `0`, no compression). Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error. (optional, default to 0)
67 # @param string $access_key Your OpenStack account access key. (optional)
68 # @param string $bucket_name The name of your OpenStack container. (optional)
69 # @param string $path The path to upload logs to. (optional, default to 'null')
70 # @param string $public_key A PGP public key that Fastly will use to encrypt your log files before writing them to disk. (optional, default to 'null')
71 # @param string $url Your OpenStack auth url. (optional)
72 # @param string $user The username for your OpenStack account. (optional)
73 {
74 my $params = {
75 'service_id' => {
76 data_type => 'string',
77 description => 'Alphanumeric string identifying the service.',
78 required => '1',
79 },
80 'version_id' => {
81 data_type => 'int',
82 description => 'Integer identifying a service version.',
83 required => '1',
84 },
85 'name' => {
86 data_type => 'string',
87 description => 'The name for the real-time logging configuration.',
88 required => '0',
89 },
90 'placement' => {
91 data_type => 'string',
92 description => 'Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. ',
93 required => '0',
94 },
95 'response_condition' => {
96 data_type => 'string',
97 description => 'The name of an existing condition in the configured endpoint, or leave blank to always execute.',
98 required => '0',
99 },
100 'format' => {
101 data_type => 'string',
102 description => 'A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/).',
103 required => '0',
104 },
105 'log_processing_region' => {
106 data_type => 'string',
107 description => 'The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.',
108 required => '0',
109 },
110 'format_version' => {
111 data_type => 'int',
112 description => 'The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. ',
113 required => '0',
114 },
115 'message_type' => {
116 data_type => 'string',
117 description => 'How the message should be formatted.',
118 required => '0',
119 },
120 'timestamp_format' => {
121 data_type => 'string',
122 description => 'A timestamp format',
123 required => '0',
124 },
125 'compression_codec' => {
126 data_type => 'string',
127 description => 'The codec used for compressing your logs. Valid values are `zstd`, `snappy`, and `gzip`. Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error.',
128 required => '0',
129 },
130 'period' => {
131 data_type => 'int',
132 description => 'How frequently log files are finalized so they can be available for reading (in seconds).',
133 required => '0',
134 },
135 'gzip_level' => {
136 data_type => 'int',
137 description => 'The level of gzip encoding when sending logs (default `0`, no compression). Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error.',
138 required => '0',
139 },
140 'access_key' => {
141 data_type => 'string',
142 description => 'Your OpenStack account access key.',
143 required => '0',
144 },
145 'bucket_name' => {
146 data_type => 'string',
147 description => 'The name of your OpenStack container.',
148 required => '0',
149 },
150 'path' => {
151 data_type => 'string',
152 description => 'The path to upload logs to.',
153 required => '0',
154 },
155 'public_key' => {
156 data_type => 'string',
157 description => 'A PGP public key that Fastly will use to encrypt your log files before writing them to disk.',
158 required => '0',
159 },
160 'url' => {
161 data_type => 'string',
162 description => 'Your OpenStack auth url.',
163 required => '0',
164 },
165 'user' => {
166 data_type => 'string',
167 description => 'The username for your OpenStack account.',
168 required => '0',
169 },
170 };
171 __PACKAGE__->method_documentation->{ 'create_log_openstack' } = {
172 summary => 'Create an OpenStack log endpoint',
173 params => $params,
174 returns => 'LoggingOpenstackResponse',
175 };
176 }
177 # @return LoggingOpenstackResponse
178 #
179 sub create_log_openstack {
180 my ($self, %args) = @_;
181  
182 # verify the required parameter 'service_id' is set
183 unless (exists $args{'service_id'}) {
184 croak("Missing the required parameter 'service_id' when calling create_log_openstack");
185 }
186  
187 # verify the required parameter 'version_id' is set
188 unless (exists $args{'version_id'}) {
189 croak("Missing the required parameter 'version_id' when calling create_log_openstack");
190 }
191  
192 # parse inputs
193 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/openstack';
194  
195 my $_method = 'POST';
196 my $query_params = {};
197 my $header_params = {};
198 my $form_params = {};
199  
200 # 'Accept' and 'Content-Type' header
201 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
202 if ($_header_accept) {
203 $header_params->{'Accept'} = $_header_accept;
204 }
205 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/x-www-form-urlencoded');
206  
207 # path params
208 if ( exists $args{'service_id'}) {
209 my $_base_variable = "{" . "service_id" . "}";
210 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
211 $_resource_path =~ s/$_base_variable/$_base_value/g;
212 }
213  
214 # path params
215 if ( exists $args{'version_id'}) {
216 my $_base_variable = "{" . "version_id" . "}";
217 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
218 $_resource_path =~ s/$_base_variable/$_base_value/g;
219 }
220  
221 # form params
222 if ( exists $args{'name'} ) {
223 $form_params->{'name'} = $self->{api_client}->to_form_value($args{'name'});
224 }
225  
226 # form params
227 if ( exists $args{'placement'} ) {
228 $form_params->{'placement'} = $self->{api_client}->to_form_value($args{'placement'});
229 }
230  
231 # form params
232 if ( exists $args{'response_condition'} ) {
233 $form_params->{'response_condition'} = $self->{api_client}->to_form_value($args{'response_condition'});
234 }
235  
236 # form params
237 if ( exists $args{'format'} ) {
238 $form_params->{'format'} = $self->{api_client}->to_form_value($args{'format'});
239 }
240  
241 # form params
242 if ( exists $args{'log_processing_region'} ) {
243 $form_params->{'log_processing_region'} = $self->{api_client}->to_form_value($args{'log_processing_region'});
244 }
245  
246 # form params
247 if ( exists $args{'format_version'} ) {
248 $form_params->{'format_version'} = $self->{api_client}->to_form_value($args{'format_version'});
249 }
250  
251 # form params
252 if ( exists $args{'message_type'} ) {
253 $form_params->{'message_type'} = $self->{api_client}->to_form_value($args{'message_type'});
254 }
255  
256 # form params
257 if ( exists $args{'timestamp_format'} ) {
258 $form_params->{'timestamp_format'} = $self->{api_client}->to_form_value($args{'timestamp_format'});
259 }
260  
261 # form params
262 if ( exists $args{'compression_codec'} ) {
263 $form_params->{'compression_codec'} = $self->{api_client}->to_form_value($args{'compression_codec'});
264 }
265  
266 # form params
267 if ( exists $args{'period'} ) {
268 $form_params->{'period'} = $self->{api_client}->to_form_value($args{'period'});
269 }
270  
271 # form params
272 if ( exists $args{'gzip_level'} ) {
273 $form_params->{'gzip_level'} = $self->{api_client}->to_form_value($args{'gzip_level'});
274 }
275  
276 # form params
277 if ( exists $args{'access_key'} ) {
278 $form_params->{'access_key'} = $self->{api_client}->to_form_value($args{'access_key'});
279 }
280  
281 # form params
282 if ( exists $args{'bucket_name'} ) {
283 $form_params->{'bucket_name'} = $self->{api_client}->to_form_value($args{'bucket_name'});
284 }
285  
286 # form params
287 if ( exists $args{'path'} ) {
288 $form_params->{'path'} = $self->{api_client}->to_form_value($args{'path'});
289 }
290  
291 # form params
292 if ( exists $args{'public_key'} ) {
293 $form_params->{'public_key'} = $self->{api_client}->to_form_value($args{'public_key'});
294 }
295  
296 # form params
297 if ( exists $args{'url'} ) {
298 $form_params->{'url'} = $self->{api_client}->to_form_value($args{'url'});
299 }
300  
301 # form params
302 if ( exists $args{'user'} ) {
303 $form_params->{'user'} = $self->{api_client}->to_form_value($args{'user'});
304 }
305  
306 my $_body_data;
307 # authentication setting, if any
308 my $auth_settings = [qw(token )];
309  
310 # make the API Call
311 my $response = $self->{api_client}->call_api($_resource_path, $_method,
312 $query_params, $form_params,
313 $header_params, $_body_data, $auth_settings);
314 if (!$response) {
315 return;
316 }
317 my $_response_object = $self->{api_client}->deserialize('LoggingOpenstackResponse', $response);
318 return $_response_object;
319 }
320  
321 #
322 # delete_log_openstack
323 #
324 # Delete an OpenStack log endpoint
325 #
326 # @param string $service_id Alphanumeric string identifying the service. (required)
327 # @param int $version_id Integer identifying a service version. (required)
328 # @param string $logging_openstack_name The name for the real-time logging configuration. (required)
329 {
330 my $params = {
331 'service_id' => {
332 data_type => 'string',
333 description => 'Alphanumeric string identifying the service.',
334 required => '1',
335 },
336 'version_id' => {
337 data_type => 'int',
338 description => 'Integer identifying a service version.',
339 required => '1',
340 },
341 'logging_openstack_name' => {
342 data_type => 'string',
343 description => 'The name for the real-time logging configuration.',
344 required => '1',
345 },
346 };
347 __PACKAGE__->method_documentation->{ 'delete_log_openstack' } = {
348 summary => 'Delete an OpenStack log endpoint',
349 params => $params,
350 returns => 'InlineResponse200',
351 };
352 }
353 # @return InlineResponse200
354 #
355 sub delete_log_openstack {
356 my ($self, %args) = @_;
357  
358 # verify the required parameter 'service_id' is set
359 unless (exists $args{'service_id'}) {
360 croak("Missing the required parameter 'service_id' when calling delete_log_openstack");
361 }
362  
363 # verify the required parameter 'version_id' is set
364 unless (exists $args{'version_id'}) {
365 croak("Missing the required parameter 'version_id' when calling delete_log_openstack");
366 }
367  
368 # verify the required parameter 'logging_openstack_name' is set
369 unless (exists $args{'logging_openstack_name'}) {
370 croak("Missing the required parameter 'logging_openstack_name' when calling delete_log_openstack");
371 }
372  
373 # parse inputs
374 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/openstack/{logging_openstack_name}';
375  
376 my $_method = 'DELETE';
377 my $query_params = {};
378 my $header_params = {};
379 my $form_params = {};
380  
381 # 'Accept' and 'Content-Type' header
382 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
383 if ($_header_accept) {
384 $header_params->{'Accept'} = $_header_accept;
385 }
386 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
387  
388 # path params
389 if ( exists $args{'service_id'}) {
390 my $_base_variable = "{" . "service_id" . "}";
391 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
392 $_resource_path =~ s/$_base_variable/$_base_value/g;
393 }
394  
395 # path params
396 if ( exists $args{'version_id'}) {
397 my $_base_variable = "{" . "version_id" . "}";
398 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
399 $_resource_path =~ s/$_base_variable/$_base_value/g;
400 }
401  
402 # path params
403 if ( exists $args{'logging_openstack_name'}) {
404 my $_base_variable = "{" . "logging_openstack_name" . "}";
405 my $_base_value = $self->{api_client}->to_path_value($args{'logging_openstack_name'});
406 $_resource_path =~ s/$_base_variable/$_base_value/g;
407 }
408  
409 my $_body_data;
410 # authentication setting, if any
411 my $auth_settings = [qw(token )];
412  
413 # make the API Call
414 my $response = $self->{api_client}->call_api($_resource_path, $_method,
415 $query_params, $form_params,
416 $header_params, $_body_data, $auth_settings);
417 if (!$response) {
418 return;
419 }
420 my $_response_object = $self->{api_client}->deserialize('InlineResponse200', $response);
421 return $_response_object;
422 }
423  
424 #
425 # get_log_openstack
426 #
427 # Get an OpenStack log endpoint
428 #
429 # @param string $service_id Alphanumeric string identifying the service. (required)
430 # @param int $version_id Integer identifying a service version. (required)
431 # @param string $logging_openstack_name The name for the real-time logging configuration. (required)
432 {
433 my $params = {
434 'service_id' => {
435 data_type => 'string',
436 description => 'Alphanumeric string identifying the service.',
437 required => '1',
438 },
439 'version_id' => {
440 data_type => 'int',
441 description => 'Integer identifying a service version.',
442 required => '1',
443 },
444 'logging_openstack_name' => {
445 data_type => 'string',
446 description => 'The name for the real-time logging configuration.',
447 required => '1',
448 },
449 };
450 __PACKAGE__->method_documentation->{ 'get_log_openstack' } = {
451 summary => 'Get an OpenStack log endpoint',
452 params => $params,
453 returns => 'LoggingOpenstackResponse',
454 };
455 }
456 # @return LoggingOpenstackResponse
457 #
458 sub get_log_openstack {
459 my ($self, %args) = @_;
460  
461 # verify the required parameter 'service_id' is set
462 unless (exists $args{'service_id'}) {
463 croak("Missing the required parameter 'service_id' when calling get_log_openstack");
464 }
465  
466 # verify the required parameter 'version_id' is set
467 unless (exists $args{'version_id'}) {
468 croak("Missing the required parameter 'version_id' when calling get_log_openstack");
469 }
470  
471 # verify the required parameter 'logging_openstack_name' is set
472 unless (exists $args{'logging_openstack_name'}) {
473 croak("Missing the required parameter 'logging_openstack_name' when calling get_log_openstack");
474 }
475  
476 # parse inputs
477 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/openstack/{logging_openstack_name}';
478  
479 my $_method = 'GET';
480 my $query_params = {};
481 my $header_params = {};
482 my $form_params = {};
483  
484 # 'Accept' and 'Content-Type' header
485 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
486 if ($_header_accept) {
487 $header_params->{'Accept'} = $_header_accept;
488 }
489 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
490  
491 # path params
492 if ( exists $args{'service_id'}) {
493 my $_base_variable = "{" . "service_id" . "}";
494 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
495 $_resource_path =~ s/$_base_variable/$_base_value/g;
496 }
497  
498 # path params
499 if ( exists $args{'version_id'}) {
500 my $_base_variable = "{" . "version_id" . "}";
501 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
502 $_resource_path =~ s/$_base_variable/$_base_value/g;
503 }
504  
505 # path params
506 if ( exists $args{'logging_openstack_name'}) {
507 my $_base_variable = "{" . "logging_openstack_name" . "}";
508 my $_base_value = $self->{api_client}->to_path_value($args{'logging_openstack_name'});
509 $_resource_path =~ s/$_base_variable/$_base_value/g;
510 }
511  
512 my $_body_data;
513 # authentication setting, if any
514 my $auth_settings = [qw(token )];
515  
516 # make the API Call
517 my $response = $self->{api_client}->call_api($_resource_path, $_method,
518 $query_params, $form_params,
519 $header_params, $_body_data, $auth_settings);
520 if (!$response) {
521 return;
522 }
523 my $_response_object = $self->{api_client}->deserialize('LoggingOpenstackResponse', $response);
524 return $_response_object;
525 }
526  
527 #
528 # list_log_openstack
529 #
530 # List OpenStack log endpoints
531 #
532 # @param string $service_id Alphanumeric string identifying the service. (required)
533 # @param int $version_id Integer identifying a service version. (required)
534 {
535 my $params = {
536 'service_id' => {
537 data_type => 'string',
538 description => 'Alphanumeric string identifying the service.',
539 required => '1',
540 },
541 'version_id' => {
542 data_type => 'int',
543 description => 'Integer identifying a service version.',
544 required => '1',
545 },
546 };
547 __PACKAGE__->method_documentation->{ 'list_log_openstack' } = {
548 summary => 'List OpenStack log endpoints',
549 params => $params,
550 returns => 'ARRAY[LoggingOpenstackResponse]',
551 };
552 }
553 # @return ARRAY[LoggingOpenstackResponse]
554 #
555 sub list_log_openstack {
556 my ($self, %args) = @_;
557  
558 # verify the required parameter 'service_id' is set
559 unless (exists $args{'service_id'}) {
560 croak("Missing the required parameter 'service_id' when calling list_log_openstack");
561 }
562  
563 # verify the required parameter 'version_id' is set
564 unless (exists $args{'version_id'}) {
565 croak("Missing the required parameter 'version_id' when calling list_log_openstack");
566 }
567  
568 # parse inputs
569 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/openstack';
570  
571 my $_method = 'GET';
572 my $query_params = {};
573 my $header_params = {};
574 my $form_params = {};
575  
576 # 'Accept' and 'Content-Type' header
577 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
578 if ($_header_accept) {
579 $header_params->{'Accept'} = $_header_accept;
580 }
581 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
582  
583 # path params
584 if ( exists $args{'service_id'}) {
585 my $_base_variable = "{" . "service_id" . "}";
586 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
587 $_resource_path =~ s/$_base_variable/$_base_value/g;
588 }
589  
590 # path params
591 if ( exists $args{'version_id'}) {
592 my $_base_variable = "{" . "version_id" . "}";
593 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
594 $_resource_path =~ s/$_base_variable/$_base_value/g;
595 }
596  
597 my $_body_data;
598 # authentication setting, if any
599 my $auth_settings = [qw(token )];
600  
601 # make the API Call
602 my $response = $self->{api_client}->call_api($_resource_path, $_method,
603 $query_params, $form_params,
604 $header_params, $_body_data, $auth_settings);
605 if (!$response) {
606 return;
607 }
608 my $_response_object = $self->{api_client}->deserialize('ARRAY[LoggingOpenstackResponse]', $response);
609 return $_response_object;
610 }
611  
612 #
613 # update_log_openstack
614 #
615 # Update an OpenStack log endpoint
616 #
617 # @param string $service_id Alphanumeric string identifying the service. (required)
618 # @param int $version_id Integer identifying a service version. (required)
619 # @param string $logging_openstack_name The name for the real-time logging configuration. (required)
620 # @param string $name The name for the real-time logging configuration. (optional)
621 # @param string $placement Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. (optional)
622 # @param string $response_condition The name of an existing condition in the configured endpoint, or leave blank to always execute. (optional)
623 # @param string $format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). (optional, default to '%h %l %u %t "%r" %>s %b')
624 # @param string $log_processing_region The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global. (optional, default to 'none')
625 # @param int $format_version The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (optional, default to 2)
626 # @param string $message_type How the message should be formatted. (optional, default to 'blank')
627 # @param string $timestamp_format A timestamp format (optional)
628 # @param string $compression_codec The codec used for compressing your logs. Valid values are `zstd`, `snappy`, and `gzip`. Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error. (optional)
629 # @param int $period How frequently log files are finalized so they can be available for reading (in seconds). (optional, default to 3600)
630 # @param int $gzip_level The level of gzip encoding when sending logs (default `0`, no compression). Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error. (optional, default to 0)
631 # @param string $access_key Your OpenStack account access key. (optional)
632 # @param string $bucket_name The name of your OpenStack container. (optional)
633 # @param string $path The path to upload logs to. (optional, default to 'null')
634 # @param string $public_key A PGP public key that Fastly will use to encrypt your log files before writing them to disk. (optional, default to 'null')
635 # @param string $url Your OpenStack auth url. (optional)
636 # @param string $user The username for your OpenStack account. (optional)
637 {
638 my $params = {
639 'service_id' => {
640 data_type => 'string',
641 description => 'Alphanumeric string identifying the service.',
642 required => '1',
643 },
644 'version_id' => {
645 data_type => 'int',
646 description => 'Integer identifying a service version.',
647 required => '1',
648 },
649 'logging_openstack_name' => {
650 data_type => 'string',
651 description => 'The name for the real-time logging configuration.',
652 required => '1',
653 },
654 'name' => {
655 data_type => 'string',
656 description => 'The name for the real-time logging configuration.',
657 required => '0',
658 },
659 'placement' => {
660 data_type => 'string',
661 description => 'Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. ',
662 required => '0',
663 },
664 'response_condition' => {
665 data_type => 'string',
666 description => 'The name of an existing condition in the configured endpoint, or leave blank to always execute.',
667 required => '0',
668 },
669 'format' => {
670 data_type => 'string',
671 description => 'A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/).',
672 required => '0',
673 },
674 'log_processing_region' => {
675 data_type => 'string',
676 description => 'The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.',
677 required => '0',
678 },
679 'format_version' => {
680 data_type => 'int',
681 description => 'The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. ',
682 required => '0',
683 },
684 'message_type' => {
685 data_type => 'string',
686 description => 'How the message should be formatted.',
687 required => '0',
688 },
689 'timestamp_format' => {
690 data_type => 'string',
691 description => 'A timestamp format',
692 required => '0',
693 },
694 'compression_codec' => {
695 data_type => 'string',
696 description => 'The codec used for compressing your logs. Valid values are `zstd`, `snappy`, and `gzip`. Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error.',
697 required => '0',
698 },
699 'period' => {
700 data_type => 'int',
701 description => 'How frequently log files are finalized so they can be available for reading (in seconds).',
702 required => '0',
703 },
704 'gzip_level' => {
705 data_type => 'int',
706 description => 'The level of gzip encoding when sending logs (default `0`, no compression). Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error.',
707 required => '0',
708 },
709 'access_key' => {
710 data_type => 'string',
711 description => 'Your OpenStack account access key.',
712 required => '0',
713 },
714 'bucket_name' => {
715 data_type => 'string',
716 description => 'The name of your OpenStack container.',
717 required => '0',
718 },
719 'path' => {
720 data_type => 'string',
721 description => 'The path to upload logs to.',
722 required => '0',
723 },
724 'public_key' => {
725 data_type => 'string',
726 description => 'A PGP public key that Fastly will use to encrypt your log files before writing them to disk.',
727 required => '0',
728 },
729 'url' => {
730 data_type => 'string',
731 description => 'Your OpenStack auth url.',
732 required => '0',
733 },
734 'user' => {
735 data_type => 'string',
736 description => 'The username for your OpenStack account.',
737 required => '0',
738 },
739 };
740 __PACKAGE__->method_documentation->{ 'update_log_openstack' } = {
741 summary => 'Update an OpenStack log endpoint',
742 params => $params,
743 returns => 'LoggingOpenstackResponse',
744 };
745 }
746 # @return LoggingOpenstackResponse
747 #
748 sub update_log_openstack {
749 my ($self, %args) = @_;
750  
751 # verify the required parameter 'service_id' is set
752 unless (exists $args{'service_id'}) {
753 croak("Missing the required parameter 'service_id' when calling update_log_openstack");
754 }
755  
756 # verify the required parameter 'version_id' is set
757 unless (exists $args{'version_id'}) {
758 croak("Missing the required parameter 'version_id' when calling update_log_openstack");
759 }
760  
761 # verify the required parameter 'logging_openstack_name' is set
762 unless (exists $args{'logging_openstack_name'}) {
763 croak("Missing the required parameter 'logging_openstack_name' when calling update_log_openstack");
764 }
765  
766 # parse inputs
767 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/openstack/{logging_openstack_name}';
768  
769 my $_method = 'PUT';
770 my $query_params = {};
771 my $header_params = {};
772 my $form_params = {};
773  
774 # 'Accept' and 'Content-Type' header
775 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
776 if ($_header_accept) {
777 $header_params->{'Accept'} = $_header_accept;
778 }
779 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/x-www-form-urlencoded');
780  
781 # path params
782 if ( exists $args{'service_id'}) {
783 my $_base_variable = "{" . "service_id" . "}";
784 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
785 $_resource_path =~ s/$_base_variable/$_base_value/g;
786 }
787  
788 # path params
789 if ( exists $args{'version_id'}) {
790 my $_base_variable = "{" . "version_id" . "}";
791 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
792 $_resource_path =~ s/$_base_variable/$_base_value/g;
793 }
794  
795 # path params
796 if ( exists $args{'logging_openstack_name'}) {
797 my $_base_variable = "{" . "logging_openstack_name" . "}";
798 my $_base_value = $self->{api_client}->to_path_value($args{'logging_openstack_name'});
799 $_resource_path =~ s/$_base_variable/$_base_value/g;
800 }
801  
802 # form params
803 if ( exists $args{'name'} ) {
804 $form_params->{'name'} = $self->{api_client}->to_form_value($args{'name'});
805 }
806  
807 # form params
808 if ( exists $args{'placement'} ) {
809 $form_params->{'placement'} = $self->{api_client}->to_form_value($args{'placement'});
810 }
811  
812 # form params
813 if ( exists $args{'response_condition'} ) {
814 $form_params->{'response_condition'} = $self->{api_client}->to_form_value($args{'response_condition'});
815 }
816  
817 # form params
818 if ( exists $args{'format'} ) {
819 $form_params->{'format'} = $self->{api_client}->to_form_value($args{'format'});
820 }
821  
822 # form params
823 if ( exists $args{'log_processing_region'} ) {
824 $form_params->{'log_processing_region'} = $self->{api_client}->to_form_value($args{'log_processing_region'});
825 }
826  
827 # form params
828 if ( exists $args{'format_version'} ) {
829 $form_params->{'format_version'} = $self->{api_client}->to_form_value($args{'format_version'});
830 }
831  
832 # form params
833 if ( exists $args{'message_type'} ) {
834 $form_params->{'message_type'} = $self->{api_client}->to_form_value($args{'message_type'});
835 }
836  
837 # form params
838 if ( exists $args{'timestamp_format'} ) {
839 $form_params->{'timestamp_format'} = $self->{api_client}->to_form_value($args{'timestamp_format'});
840 }
841  
842 # form params
843 if ( exists $args{'compression_codec'} ) {
844 $form_params->{'compression_codec'} = $self->{api_client}->to_form_value($args{'compression_codec'});
845 }
846  
847 # form params
848 if ( exists $args{'period'} ) {
849 $form_params->{'period'} = $self->{api_client}->to_form_value($args{'period'});
850 }
851  
852 # form params
853 if ( exists $args{'gzip_level'} ) {
854 $form_params->{'gzip_level'} = $self->{api_client}->to_form_value($args{'gzip_level'});
855 }
856  
857 # form params
858 if ( exists $args{'access_key'} ) {
859 $form_params->{'access_key'} = $self->{api_client}->to_form_value($args{'access_key'});
860 }
861  
862 # form params
863 if ( exists $args{'bucket_name'} ) {
864 $form_params->{'bucket_name'} = $self->{api_client}->to_form_value($args{'bucket_name'});
865 }
866  
867 # form params
868 if ( exists $args{'path'} ) {
869 $form_params->{'path'} = $self->{api_client}->to_form_value($args{'path'});
870 }
871  
872 # form params
873 if ( exists $args{'public_key'} ) {
874 $form_params->{'public_key'} = $self->{api_client}->to_form_value($args{'public_key'});
875 }
876  
877 # form params
878 if ( exists $args{'url'} ) {
879 $form_params->{'url'} = $self->{api_client}->to_form_value($args{'url'});
880 }
881  
882 # form params
883 if ( exists $args{'user'} ) {
884 $form_params->{'user'} = $self->{api_client}->to_form_value($args{'user'});
885 }
886  
887 my $_body_data;
888 # authentication setting, if any
889 my $auth_settings = [qw(token )];
890  
891 # make the API Call
892 my $response = $self->{api_client}->call_api($_resource_path, $_method,
893 $query_params, $form_params,
894 $header_params, $_body_data, $auth_settings);
895 if (!$response) {
896 return;
897 }
898 my $_response_object = $self->{api_client}->deserialize('LoggingOpenstackResponse', $response);
899 return $_response_object;
900 }
901  
902 1;