Use this API to retrieve a list of resources based on their specified type.
Input ParameterInput Parameter
Parameter |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
resourcetype |
Mandatory |
String |
Specify the type of resource you wish to retrieve the list for. Example: INSTANCE, IAM_USER, BUCKET, SECURITY_LIST |
filter |
Optional |
String |
Specify a filter token query to filter the list of resources. |
pageSize |
Optional |
Integer |
Specify the number of records to be displayed per page in the response. |
pageNo |
Optional |
Integer |
Specify the page number for displaying the records in the response. |
sort |
Optional |
Integer |
Specify the sort field order for the response objects |
API request
curl -n -u "USERNAME:PASSWORD" api/rest/v1/resource/INSTANCE/oci?pageNo=0&pageSize=3' \ -header 'Accept: application/json' -header 'Content-Type: application/json'
API response (JSON)
{ "content": [ { "controlsFailed": 1, "resourceId": "ocid1.securitylist.oc1.me-jeddah1.aaaaaaaaa7r53ixibeqjrbtylmtdzu47kks34ove3g2algtbhxtbopjnaarq", "connectorId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx", "tagIds": null, "type": "SECURITY_LIST", "uuid": null, "lastUpdated": "Thu Jul 27 14:50:19 UTC 2023", "tenancyName": null, "cloudType": "OCI", "customerId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx", "compartment": { "name": null, "ociId": null, "id": "ocid1.compartment.oc1..ocid1.tenancy.oc1..aaaaaaaaa" }, "ociId": null, "customers": [ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" ], "connectorSource": null, "lifecycleState": "AVAILABLE", "connectorUuids": [ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" ], "availabilityDomain": "", "scanId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx", "cloudAccountId": "ocid1.securitylist.oc1.ocid1.tenancy.oc1..aaaaaaaaa", "additionalDetails": { "ingressSecurityRules": [ { "protocol": "TCP", "isStateless": null, "udpOptions": null, "ntwOptionSourcePortRange": null, "icmpOptions": null, "source": "0.0.0.0/0", "tcpOptions": { "sourcePortRange": null, "destinationPortRange": { "min": 22, "max": 22 } }, "ntwOptionDesPortRange": null }, { "protocol": "ICMP", "isStateless": null, "udpOptions": null, "ntwOptionSourcePortRange": null, "icmpOptions": null, "source": "0.0.0.0/0", "tcpOptions": null, "ntwOptionDesPortRange": null }, { "protocol": "ICMP", "isStateless": null, "udpOptions": null, "ntwOptionSourcePortRange": null, "icmpOptions": null, "source": "10.0.0.0/16", "tcpOptions": null, "ntwOptionDesPortRange": null } ], "egressSecurityRules": [ { "protocol": "all", "isStateless": null, "udpOptions": null, "ntwOptionSourcePortRange": null, "destination": "0.0.0.0/0", "icmpOptions": null, "tcpOptions": null, "ntwOptionDesPortRange": null } ] }, "creationDate": 1622070182658, "firstDiscoveredOn": 1690469419169, "connectorUuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx", "vcnId": "ocid1.vcn.oc1.ocid1.tenancy.oc1..aaaaaaaaa", "scanUuids": [ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" ], "name": "Default Security List for vcn-20210526-1602", "tenantId": "ocid1.tenancy.oc1..aaaaaaaaa", "qualysTags": [], "region": "me-jeddah-1", "ociTags": [ { "nameSpace": "Oracle-Tags", "type": "DEFINED", "value": "oraclecengg1/test@qualys.com", "key": "CreatedBy" }, { "nameSpace": "Oracle-Tags", "type": "DEFINED", "value": "2021-05-26T23:03:02.652Z", "key": "CreatedOn" } ], "updated": 1690469419171 } ], "pageable": { "sort": { "sorted": false, "empty": true, "unsorted": true }, "pageSize": 1, "pageNumber": 0, "offset": 0, "paged": true, "unpaged": false }, "totalPages": 396, "totalElements": 396, "last": false, "number": 0, "size": 1, "numberOfElements": 1, "sort": { "sorted": false, "empty": true, "unsorted": true }, "first": true, "empty": false }