Creating a Log
Function
This API is used to create a log.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
ga:logtank:create
Write
logtank *
-
-
-
URI
POST /v1/logtanks
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Specifies the user token. The token can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
logtank |
Yes |
CreateLogtankOption object |
Specifies the request parameters for creating a log. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
resource_type |
Yes |
String |
The type of the resource interconnected with LTS. Range: LISTENER: Listeners |
|
resource_id |
Yes |
String |
Specifies the ID of the resource for which LTS is enabled. |
|
log_group_id |
Yes |
String |
Specifies the log group ID. |
|
log_stream_id |
Yes |
String |
Specifies the log stream ID. |
Response Parameters
Status code: 201
|
Parameter |
Type |
Description |
|---|---|---|
|
logtank |
LogtankDetail object |
Specifies the response parameters for a log. |
|
request_id |
String |
Specifies the request ID. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Specifies the log ID. |
|
domain_id |
String |
Specifies the tenant ID. |
|
project_id |
String |
Specifies the project ID. |
|
resource_type |
String |
The type of the resource interconnected with LTS. Range: LISTENER: Listeners |
|
resource_id |
String |
Specifies the ID of the resource for which LTS is enabled. |
|
log_group_id |
String |
Specifies the log group ID. |
|
log_stream_id |
String |
Specifies the log stream ID. |
|
status |
String |
Specifies the provisioning status. The value can be one of the following:
|
|
created_at |
String |
Specifies the time when the log was created. |
|
updated_at |
String |
Specifies the time when the log was updated. |
Example Requests
Creating a log for a specified listener
POST https://{ga_endpoint}/v1/logtanks
{
"logtank" : {
"resource_type" : "LISTENER",
"resource_id" : "78d425da-4d5f-422f-b13b-40aa3f49bc55",
"log_group_id" : "0b43cca4-a11a-4444-8ac5-2feee53a48ab",
"log_stream_id" : "43afe287-2a2d-4bf2-a67d-8a027b9ed80c"
}
}
Example Responses
Status code: 201
Created.
{
"logtank" : {
"id" : "ac1bf54f-6a23-4074-af77-800648d25bc8",
"domain_id" : "99a3fff0d03c428eac3678da6a7d0f24",
"project_id" : "644056c6947343d498427218e271b545",
"resource_type" : "LISTENER",
"resource_id" : "78d425da-4d5f-422f-b13b-40aa3f49bc55",
"log_group_id" : "0b43cca4-a11a-4444-8ac5-2feee53a48ab",
"log_stream_id" : "43afe287-2a2d-4bf2-a67d-8a027b9ed80c",
"status" : "ACTIVE",
"created_at" : "2019-01-08T01:21:37Z",
"updated_at" : "2019-01-08T01:21:37Z"
},
"request_id" : "ac1bf54f-6a23-4074-af77-800648d25bc8"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
201 |
Created. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank 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