Recommendation
Before using the API, we recommend you run through the stack deployment using the
web interfaces of File Storage Security and GCP. The web interface provides a
user-friendly introduction to the deployment parameters, concepts, and
processes.
For instructions on deploying through the web interfaces, see Get started
Prerequisites
Procedure
- Create Stacks.
- Create an API Key.
- Each request that you make requires an authorization and API version in the
header.
- Authorization Header
- For Trend Micro Cloud One API Key:
- Key:
Authorization - Value:
ApiKey <your api key value>
- Key:
- For Legacy API Key (DEPRECATED):
- Key:
api-secret-key - Value:
<your api key value>
- Key:
- For Trend Micro Cloud One API Key:
- API version header:
- Key:
api-version - Value:
v1
- Key:
- Authorization Header
Next steps
Example for Trend Micro Cloud One API Key:
GET /api/external-id HTTP/1.1 Authorization: ApiKey YOUR-API-KEY Api-Version: v1
Example for Legacy API Key:
GET /api/filestorage/external-id HTTP/1.1 api-secret-key: YOUR-API-KEY Api-Version: v1
YOUR-API-KEY above is replaced with the API key you generated
previously.If the API key is valid, the API call is allowed. If not, a 403 code is
returned.
Deploy an all-in-one stack using the API
Procedure
- Get the output of the Terraform deployment from
terraform.tfstateby accessing the JSON elementsoutputs.all_in_one_outputs.value. Each object in the array ofall_in_one_outputsrepresents a storage stack associated with each scanner stack.all_in_one_outputsExample:[ { "projectID":"your-gcp-project-id", "deploymentName":"your-aio-scanner", "storageStacks":[ { "deploymentName":"your-aio-storage", "projectID":"your-gcp-project-id" } ] } ] - Add the scanner and storage stacks to File Storage Security:
-
Add the scanner stack:
-
Note the
projectIDanddeploymentNamefrom each object of the array. -
Call Create Stack and include the
projectIDand thedeploymentNamevalue in the request body, where theprojectIDis the ID of the GCP project you deployed for the stack, and thedeploymentNameis the scanner stack's deployment name.curl --location --request POST 'https://filestorage.{region}.cloudone.trendmicro.com/api/stacks' \ --header 'Api-Version: v1' \ --header 'Authorization: ApiKey YOUR-API-KEY' \ --header 'Content-Type: application/json' \ --data-raw '{ "type": "scanner", "provider": "gcp", "details": { "deploymentName": "your-aio-scanner", "projectID": "your-gcp-project" } }' -
Note the
stackIDvalue in the API response, which is the scanner stack’s ID. -
Call Describe Stack using the scanner stack's stackID noted in the previous step, and continue calling until the status in the response body becomes
ok. You have added the scanner stack.
-
-
Add the storage stack:
-
Note the
projectIDanddeploymentNamefrom each object of thestorageStacks. -
Call Create Stack, and include the previously-noted scanner stack
stackID, theprojectIDand thedeploymentNamein the request body, where theprojectIDis the ID of the GCP project where you deployed the stack, and thedeploymentNameis the storage stack's deployment name. The creation of the storage stack will begin.
curl --location --request POST 'https://filestorage.{region}.cloudone.trendmicro.com/api/stacks' \ --header 'Api-Version: v1' \ --header 'Authorization: ApiKey YOUR-API-KEY' \ --header 'Content-Type: application/json' \ --data-raw '{ "type": "storage", "provider": "gcp", "scannerStack": "your-scanner-stackID", "details": { "deploymentName": "your-aio-storage", "projectID": "your-gcp-project-id" } }'-
Note the
stackIDvalue in the API response. This is the storage stack’s ID. -
Call Describe Stack using the storage stack's
stackIDnoted in the previous step, and continue calling until thestatusin the response body becomesok.
-
-
Next steps
NoteThe stacks must be added separately, and the scanner stack must be added
prior to the storage stack, as described above.
|
Deploy a scanner stack using the API
Procedure
- Get the output of the Terraform deployment from
terraform.tfstateby accessing the JSON elementsoutputs.scanner_stacks_outputs.value. Each object in the array ofscannerStacksrepresents a scanner stack.scanner_stacks_outputsExample:[ { "deploymentName":"your-fss-scanner", "projectID":"your-gcp-project-id", "scannerServiceAccountID":"your-fss-scanner-service-account-id", "scannerTopic":"your-fss-scanner-topic" } ] - Add the scanner stack to File Storage Security:
-
Note the
projectIDanddeploymentNamefrom each object of thescannerStacks. -
Call Create Stack and include the
projectIDand thedeploymentNamevalue in the request body, where theprojectIDis the ID of the GCP project you deployed the stack, and thedeploymentNameis the scanner stack's deployment name.curl --location --request POST 'https://filestorage.{region}.cloudone.trendmicro.com/api/stacks' \ --header 'Api-Version: v1' \ --header 'Authorization: ApiKey YOUR-API-KEY' \ --header 'Content-Type: application/json' \ --data-raw '{ "type": "scanner", "provider": "gcp", "details": { "deploymentName": "your-fss-scanner", "projectID": "your-gcp-project" } }' -
Note the
stackIDvalue in the API response. This is the scanner stack’s ID. -
Call Describe Stack using the scanner stack's stackID noted in the previous step, and continue calling until the status in the response body becomes
ok.
You have added the scanner stack. -
Deploy a storage stack using the API
Procedure
- Get the output of the Terraform deployment from
terraform.tfstateby accessing the JSON elementsoutputs.storage_stacks_outputs.value. Each object in the array ofstorage_stacks_outputsrepresents a storage stack.storage_stacks_outputsExample:{ "storageStacks":[ { "deploymentName":"your-fss-storage", "projectID":"your-gcp-project-id" } ] } - Add the storage stack to File Storage Security:
-
Call List Stacks to retrieve the scanner stack’s
stackID.-
Note the
projectIDanddeploymentNamefrom each object of thestorageStacks. -
Call Create Stack, and include the previously-noted scanner stack
stackID, theprojectIDand thedeploymentNamein the request body, where theprojectIDis the ID of the GCP project you deployed the stack, and thedeploymentNameis the storage stack's deployment name.curl --location --request POST 'https://filestorage.{region}.cloudone.trendmicro.com/api/stacks' \ --header 'Api-Version: v1' \ --header 'Authorization: ApiKey YOUR-API-KEY' \ --header 'Content-Type: application/json' \ --data-raw '{ "type": "storage", "provider": "gcp", "scannerStack": "your-scanner-stackID", "details": { "deploymentName": "your-fss-storage", "projectID": "your-gcp-project-id" } }'
-
-
Note the
stackIDvalue in the API response. This is the storage stack’s ID. -
Call Describe Stack using the storage stack's
stackIDnoted in the previous step and continue calling until thestatusin the response body becomesok.
You have added the storage stack. -
