Skip to content

Commit

Permalink
Merge pull request #592 from awslabs/patch/v1.1.0-ft
Browse files Browse the repository at this point in the history
docs(others): api key
  • Loading branch information
yanbasic authored Apr 15, 2024
2 parents 9e612b7 + a03926f commit d8e05ed
Show file tree
Hide file tree
Showing 32 changed files with 21,664 additions and 13 deletions.
30 changes: 30 additions & 0 deletions docs/en/developer-guide/api-access.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
If you need to call the API to perform data detection, please configure the ApiKey in the environment variables of Lambda first. The system will verify the authenticity of the ApiKey through the specified field in the request header. For detailed instructions, please refer to this document.

## Custom Security Key

- Step 1: Log in to the AWS console, select the Lambda option, and enter the Lambda console.

![lambda控制台](images/lambda-console.png)

- Step 2: Select the corresponding deployment region in the upper right corner, and enter the Functions list page.
- Step 3: Enter "APIAPIFunction" in the search box, and select the corresponding Function from the drop-down list.

![api-fun](images/api-access-3.png)

- Step 4: Click on the Function name link to enter the Function page, then select the Configuration tab.
- Step 5: Select the Environment variables tab on the left side, click the edit button on the upper right corner of the right panel, and add environment variables.


![env-tab](images/api-access-5.png)

- Step 6: On the environment variable editing page, add a key-value pair, with the key as the fixed value "ApiKey", and the value as the user-defined content. This value will be used for validation when accessing the API later.

![edit-env](images/api-access-6.png)

## Security Verification

All API requests require security verification using an API key. Your API key should be included in the HTTP header of all API requests as x-api-key as follows:

```config
x-api-key: xxxxxxxxxxxxxxxxxxxx
```
23 changes: 23 additions & 0 deletions docs/en/developer-guide/api-preview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
This document only lists the main operation interfaces for each module. For more details, please refer to [OPENAPI](../openapi.json)

## APIs Related to Data Sources
| url | Function | Rate Limit (requests per second) |
|--------------------|-------------------|-------|
| /data-source/add_account | Add Account | 10 |
| /data-source/delete_account | Delete Account | 10 |
| /data-source/add-jdbc-conn | Add Data Source | 10 |
| /data-source/update-jdbc-conn | Edit Data Source | 10 |
| /data-source/delete-jdbc | Delete Data Source | 10 |


## APIs Related to Job
| url | Function | Rate Limit (requests per second) |
|--------------------|-------------------|-------|
| /discovery-jobs | Create Job | 10 |
| /discovery-jobs/{job_id}/start | Start Job | 10 |

## APIs Related to Identifier
| url | Function | Rate Limit (requests per second) |
|--------------------|-------------------|-------|
| /template/identifiers | Create Recognition Rule | 10 |
| /template/template-mappings | Add Recognition Rule to Template | 10 |
247 changes: 247 additions & 0 deletions docs/en/developer-guide/datasource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
## Add Account

POST /data-source/add_account

Create an account under the specified provider.

### Request
|Parameter Name |Required|Type|Description|
|---|---|---|---|
|account_provider|Yes|integer|Provider ID|
|account_id|Yes|string||
|region|Yes|string||

> Response Examples
> Success
```json
{
"status": "success",
"code": 1001,
"message": "Operation succeeded"
}
```

### Responses

|HTTP Status Code |Meaning|Description|Data schema|
|---|---|---|---|
|1001|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline|

### Responses Data Schema

HTTP Status Code **1001**

|Name|Type|Required|Restrictions|Title|description|
|---|---|---|---|---|---|
|» message|string|true|none||none|
|» code|integer|true|none||none|


## Delete Account

POST /data-source/delete_account

Delete an account under the specified provider.

### Request
|Parameter Name |Required|Type|Description|
|---|---|---|---|
|account_provider|Yes|integer|Provider ID|
|account_id|Yes|string|-|
|region|Yes|string|-|

> Response Examples
> Success
```json
{
"status": "success",
"code": 1001,
"message": "Operation succeeded"
}
```

### Responses

|HTTP Status Code |Meaning|Description|Data schema|
|---|---|---|---|
|1001|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline|

### Responses Data Schema

HTTP Status Code **1001**

|Name|Type|Required|Restrictions|Title|description|
|---|---|---|---|---|---|
|» message|string|true|none||none|
|» code|integer|true|none||none|

## Add Datasource

POST /data-source/add-jdbc-conn

Add a data source under the specified account.

### Request
|Parameter Name |Required|Type|Description|
|---|---|---|---|
|instance_id|Yes|string|-|
|account_provider_id|Yes|integer|Provider ID|
|account_id|Yes|string|-|
|region|Yes|string|-|
|description|No|string|-|
|jdbc_connection_url|Yes|string|-|
|jdbc_connection_schema|Yes|string|-|
|jdbc_enforce_ssl|No|string|true/false|
|kafka_ssl_enabled|No|string|true/false|
|master_username|Yes|string|*|
|password|Yes|string|*|
|secret|Yes|string|*|
|skip_custom_jdbc_cert_validation|No|string|-|
|custom_jdbc_cert|No|string|-|
|custom_jdbc_cert_string|No|string|-|
|network_availability_zone|Yes|string|-|
|network_subnet_id|Yes|string|-|
|network_sg_id|Yes|string|-|
|glue_crawler_last_updated|No|datetime|-|
|creation_time|No|string|-|
|last_updated_time|No|string|-|
|jdbc_driver_class_name|No|string|-|
|jdbc_driver_jar_uri|No|string|-|
|create_type|Yes|integer|-|

