mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 07:34:35 +02:00
Ctor 396 pack centreon plugin cloud vmware velocloud restapi mode list edges don t retrieve informations and get http code 400 (#5133)
This commit is contained in:
parent
0e252334d8
commit
792cefd77b
@ -283,7 +283,8 @@ sub get_entreprise_id {
|
|||||||
|
|
||||||
my $response = $self->request_api(
|
my $response = $self->request_api(
|
||||||
method => 'POST',
|
method => 'POST',
|
||||||
endpoint => '/enterprise/getEnterprise'
|
endpoint => '/enterprise/getEnterprise',
|
||||||
|
query_form_post => {}
|
||||||
);
|
);
|
||||||
|
|
||||||
$self->{entreprise_id} = $response->{id};
|
$self->{entreprise_id} = $response->{id};
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
--api-filter-orgs
|
--api-filter-orgs
|
||||||
--api-password
|
--api-password
|
||||||
--api-password
|
--api-password
|
||||||
|
--api-path
|
||||||
--api-token
|
--api-token
|
||||||
--api-username
|
--api-username
|
||||||
--api-version
|
--api-version
|
||||||
@ -165,5 +166,7 @@ v1
|
|||||||
v2
|
v2
|
||||||
VDSL2
|
VDSL2
|
||||||
Veeam
|
Veeam
|
||||||
|
VeloCloud
|
||||||
|
VMware
|
||||||
WSMAN
|
WSMAN
|
||||||
Kubernetes
|
Kubernetes
|
43
tests/robot/cloud/vmware/velocloud/restapi/edgestatus.robot
Normal file
43
tests/robot/cloud/vmware/velocloud/restapi/edgestatus.robot
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
*** Settings ***
|
||||||
|
Documentation VeloCloud REST API Edge Status
|
||||||
|
|
||||||
|
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||||
|
|
||||||
|
Suite Setup Start Mockoon ${MOCKOON_JSON}
|
||||||
|
Suite Teardown Stop Mockoon
|
||||||
|
Test Timeout 120s
|
||||||
|
|
||||||
|
|
||||||
|
*** Variables ***
|
||||||
|
${MOCKOON_JSON} ${CURDIR}${/}velocloud.mockoon.json
|
||||||
|
${HOSTNAME} 127.0.0.1
|
||||||
|
${APIPORT} 3000
|
||||||
|
${CMD} ${CENTREON_PLUGINS}
|
||||||
|
... --plugin=cloud::vmware::velocloud::restapi::plugin
|
||||||
|
... --mode edge-status
|
||||||
|
... --hostname=${HOSTNAME}
|
||||||
|
... --username=XloginX
|
||||||
|
... --password=XpasswordX
|
||||||
|
... --proto=http
|
||||||
|
... --port=${APIPORT}
|
||||||
|
... --custommode=api
|
||||||
|
... --statefile-dir=/dev/shm/
|
||||||
|
|
||||||
|
*** Test Cases ***
|
||||||
|
Edge Status ${tc}
|
||||||
|
[Tags] cloud api vmware
|
||||||
|
${command} Catenate ${CMD} ${extraoptions}
|
||||||
|
${output} Run ${command}
|
||||||
|
|
||||||
|
${output} Strip String ${output}
|
||||||
|
Should Be Equal As Strings
|
||||||
|
... ${output}
|
||||||
|
... ${expected_result}
|
||||||
|
... Wrong output result for command:\n${command}\n\nObtained:\n${output}\n\nExpected:\n${expected_result}\n
|
||||||
|
... values=False
|
||||||
|
... collapse_spaces=True
|
||||||
|
|
||||||
|
|
||||||
|
Examples: tc extraoptions expected_result --
|
||||||
|
... 1 ${EMPTY} CRITICAL: Edge 'MYEDGE#02' State is 'OFFLINE', Service State is 'IN_SERVICE', HA State is 'READY', Activation State is 'ACTIVATED'
|
||||||
|
... 2 --critical-status='' OK: All edges status are ok
|
42
tests/robot/cloud/vmware/velocloud/restapi/listedges.robot
Normal file
42
tests/robot/cloud/vmware/velocloud/restapi/listedges.robot
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
*** Settings ***
|
||||||
|
Documentation VeloCloud REST API Edge Status
|
||||||
|
|
||||||
|
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||||
|
|
||||||
|
Suite Setup Start Mockoon ${MOCKOON_JSON}
|
||||||
|
Suite Teardown Stop Mockoon
|
||||||
|
Test Timeout 120s
|
||||||
|
|
||||||
|
|
||||||
|
*** Variables ***
|
||||||
|
${MOCKOON_JSON} ${CURDIR}${/}velocloud.mockoon.json
|
||||||
|
${HOSTNAME} 127.0.0.1
|
||||||
|
${APIPORT} 3000
|
||||||
|
${CMD} ${CENTREON_PLUGINS}
|
||||||
|
... --plugin=cloud::vmware::velocloud::restapi::plugin
|
||||||
|
... --mode list-edges
|
||||||
|
... --hostname=${HOSTNAME}
|
||||||
|
... --username=XloginX
|
||||||
|
... --password=XpasswordX
|
||||||
|
... --proto=http
|
||||||
|
... --port=${APIPORT}
|
||||||
|
... --custommode=api
|
||||||
|
... --statefile-dir=/dev/shm/
|
||||||
|
|
||||||
|
*** Test Cases ***
|
||||||
|
List Edges ${tc}
|
||||||
|
[Tags] cloud api vmware discovery
|
||||||
|
${command} Catenate ${CMD} ${extraoptions} | wc -l
|
||||||
|
${output} Run ${command}
|
||||||
|
|
||||||
|
${output} Strip String ${output}
|
||||||
|
Should Be Equal As Strings
|
||||||
|
... ${output}
|
||||||
|
... ${expected_result}
|
||||||
|
... Wrong output result for command:\n${command}\n\nObtained:\n${output}\n\nExpected:\n${expected_result}\n
|
||||||
|
... values=False
|
||||||
|
... collapse_spaces=True
|
||||||
|
|
||||||
|
|
||||||
|
Examples: tc extraoptions expected_result --
|
||||||
|
... 1 ${EMPTY} 9
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user