#Create a NetApp DII SWS DataCollectors via API Swagger
1. Log into DII
You need a DII API token to create a DataCollector via API.
You can create a API token refer to below URL.
https://qiita.com/lewip/items/a0f06606be00e06f6d30
2. Click Admin> API Access> API Documentation> Workload Security.
3. Click on "Authorize".
Lets enter API Token first.
4. Enter your API security token in "Value", then click on "Authorize".
5. Click "Close" to authorize.
6. Get Agent/DataCollector UUID first.
To use "Add a collector" API call, you will need;
- Agent UUID
- Collector UUID
1-1. Get Agent UUID.
Click "GET /v1/cloudsecure/agents Retrieve all agents" to expand the field.
1-2. Click "Try it out".
1-3. Click "execute".
1-4. Curl command and Agent UUID for all agents are displayed.
2-1. Get Collector UUID.
Click "GET /v1/cloudsecure/collector-types Retrieve all collector-type by collectorCategory" to expand the field.
2-2. Click "Try it out".
2-3. Click "execute".
2-4. Curl command and DataCollector UUID for Collector types are displayed.
7. Create a DataCollector.
Click "POST "/v1/cloudsecure/collectors Add a collector" to expand the field.
8. Click "Try it out".
9. Enter parameters then click "Execute".
[Parameters]
hostname = Cluster management IP Address
password = User password
sub-datasource-name = SVM name
username = Username
CollectorTypeUuid = DataCollector UUID
name = DataCollector name.
agentUudi = Agent UUID
In this example, I am going to create a;
ONTAP Collector(DataCollector UUID) called "Tokyo" with the cluster management IP address 0.0.0.0(hostname), monitoring svm called "svm01"(sub-datasource-name).
10. Curl command and Response Code are displayed.
Response code is 200, API call is successfully posted.
11. Go back to DII and check the DataCollector is added.
Click Workload Security> Collectors> Data Collectors
In this example, Tokyo DataCollector is sueccessfully added as below.
Create multiple DataCollectors using curl command.
If you would like to setup 100 DataCollectors on SWS, you can use for command to run the curl for 100 times with appropriate parameters.