<font size="2">*: master_username/password and secret cannot be empty at the same time.</font>

> Response Examples
> Success
```json
{
"status": "success",
"code": 1001,
"message": "Operation succeeded"
}
```

### Responses

|HTTP Status Code |Meaning|Description|Data schema|
|---|---|---|---|
|1001|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline|

### Responses Data Schema

HTTP Status Code **1001**

|Name|Type|Required|Restrictions|Title|description|
|---|---|---|---|---|---|
|» message|string|true|none||none|
|» code|integer|true|none||none|

## Edit Datasource

POST /data-source/delete_account

Edit a data source under the specified account.

### Request
|Parameter Name |Required|Type|Description|
|---|---|---|---|
|instance_id|Yes|string|-|
|account_provider_id|Yes|integer|Provider ID|
|account_id|Yes|string|-|
|region|Yes|string|-|
|description|No|string|-|
|jdbc_connection_url|Yes|string|-|
|jdbc_connection_schema|Yes|string|-|
|jdbc_enforce_ssl|No|string|true/false|
|kafka_ssl_enabled|No|string|true/false|
|master_username|Yes|string|*|
|password|Yes|string|*|
|secret|Yes|string|*|
|skip_custom_jdbc_cert_validation|No|string|-|
|custom_jdbc_cert|No|string|-|
|custom_jdbc_cert_string|No|string|-|
|network_availability_zone|Yes|string|-|
|network_subnet_id|Yes|string|-|
|network_sg_id|Yes|string|-|
|glue_crawler_last_updated|No|datetime|-|
|creation_time|No|string|-|
|last_updated_time|No|string|-|
|jdbc_driver_class_name|No|string|-|
|jdbc_driver_jar_uri|No|string|-|
|create_type|Yes|integer|-|

<font size="2">*: master_username/password and secret cannot be empty at the same time.</font>

> Response Examples
> Success
```json
{
"status": "success",
"code": 1001,
"message": "Operation succeeded"
}
```

### Responses

|HTTP Status Code |Meaning|Description|Data schema|
|---|---|---|---|
|1001|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline|

### Responses Data Schema

HTTP Status Code **1001**

|Name|Type|Required|Restrictions|Title|description|
|---|---|---|---|---|---|
|» message|string|true|none||none|
|» code|integer|true|none||none|

## Delete Datasource

POST /data-source/delete-jdbc

Delete a data source under the specified account.

### Request
|Parameter Name |Required|Type|Description|
|---|---|---|---|
|account_provider|Yes|integer|Provider ID|
|account_id|Yes|string||
|region|Yes|string||
|instances|Yes|list<string>||

> Response Examples
> Success
```json
{
"status": "success",
"code": 1001,
"message": "Operation succeeded"
}
```

### Responses

|HTTP Status Code |Meaning|Description|Data schema|
|---|---|---|---|
|1001|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline|

### Responses Data Schema

HTTP Status Code **1001**

|Name|Type|Required|Restrictions|Title|description|
|---|---|---|---|---|---|
|» message|string|true|none||none|
|» code|integer|true|none||none|
88 changes: 88 additions & 0 deletions docs/en/developer-guide/identifier.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
## Create Identifier

POST /template/identifiers

Create Identifier.

### Request
|Parameter Name |Required|Type|Description|
|---|---|---|---|
|description|No|string|-|
|type|No|integer|Default:1|
|name|Yes|string|-|
|classification|No|integer|Default:1|
|privacy|No|integer|Default:0|
|rule|No|string|*|
|header_keywords|No|string|*|
|max_distance|No|integer|-|
|min_occurrence|No|integer|-|
|props|No|string|-|
|exclude_keywords|No|string|-|

> Response Examples
> Success
```json
{
"status": "success",
"code": 1001,
"message": "Operation succeeded"
}
```

### Responses

|HTTP Status Code |Meaning|Description|Data schema|
|---|---|---|---|
|1001|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline|

### Responses Data Schema

HTTP Status Code **1001**

|Name|Type|Required|Restrictions|Title|description|
|---|---|---|---|---|---|
|» message|string|true|none||none|
|» code|integer|true|none||none|


## Add identifier into template

POST /template/template-mappings

Add identifier into template.

### Request
|Parameter Name |Required|Type|Description|
|---|---|---|---|
|template_id|Yes|integer|Template ID|
|identifier_ids|Yes|array|eg: [1,2,3]|
|status|No|string|Default:0|

> Response Examples
> Success
```json
{
"status": "success",
"code": 1001,
"message": "Operation succeeded"
}
```

### Responses

|HTTP Status Code |Meaning|Description|Data schema|
|---|---|---|---|
|1001|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline|

### Responses Data Schema

HTTP Status Code **1001**

|Name|Type|Required|Restrictions|Title|description|
|---|---|---|---|---|---|
|» message|string|true|none||none|
|» code|integer|true|none||none|
Binary file added docs/en/developer-guide/images/api-access-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/en/developer-guide/images/api-access-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/en/developer-guide/images/api-access-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d8e05ed

Please sign in to comment.