Creating a Configuration File
Function
This API is used to create a configuration file in a Logstash cluster. The file defines a data migration solution for a Logstash cluster. Based on this configuration file, the Logstash cluster can ingest data from multiple data sources and migrate the data to the specified destinations. A maximum of 50 configuration files can be created for a single cluster.
Calling Method
For details, see Calling APIs.
URI
POST /v1.0/{project_id}/clusters/{cluster_id}/lgsconf/submit
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID. For details about how to obtain the project ID and name, see Obtaining the Project ID and Name. Constraints N/A Range Project ID of an account. The value contains 32 characters, consisting of lowercase letters and digits. Default Value N/A |
| cluster_id | Yes | String | Definition ID of the cluster where the configuration file is to be created. For details about how to obtain the cluster ID, see Obtaining the Cluster ID. Constraints N/A Range The value is a UUID containing 36 characters. Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Definition Configuration file name. Constraints N/A Range The value can contain 4 to 32 characters and must start with a letter. Only digits, letters, hyphens (-), and underscores (_) are allowed. Default Value N/A |
| conf_content | Yes | String | Definition Content of the Logstash configuration file. Constraints The file size cannot exceed 50 KB. Range N/A Default Value N/A |
| setting | Yes | setting object | Definition: Configure an entity object. Constraints: N/A Value range: N/A Default value: N/A |
| sensitive_words | No | Array of strings | Definition: Sensitive character replacement. Enter the sensitive character strings you want to hide. For items that you enter in this box, the corresponding strings will be replaced with *** in the configuration file. Constraints: You can enter a maximum of 20 strings, each with a maximum length of 512 bytes. Value range: N/A Default value: N/A |
| desc | No | String | Definition Configuration file description. Constraints N/A Range The value can contain at most 128 characters. Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| workers | No | Integer | Definition Number of worker threads that execute the Filters and Outputs phase of the pipeline in parallel. Constraints N/A Range 1 to 5 times the number of CPU cores of the node. Default Value Number of CPU cores of the node. |
| batch_size | No | Integer | Definition Maximum number of events collected from inputs by a single worker thread before executing its filters and outputs. Increasing this value increases memory overhead. Constraints N/A Range 1 to 100000 Default Value 125 |
| batch_delay_ms | No | Integer | Definition: Minimum waiting time of an event to be scheduled by the pipeline. The unit is millisecond. Constraints: N/A Value range: 1-600000 Default value: 50 |
| queue_type | Yes | String | Definition: An internal queue for event buffering. Constraints: N/A Value range: Default value: N/A |
| queue_check_point_writes | No | Integer | Definition Maximum number of written events before forcing a checkpoint when persistent queues are enabled. Constraints This parameter takes effect only when queue_type is set to persisted. Range 1 to 100000 Default Value 1024 |
| queue_max_bytes_mb | No | Integer | Definition Total capacity (in MB) of a persistent queue if persistent queues are used. Ensure that the disk capacity is greater than the value of this parameter. Constraints This parameter takes effect only when queue_type is set to persisted. Range 1-10240 Default Value 1024 |
Response Parameters
Status code: 200
Request succeeded.
None
Example Requests
Configure an entity object.
POST https://{Endpoint}/v1.0/{project_id}/clusters/4f3deec3-efa8-4598-bf91-560aad1377a3/lgsconf/submit
{
"name" : "conf",
"desc" : "This is a description of a configuration file.",
"conf_content" : "xxxxxxxx",
"setting" : {
"workers" : 2,
"batch_size" : 125,
"batch_delay_ms" : 50,
"queue_type" : "persisted",
"queue_check_point_writes" : 1024,
"queue_max_bytes_mb" : 1024
}
} Example Responses
None
Status Codes
| Status Code | Description |
|---|---|
| 200 | Request succeeded. |
| 400 | Invalid request. The client should modify the request instead of re-initiating it. |
| 409 | The request cannot be processed due to a conflict. This status code indicates that the resource that the client attempts to create already exits, or the requested update failed due to a conflict. |
| 412 | The server did not meet one of the preconditions contained in the request. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot