Fortinet black logo

Version:

Version:

Version:

Version:


Table of Contents

Online Help

Get Resource List

Description

Get Resource List is a key API to retrieve list of cloud resource. The API call requires companyId and roleId which can be retrieved from Get Resource Map

URL

/api/workload/v1/profile/resource/list

Method: POST

Request Headers

Key

Value

Type

Description

Authorization Bearer <Authorization Token> String Authorization credential generated by FortiCWP
Content-Type application/json String  
companyid <12345> Integer Company ID - Company ID can be obtained through Get Resource Map

roleid

<12345>

Long

Login user identity, can be obtained through Get Resource Map

Request Body Parameters

Name Required Type Description
filter Required String Top of the request header, start of the JSON file.
resourceType Required String Filter for the resource type.
option Required Sting Filter option group. There can be multiple option groups.
Key (resource platform) Required String Filter resource platform by key words. Cloud resource platform options: "AWS", "GoogleCloud", "Azure".
Key (resource type) Required String Filter resource type of the resource name. Cloud resource type options: "EC2 Instance", "Compute Engine Instance", "Azure Virtual Machine".
status Optional String Status that track deleted resource, enter "deleted" to find deleted resources.
skip Optional integer Indexes in a result set, used to exclude response from the first N items of a resource collection.
limit Optional integer Maximum number of returned items.
orderDirection Optional String The order of the returned resource list, it can be "asc" for ascending order or "dsc" for descending order.
orderBy Optional String The filter options for the return resource list, available options: "Account", "Name", "ID", "Region", "Type", "Risk level"

Sample Request

The variable "key" in the request body determines which cloud account resource list will be retrieved. Enter "GoogleCloud" for the "key" variable in the first option and "Compute Engine Instance" for the"key" variable in second option to retrieve Google Cloud account resource list. Likewise, enter "AWS" and "EC2 Instance" to retrieve AWS account resource list, and enter "Azure" and "Azure Virtual Machine" for Azure account resource list.

Request URL

POST https://www.forticwp.com/api/workload/v1/profile/resource/list

Request Header

Authorization: Bearer <Authorization_Token>

Content-Type: application/json

roleid: 895145

companyid: 895146

Request Body

{

"filter":{

"resourceType":{

"option":[

{

"key":"GoogleCloud",

"option":[

{

"key":"Compute Engine Instance"

}

]

}

]

},

},

"skip":0,

"limit":1,

"orderDirection":"asc",

"orderBy":"region"

}

Response Variables

Name Type Description
id String Resource ID, this is the "rid" to be used in request header in Get Resource Detail
name String Name of the cloud resource, it can be Azure Virtual Machine, Google Compute Engine, or EC2 Instance
region String The region of the cloud resource.
resoureceId String The directory path of the resource location.
riskLevel String The risk level of the resource rated by FortiCWP.
totalPage Integer Total page of searched resources.
limit Integer Maximum number of return resources in one page
skip Integer Indexes in a result set, used to exclude a response from the first N items of a resource collection.
totalCount Integer Total number of resources.

Sample Response

{

"datas":[

{

"id":1451430,

"name":"davidgcpvm01",

"region":"devaccount-184100",

"resourceId":"projects/devaccount-184100/zones/us-central1-c/instances/davidgcpvm01",

"category":"Compute Engine Instance",

"riskLevel":"Critical",

"fcasbTagGroup":{

"select":false,

"key":"fcasb highlight",

"option":[

{

"select":true,

"key":"Network",

"name":"Internet facing - anywhere"

}

]

},

"availableActions":[

"PROFILE",

"TRAFFIC",

"RESOURCEMAP",

"ASSETVIEW"

],

"account":{

"service":"GoogleCloud",

"accountName":"tttt211",

"accountNumber":"@devaccount-184100.iam.gserviceaccount.com",

"accountEmail":"devaccount@devaccount-184100.iam.gserviceaccount.com",

"organizationDomain":"@devaccount-184100.iam.gserviceaccount.com",

"status":"LICENSE"

},

"lastScanTime":1647469740000

}

],

"totalPage":25,

"limit":1,

"skip":0,

"totalCount":25

}

 

 

 

 

 

Get Resource List

Description

Get Resource List is a key API to retrieve list of cloud resource. The API call requires companyId and roleId which can be retrieved from Get Resource Map

URL

/api/workload/v1/profile/resource/list

Method: POST

Request Headers

Key

Value

Type

Description

Authorization Bearer <Authorization Token> String Authorization credential generated by FortiCWP
Content-Type application/json String  
companyid <12345> Integer Company ID - Company ID can be obtained through Get Resource Map

roleid

<12345>

Long

Login user identity, can be obtained through Get Resource Map

Request Body Parameters

Name Required Type Description
filter Required String Top of the request header, start of the JSON file.
resourceType Required String Filter for the resource type.
option Required Sting Filter option group. There can be multiple option groups.
Key (resource platform) Required String Filter resource platform by key words. Cloud resource platform options: "AWS", "GoogleCloud", "Azure".
Key (resource type) Required String Filter resource type of the resource name. Cloud resource type options: "EC2 Instance", "Compute Engine Instance", "Azure Virtual Machine".
status Optional String Status that track deleted resource, enter "deleted" to find deleted resources.
skip Optional integer Indexes in a result set, used to exclude response from the first N items of a resource collection.
limit Optional integer Maximum number of returned items.
orderDirection Optional String The order of the returned resource list, it can be "asc" for ascending order or "dsc" for descending order.
orderBy Optional String The filter options for the return resource list, available options: "Account", "Name", "ID", "Region", "Type", "Risk level"

Sample Request

The variable "key" in the request body determines which cloud account resource list will be retrieved. Enter "GoogleCloud" for the "key" variable in the first option and "Compute Engine Instance" for the"key" variable in second option to retrieve Google Cloud account resource list. Likewise, enter "AWS" and "EC2 Instance" to retrieve AWS account resource list, and enter "Azure" and "Azure Virtual Machine" for Azure account resource list.

Request URL

POST https://www.forticwp.com/api/workload/v1/profile/resource/list

Request Header

Authorization: Bearer <Authorization_Token>

Content-Type: application/json

roleid: 895145

companyid: 895146

Request Body

{

"filter":{

"resourceType":{

"option":[

{

"key":"GoogleCloud",

"option":[

{

"key":"Compute Engine Instance"

}

]

}

]

},

},

"skip":0,

"limit":1,

"orderDirection":"asc",

"orderBy":"region"

}

Response Variables

Name Type Description
id String Resource ID, this is the "rid" to be used in request header in Get Resource Detail
name String Name of the cloud resource, it can be Azure Virtual Machine, Google Compute Engine, or EC2 Instance
region String The region of the cloud resource.
resoureceId String The directory path of the resource location.
riskLevel String The risk level of the resource rated by FortiCWP.
totalPage Integer Total page of searched resources.
limit Integer Maximum number of return resources in one page
skip Integer Indexes in a result set, used to exclude a response from the first N items of a resource collection.
totalCount Integer Total number of resources.

Sample Response

{

"datas":[

{

"id":1451430,

"name":"davidgcpvm01",

"region":"devaccount-184100",

"resourceId":"projects/devaccount-184100/zones/us-central1-c/instances/davidgcpvm01",

"category":"Compute Engine Instance",

"riskLevel":"Critical",

"fcasbTagGroup":{

"select":false,

"key":"fcasb highlight",

"option":[

{

"select":true,

"key":"Network",

"name":"Internet facing - anywhere"

}

]

},

"availableActions":[

"PROFILE",

"TRAFFIC",

"RESOURCEMAP",

"ASSETVIEW"

],

"account":{

"service":"GoogleCloud",

"accountName":"tttt211",

"accountNumber":"@devaccount-184100.iam.gserviceaccount.com",

"accountEmail":"devaccount@devaccount-184100.iam.gserviceaccount.com",

"organizationDomain":"@devaccount-184100.iam.gserviceaccount.com",

"status":"LICENSE"

},

"lastScanTime":1647469740000

}

],

"totalPage":25,

"limit":1,

"skip":0,

"totalCount":25

}