forked from centreon/centreon-archived
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BE]Update APIs related with BAM to use context instead DataRepresent…
…ers (centreon#8107) * feat(base): add AnnotationRegistry::registerLoader to register the annotations in entities * feat(base): add interface for serializer contexts * feat(base): extend Webservice abstract class and separate duplicated code in trait related with dependencies * feat(base): extend pagination service to work with context files * feat(base): add Serializer groups to entities related with BAM and make their setters and getters to accept null values * feat(api): update NagiosServer entity and repository to provide list of entities by IDs * feat(api): use context for AclGroup webservice * feat(api): use context for Image webservice * fix(base): add docblock * feat(api): use context in COntactGroup webservice * feat(api): use context in Command webservice * feat(api): use context in Escalation webservice * feat(api): use context in Timeperiod webservice * fix(test): improve phpunit tests * fix(test): reduce the amount of exceptions in codestyle * chore(dependencies): update composer dependencies * feat(test): cover APIs with acceptance tests * feat(test): add context information when CentreonPaginationServiceMock prepare response * fix(test): upgrade unit tests to use WebServiceExecuteTestTrait and Interfaces for authentication * fix(test): adjust unit texts fixtures * fix(test): codestyle * feat(test): extend test bootstrap to provide Serializer service from DI * feat(base): extend Serializer service with ArrayDenormalizer * feat(test): extend WebServiceExecuteTestTrait to mock the repositories for paginations * feat(test): use mock of CentreonDbManager service from DI * feat(di): separate the serialize service and object normalizer service * fix(api): change return type of id getter of entities to be integer * fix(test): add getters getId * fix(test): wrong namespaces * fix(test): improve test bootstrap to work with phing * fix(test): adjust acceptance tests related with APIv1 * chore(dependency): update composer lock * fix(test): remove old API tests * chore(dependency): update composer lock * feat(api): add alias with GET method to object centreon_configuration_remote with action list to postGetRemotesList * chore(api): improve docblocks * chore(api): change return type of ContactGroup::getCgActivate * chore(style): review feedback * chore(style): make the code to be compatible with PSR-12 too * fix(test): reduce warnings * chore(style): improve docblocks and codestyle * fix(test): bot feedback Resolve BAM-808
- Loading branch information
Showing
135 changed files
with
3,452 additions
and
3,338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#features/AclGroupsApi.feature | ||
@api | ||
Feature: Check health of the AclGroup APIs | ||
As an authorized user via the token | ||
I need to ensure my API handles proper actions and returns proper results | ||
|
||
Background: | ||
Given a Centreon server | ||
And I have a running instance of Centreon API | ||
|
||
@aclGroup | ||
Scenario: Healthcheck of AclGroup APIs | ||
# List | ||
When I make a GET request to "/api/index.php?object=centreon_acl_group&action=list" | ||
Then the response code should be 200 | ||
And the response has a "result" property | ||
And the response has a "status" property | ||
And the property "result" has value | ||
""" | ||
{ | ||
"pagination":{ | ||
"total":1, | ||
"offset":0, | ||
"limit":1 | ||
}, | ||
"entities":[ | ||
{"id":1,"name":"ALL","alias":"ALL","changed":false,"activate":true} | ||
] | ||
} | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#features/CommandsApi.feature | ||
@api | ||
Feature: Check health of the Command APIs | ||
As an authorized user via the token | ||
I need to ensure my API handles proper actions and returns proper results | ||
|
||
Background: | ||
Given a Centreon server | ||
And I have a running instance of Centreon API | ||
|
||
@command | ||
Scenario: Healthcheck of Command APIs | ||
# List | ||
When I make a GET request to "/api/index.php?object=centreon_command&action=list" | ||
Then the response code should be 200 | ||
And the response has a "result" property | ||
And the response has a "status" property | ||
And the property "result" has value | ||
""" | ||
{ | ||
"pagination":{ | ||
"total":52, | ||
"offset":0, | ||
"limit":52 | ||
}, | ||
"entities":[ | ||
{"id":96,"name":"check_centreon_cpu"}, | ||
{"id":4,"name":"check_centreon_dummy"}, | ||
{"id":5,"name":"check_centreon_load_average"}, | ||
{"id":97,"name":"check_centreon_memory"}, | ||
{"id":59,"name":"check_centreon_nb_connections"}, | ||
{"id":34,"name":"check_centreon_nt"}, | ||
{"id":6,"name":"check_centreon_ping"}, | ||
{"id":7,"name":"check_centreon_process"}, | ||
{"id":8,"name":"check_centreon_remote_storage"}, | ||
{"id":95,"name":"check_centreon_snmp_proc_detailed"}, | ||
{"id":94,"name":"check_centreon_snmp_value"}, | ||
{"id":62,"name":"check_centreon_traffic"}, | ||
{"id":10,"name":"check_centreon_traffic_limited"}, | ||
{"id":44,"name":"check_centreon_uptime"}, | ||
{"id":29,"name":"check_dhcp"}, | ||
{"id":30,"name":"check_dig"}, | ||
{"id":2,"name":"check_disk_smb"}, | ||
{"id":3,"name":"check_distant_disk_space"}, | ||
{"id":27,"name":"check_dns"}, | ||
{"id":28,"name":"check_ftp"}, | ||
{"id":1,"name":"check_host_alive"}, | ||
{"id":11,"name":"check_hpjd"}, | ||
{"id":12,"name":"check_http"}, | ||
{"id":13,"name":"check_https"}, | ||
{"id":76,"name":"check_load_average"}, | ||
{"id":77,"name":"check_local_cpu_load"}, | ||
{"id":15,"name":"check_local_disk"}, | ||
{"id":78,"name":"check_local_disk_space"}, | ||
{"id":16,"name":"check_local_load"}, | ||
{"id":17,"name":"check_local_procs"}, | ||
{"id":14,"name":"check_local_swap"}, | ||
{"id":18,"name":"check_local_users"}, | ||
{"id":79,"name":"check_maxq"}, | ||
{"id":24,"name":"check_nntp"}, | ||
{"id":20,"name":"check_nt_cpu"}, | ||
{"id":21,"name":"check_nt_disk"}, | ||
{"id":19,"name":"check_nt_memuse"}, | ||
{"id":25,"name":"check_pop"}, | ||
{"id":26,"name":"check_smtp"}, | ||
{"id":31,"name":"check_snmp"}, | ||
{"id":23,"name":"check_tcp"}, | ||
{"id":32,"name":"check_telnet"}, | ||
{"id":33,"name":"check_udp"}, | ||
{"id":35,"name":"host-notify-by-email"}, | ||
{"id":37,"name":"host-notify-by-epager"}, | ||
{"id":89,"name":"host-notify-by-jabber"}, | ||
{"id":41,"name":"process-service-perfdata"}, | ||
{"id":36,"name":"service-notify-by-email"}, | ||
{"id":38,"name":"service-notify-by-epager"}, | ||
{"id":90,"name":"service-notify-by-jabber"}, | ||
{"id":39,"name":"submit-host-check-result"}, | ||
{"id":40,"name":"submit-service-check-result"} | ||
] | ||
} | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#features/ContactGroupsApi.feature | ||
@api | ||
Feature: Check health of the ContactGroup APIs | ||
As an authorized user via the token | ||
I need to ensure my API handles proper actions and returns proper results | ||
|
||
Background: | ||
Given a Centreon server | ||
And I have a running instance of Centreon API | ||
|
||
@contactGroup | ||
Scenario: Healthcheck of ContactGroups APIs | ||
# List | ||
When I make a GET request to "/api/index.php?object=centreon_contact_groups&action=list" | ||
Then the response code should be 200 | ||
And the response has a "result" property | ||
And the response has a "status" property | ||
And the property "result" has value | ||
""" | ||
{ | ||
"pagination":{ | ||
"total":2, | ||
"offset":0, | ||
"limit":2 | ||
}, | ||
"entities":[ | ||
{"id":3,"name":"Guest","activate":1}, | ||
{"id":5,"name":"Supervisors","activate":1} | ||
] | ||
} | ||
""" |
Oops, something went wrong.