...
Paste code macro |
---|
language | http |
---|
theme | Sunburst |
---|
|
DELETE
https://${CloudVendor}.${CountryCode}.machlake.com/v1/lakes/${lake_id}/tags
Content-Type: application/json; charset=utf8
x-api-key: {API Key}
|
Parameters
Optional | Type | Description | Example |
---|
name | String | tag name | &name=tag1 |
Request Example
Paste code macro |
---|
language | http |
---|
theme | Sunburst |
---|
|
DELETE
https://aws1.us.machlake.com/v1/lakes/xbacd1234/tags?name=newtag02
Content-Type: application/json; charset=utf8
x-api-key: {API Key} |
Response Example
Paste code macro |
---|
language | json |
---|
theme | Sunburst |
---|
|
Status 200
{
"success": true,
"reason": "delete tag meta success"
} |
Sample Code
In this sample, tag contains sensor1, sensor2, so if that not contains then result should be different
Expand |
---|
|
github Code Block |
---|
chcp 65001
:: Text Encoding to UTF-8 in CMD
:: Example For Delete Tag API by using curl in window script
:: written by yeony kim
:: sensor1, sensor2 is applied in lake
set API_KEY=YOUR_API_KEY
set LAKE_ID=YOUR_LAKE_ID
set CLOUD_VENDOR=YOUR_CLOUD_VENDOR
set CLOUD_REGION=YOUR_CLOUD_REGION
set CONTENT_HEADER="Content-Type: application/json"
set API_HEADER="x-api-key: %API_KEY%"
set URL="https://%CLOUD_VENDOR%.%CLOUD_REGION%.machlake.com/v1/lakes/%LAKE_ID%/tags"
:: ------------------------------------------------------------------------------------------------- ::
:: CASE - delete tag
TAG_NAME=sensor1
curl -k -X DELETE %URL% -H %CONTENT_HEADER% -H %API_HEADER% \
--data-urlencode "name=%TAG_NAME%"
:: Return Format
:: {
:: "success":true,
:: "reason":"delete tag meta success"
:: }
:: ------------------------------------------------------------------------------------------------- #
:: CASE - delete error when no exist tag name
TAG_NAME=wrong_name
curl -k -X DELETE %URL% -H %CONTENT_HEADER% -H %API_HEADER% \
--data-urlencode "name=%TAG_NAME%"
:: Return Format
:: status code:400 Bad Request
:: {
:: "success":false,
:: "reason":"no such name:wrong_name | _of_tag}"
} |
Parameters
no parameters
Request Example
Paste code macro |
---|
language | http |
---|
theme | Sunburst |
---|
|
DELETE https://lake01.machlake.com/lakes/tags
Content-Type: application/json; charset=utf8
x-api-key: {API Key}
{
"name" : "newtag02"
} |
Response Example
Paste code macro |
---|
language | json |
---|
theme | Sunburst |
---|
|
Status 200
|
Expand |
---|
|
github Code Block |
---|
| # Text Encoding to UTF-8 in CMD
# Example For Delete Tag API by using curl in ubuntu
LAKE_ID=$YOUR_LAKE_ID
API_KEY=$YOUR_API_KEY
CLOUD_VENDOR=$YOUR_CLOUD_VENDOR
CLOUD_REGION=$YOUR_CLOUD_REGION
CONTENT_HEADER=Content-Type:application/json
API_HEADER=x-api-key:$API_KEY
URL=https://${CLOUD_VENDOR}.${CLOUD_REGION}.machlake.com/v1/lakes/${LAKE_ID}/tags
# ------------------------------------------------------------------------------------------------- #
# CASE - delete tag
TAG_NAME=sensor1
curl -k -X DELETE $URL -H $CONTENT_HEADER -H $API_HEADER \
--data-urlencode "name=$TAG_NAME"
# Return Format
# {
# "success":true,
# "reason":"delete tag meta success"
# }
# ------------------------------------------------------------------------------------------------- #
# CASE - delete error when no exist tag name
TAG_NAME=wrong_name
curl -k -X DELETE $URL -H $CONTENT_HEADER -H $API_HEADER \
--data-urlencode "name=$TAG_NAME"
# Return Format
# status code:400 Bad Request
# {
# "success":false,
# "reason":"no such name:wrong_name"
# }
|
|
Expand |
---|
|
github Code Block |
---|
| // Example For Delete Tag API by using request in nodejs
// written by yeony kim
// sensor1, sensor2 is applied in lake
// process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
const API_KEY = "YOUR_API_TOKEN";
const LAKE_ID = "YOUR_LAKE_ID";
const CLOUD_VENDOR="CLOUD_VENDOR";
const CLOUD_REGION="CLOUD_REGION";
const URL = `https://${CLOUD_VENDOR}.${CLOUD_REGION}.machlake.com/v1/lakes/${LAKE_ID}/tags`;
var request = require('request');
/* ------------------------------------------------------------------------------------------------- */
// CASE - delete tag
request.delete({
url: URL,
headers: {
"Content-Type": "application/json",
"x-api-key": API_KEY
},
qs: {
name: "sensor1"
}},
function(error, response, body) {
console.log(body);
// Return Format
// {
// "success":true,
// "reason":"delete tag meta success"
// }
})
/* ------------------------------------------------------------------------------------------------- */
// CASE - delete error when no exist tag name
request.delete({
url: URL,
headers: {
"Content-Type": "application/json",
"x-api-key": API_KEY
},
qs: {
name: "sensor1"
}},
function(error, response, body) {
console.log(body);
// Return Format
// status code:400 Bad Request
// {
// "success":false,
// "reason":"no such name:wrong_name"
// }
})
|
|
Expand |
---|
|
github Code Block |
---|
| """
Example For Delete Tag API by using requests in python
written by yeony kim
sensor1, sensor2 is applied in lake
"""
import requests
API_KEY = "YOUR_API_TOKEN"
LAKE_ID = "YOUR_LAKE_ID"
CLOUD_VENDOR="CLOUD_VENDOR"
CLOUD_REGION="CLOUD_REGION"
URL = f"https://{CLOUD_VENDOR}.{CLOUD_REGION}.machlake.com/v1/lakes/{LAKE_ID}/tags"
headers = {
"Content-Type": "application/json",
"x-api-key": API_KEY
}
# ------------------------------------------------------------------------------------------------- #
# CASE - delete tag
params = {
" | status":name": "sensor",
}
response = requests.delete(URL, headers=headers, params=params, verify=False)
print(response.content.decode("utf-8"))
# Return Format
# {
# "success":true,
# " | data": {}
}reason":"delete tag meta success"
# }
# ------------------------------------------------------------------------------------------------- #
# CASE - delete error when no exist tag name
params = {
"name": "wrong_name",
}
response = requests.delete(URL, headers=headers, params=params, verify=False)
print(response.content.decode("utf-8"))
# Return Format
# status code:400 Bad Request
# {
# "success":false,
# "reason":"no such name:wrong_name"
# }
|
|