Hide Show 12 lines of Pod
require
5.6.0;
__PACKAGE__->mk_classdata(
'method_documentation'
=> {});
sub
new {
my
$class
=
shift
;
my
$api_client
;
if
(
$_
[0] &&
ref
$_
[0] &&
ref
$_
[0] eq
'WebService::Fastly::ApiClient'
) {
$api_client
=
$_
[0];
}
else
{
$api_client
= WebService::Fastly::ApiClient->new(
@_
);
}
bless
{
api_client
=>
$api_client
},
$class
;
}
{
my
$params
= {
'visualization'
=> {
data_type
=>
'string'
,
description
=>
''
,
required
=>
'1'
,
},
'service_id'
=> {
data_type
=>
'string'
,
description
=>
''
,
required
=>
'1'
,
},
'start'
=> {
data_type
=>
'string'
,
description
=>
''
,
required
=>
'1'
,
},
'end'
=> {
data_type
=>
'string'
,
description
=>
''
,
required
=>
'1'
,
},
'pops'
=> {
data_type
=>
'string'
,
description
=>
''
,
required
=>
'0'
,
},
'domain'
=> {
data_type
=>
'string'
,
description
=>
''
,
required
=>
'0'
,
},
'domain_exact_match'
=> {
data_type
=>
'boolean'
,
description
=>
''
,
required
=>
'0'
,
},
'limit'
=> {
data_type
=>
'double'
,
description
=>
''
,
required
=>
'0'
,
},
};
__PACKAGE__->method_documentation->{
'get_log_insights'
} = {
summary
=>
'Retrieve log insights'
,
params
=>
$params
,
returns
=>
'GetLogInsightsResponse'
,
};
}
sub
get_log_insights {
my
(
$self
,
%args
) =
@_
;
unless
(
exists
$args
{
'visualization'
}) {
croak(
"Missing the required parameter 'visualization' when calling get_log_insights"
);
}
unless
(
exists
$args
{
'service_id'
}) {
croak(
"Missing the required parameter 'service_id' when calling get_log_insights"
);
}
unless
(
exists
$args
{
'start'
}) {
croak(
"Missing the required parameter 'start' when calling get_log_insights"
);
}
unless
(
exists
$args
{
'end'
}) {
croak(
"Missing the required parameter 'end' when calling get_log_insights"
);
}
my
$_resource_path
=
'/observability/log-insights'
;
my
$_method
=
'GET'
;
my
$query_params
= {};
my
$header_params
= {};
my
$form_params
= {};
my
$_header_accept
=
$self
->{api_client}->select_header_accept(
'application/json'
);
if
(
$_header_accept
) {
$header_params
->{
'Accept'
} =
$_header_accept
;
}
$header_params
->{
'Content-Type'
} =
$self
->{api_client}->select_header_content_type();
if
(
exists
$args
{
'visualization'
}) {
$query_params
->{
'visualization'
} =
$self
->{api_client}->to_query_value(
$args
{
'visualization'
});
}
if
(
exists
$args
{
'service_id'
}) {
$query_params
->{
'service_id'
} =
$self
->{api_client}->to_query_value(
$args
{
'service_id'
});
}
if
(
exists
$args
{
'start'
}) {
$query_params
->{
'start'
} =
$self
->{api_client}->to_query_value(
$args
{
'start'
});
}
if
(
exists
$args
{
'end'
}) {
$query_params
->{
'end'
} =
$self
->{api_client}->to_query_value(
$args
{
'end'
});
}
if
(
exists
$args
{
'pops'
}) {
$query_params
->{
'pops'
} =
$self
->{api_client}->to_query_value(
$args
{
'pops'
});
}
if
(
exists
$args
{
'domain'
}) {
$query_params
->{
'domain'
} =
$self
->{api_client}->to_query_value(
$args
{
'domain'
});
}
if
(
exists
$args
{
'domain_exact_match'
}) {
$query_params
->{
'domain_exact_match'
} =
$self
->{api_client}->to_query_value(
$args
{
'domain_exact_match'
});
}
if
(
exists
$args
{
'limit'
}) {
$query_params
->{
'limit'
} =
$self
->{api_client}->to_query_value(
$args
{
'limit'
});
}
my
$_body_data
;
my
$auth_settings
= [
qw(token )
];
my
$response
=
$self
->{api_client}->call_api(
$_resource_path
,
$_method
,
$query_params
,
$form_params
,
$header_params
,
$_body_data
,
$auth_settings
);
if
(!
$response
) {
return
;
}
my
$_response_object
=
$self
->{api_client}->deserialize(
'GetLogInsightsResponse'
,
$response
);
return
$_response_object
;
}
1;