diff --git a/docs/css/api-ref/ALL_META.TXT.json b/docs/css/api-ref/ALL_META.TXT.json new file mode 100644 index 000000000..6c4865a6f --- /dev/null +++ b/docs/css/api-ref/ALL_META.TXT.json @@ -0,0 +1,422 @@ +[ + { + "uri":"css_03_0001.html", + "product_code":"css", + "code":"1", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Before You Start", + "title":"Before You Start", + "githuburl":"" + }, + { + "uri":"css_03_0051.html", + "product_code":"css", + "code":"2", + "des":"Welcome to Cloud Search Service API Reference. Cloud Search Service (CSS) provides hosted, distributed search engine services. It is fully compatible with open-source Ela", + "doc_type":"api", + "kw":"Overview,Before You Start,API Reference", + "title":"Overview", + "githuburl":"" + }, + { + "uri":"css_03_0053.html", + "product_code":"css", + "code":"3", + "des":"An endpoint is the request address for calling an API. Endpoints vary depending on services and regions. For the endpoints of all services, see Regions and Endpoints.", + "doc_type":"api", + "kw":"Endpoints,Before You Start,API Reference", + "title":"Endpoints", + "githuburl":"" + }, + { + "uri":"css_03_0056.html", + "product_code":"css", + "code":"4", + "des":"In CSS, Elasticsearch 7.6.2 and 7.9.3 and Kibana 7.6.2 and 7.9.3 are supported.", + "doc_type":"api", + "kw":"Supported Cluster Versions,Before You Start,API Reference", + "title":"Supported Cluster Versions", + "githuburl":"" + }, + { + "uri":"css_03_0057.html", + "product_code":"css", + "code":"5", + "des":"The CSS API is a self-developed API that complies with RESTful API design specifications. You can call CSS APIs to implement the CSS functions described in Table 1.", + "doc_type":"api", + "kw":"API Overview,API Reference", + "title":"API Overview", + "githuburl":"" + }, + { + "uri":"iam_01_0023.html", + "product_code":"css", + "code":"6", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Calling APIs", + "title":"Calling APIs", + "githuburl":"" + }, + { + "uri":"iam_02_0008.html", + "product_code":"css", + "code":"7", + "des":"This section describes the structure of a RESTful API request, and uses the API for Obtaining a User Token as an example to describe how to call an API. A token is a user", + "doc_type":"api", + "kw":"Making an API Request,Calling APIs,API Reference", + "title":"Making an API Request", + "githuburl":"" + }, + { + "uri":"iam_02_0510.html", + "product_code":"css", + "code":"8", + "des":"CSS supports token authentication.The validity period of a token is 24 hours. When using a token for authentication, cache it to prevent frequently calling the IAM API.A ", + "doc_type":"api", + "kw":"Authentication,Calling APIs,API Reference", + "title":"Authentication", + "githuburl":"" + }, + { + "uri":"iam_02_0511.html", + "product_code":"css", + "code":"9", + "des":"After sending a request, you will receive a response containing the status code, response header, and response body.A status code is a group of digits, ranging from 1xx t", + "doc_type":"api", + "kw":"Returned Values,Calling APIs,API Reference", + "title":"Returned Values", + "githuburl":"" + }, + { + "uri":"css_03_0008.html", + "product_code":"css", + "code":"10", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Cluster Management APIs", + "title":"Cluster Management APIs", + "githuburl":"" + }, + { + "uri":"css_03_0019.html", + "product_code":"css", + "code":"11", + "des":"This API is used to create a cluster.Table 2 describes the request parameters.Table 11 describes the response parameters.Example requestExample response{\n \"cluster\": {\n ", + "doc_type":"api", + "kw":"Creating a Cluster,Cluster Management APIs,API Reference", + "title":"Creating a Cluster", + "githuburl":"" + }, + { + "uri":"css_03_0018.html", + "product_code":"css", + "code":"12", + "des":"This API is used to query and display the cluster list and cluster status.NoneTable 2 describes the response parameters.Example requestExample request of querying cluster", + "doc_type":"api", + "kw":"Querying the List of Clusters,Cluster Management APIs,API Reference", + "title":"Querying the List of Clusters", + "githuburl":"" + }, + { + "uri":"css_03_0026.html", + "product_code":"css", + "code":"13", + "des":"This API is used to query and display details about a cluster.NoneTable 2 describes the response parameters.Example requestExample responseTable 7 describes the status co", + "doc_type":"api", + "kw":"Querying Cluster Details,Cluster Management APIs,API Reference", + "title":"Querying Cluster Details", + "githuburl":"" + }, + { + "uri":"css_03_0020.html", + "product_code":"css", + "code":"14", + "des":"This API is used to delete a cluster. All resources, including customer data, of the deleted cluster will be released. For data security reasons, create a snapshot for th", + "doc_type":"api", + "kw":"Deleting a Cluster,Cluster Management APIs,API Reference", + "title":"Deleting a Cluster", + "githuburl":"" + }, + { + "uri":"css_03_0021.html", + "product_code":"css", + "code":"15", + "des":"This API is used to restart a cluster. Restarting the cluster will interrupt ongoing services.NoneExample requestExample responseTable 3 describes the status code.", + "doc_type":"api", + "kw":"Restarting a Cluster,Cluster Management APIs,API Reference", + "title":"Restarting a Cluster", + "githuburl":"" + }, + { + "uri":"css_03_0025.html", + "product_code":"css", + "code":"16", + "des":"This API is used to scale out a cluster with only common nodes. Clusters with master, client, or cold data nodes cannot use this API.Table 2 describes the request paramet", + "doc_type":"api", + "kw":"Scaling Out a Cluster with only Common Nodes,Cluster Management APIs,API Reference", + "title":"Scaling Out a Cluster with only Common Nodes", + "githuburl":"" + }, + { + "uri":"css_03_0038.html", + "product_code":"css", + "code":"17", + "des":"This API is used to scale out a cluster with special nodes. That is, if a cluster has master, client, or cold data nodes, this API is used for scale-out.Table 2 describes", + "doc_type":"api", + "kw":"Scaling Out a Cluster with Special Nodes,Cluster Management APIs,API Reference", + "title":"Scaling Out a Cluster with Special Nodes", + "githuburl":"" + }, + { + "uri":"css_03_0023.html", + "product_code":"css", + "code":"18", + "des":"This API is used to query and display the IDs of supported instance flavors.NoneTable 2 describes the response parameters.Example requestGET /v1.0/6204a5bd270343b5885144c", + "doc_type":"api", + "kw":"Obtaining the List of Instance Flavors,Cluster Management APIs,API Reference", + "title":"Obtaining the List of Instance Flavors", + "githuburl":"" + }, + { + "uri":"css_03_0050.html", + "product_code":"css", + "code":"19", + "des":"This API is used to download the HTTPS certificate file of the server.NoneExample requestExample responseAfter obtaining the preceding character string, run the following", + "doc_type":"api", + "kw":"Downloading a Certificate File,Cluster Management APIs,API Reference", + "title":"Downloading a Certificate File", + "githuburl":"" + }, + { + "uri":"css_03_0077.html", + "product_code":"css", + "code":"20", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Tag Management APIs", + "title":"Tag Management APIs", + "githuburl":"" + }, + { + "uri":"css_03_0078.html", + "product_code":"css", + "code":"21", + "des":"This API is used to query the tag information about a specified cluster.NoneTable 2 describes the response parameters.Example requestExample responseTable 4 describes the", + "doc_type":"api", + "kw":"Querying Tags of a Specified Cluster,Tag Management APIs,API Reference", + "title":"Querying Tags of a Specified Cluster", + "githuburl":"" + }, + { + "uri":"css_03_0079.html", + "product_code":"css", + "code":"22", + "des":"This API is used to query all tags in a specified region.NoneTable 2 describes the response parameters.Example requestExample responseTable 4 describes the status code.", + "doc_type":"api", + "kw":"Querying All Tags,Tag Management APIs,API Reference", + "title":"Querying All Tags", + "githuburl":"" + }, + { + "uri":"css_03_0083.html", + "product_code":"css", + "code":"23", + "des":"This API is used to add tags to a cluster. A cluster can have a maximum of 10 tags.NoneExample requestPOST /v1.0/458d905f22da49c39f609e3347d65723/css-cluster/4f3deec3-efa", + "doc_type":"api", + "kw":"Adding Tags to a Cluster,Tag Management APIs,API Reference", + "title":"Adding Tags to a Cluster", + "githuburl":"" + }, + { + "uri":"css_03_0081.html", + "product_code":"css", + "code":"24", + "des":"This API is used to add or delete tags to or from a specified cluster in batches. Tag Management Service (TMS) uses this API to batch manage tags of a cluster. A cluster ", + "doc_type":"api", + "kw":"Adding or Deleting Cluster Tags in Batches,Tag Management APIs,API Reference", + "title":"Adding or Deleting Cluster Tags in Batches", + "githuburl":"" + }, + { + "uri":"css_03_0082.html", + "product_code":"css", + "code":"25", + "des":"This API is used to delete specified cluster tags.NoneNoneExample requestDELETE /v1.0/458d905f22da49c39f609e3347d65723/css-cluster/4f3deec3-efa8-4598-bf91-560aad1377a3/ta", + "doc_type":"api", + "kw":"Deleting Specified Cluster Tags,Tag Management APIs,API Reference", + "title":"Deleting Specified Cluster Tags", + "githuburl":"" + }, + { + "uri":"css_03_0010.html", + "product_code":"css", + "code":"26", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Snapshot Management APIs", + "title":"Snapshot Management APIs", + "githuburl":"" + }, + { + "uri":"css_03_0037.html", + "product_code":"css", + "code":"27", + "des":"The API for automatically configuring a cluster snapshot can automatically create OBS buckets and agencies for storing snapthos. If you have multiple clusters, an OBS buc", + "doc_type":"api", + "kw":"(Not Recommended) Automatically Configuring Basic Settings of a Cluster Snapshot,Snapshot Management", + "title":"(Not Recommended) Automatically Configuring Basic Settings of a Cluster Snapshot", + "githuburl":"" + }, + { + "uri":"css_03_0030.html", + "product_code":"css", + "code":"28", + "des":"Using this API will automatically enable the snapshot function.This API is used to modify the basic configurations of a cluster snapshot. The basic configurations include", + "doc_type":"api", + "kw":"Modifying Basic Configurations of a Cluster Snapshot,Snapshot Management APIs,API Reference", + "title":"Modifying Basic Configurations of a Cluster Snapshot", + "githuburl":"" + }, + { + "uri":"css_03_0031.html", + "product_code":"css", + "code":"29", + "des":"This API is used to set parameters related to automatic snapshot creation. By default, a snapshot is created per day.Table 2 describes the request parameters.NoneExample ", + "doc_type":"api", + "kw":"Setting the Automatic Snapshot Creation Policy,Snapshot Management APIs,API Reference", + "title":"Setting the Automatic Snapshot Creation Policy", + "githuburl":"" + }, + { + "uri":"css_03_0032.html", + "product_code":"css", + "code":"30", + "des":"This API is used to query the automatic snapshot creation policy for a cluster.NoneTable 2 describes the response parameters.Example requestExample responseTable 3 descri", + "doc_type":"api", + "kw":"Querying the Automatic Snapshot Creation Policy for a Cluster,Snapshot Management APIs,API Reference", + "title":"Querying the Automatic Snapshot Creation Policy for a Cluster", + "githuburl":"" + }, + { + "uri":"css_03_0033.html", + "product_code":"css", + "code":"31", + "des":"This API is used to manually create a snapshot.Table 2 describes the request parameters.Table 3 describes the response parameters.Example requestExample responseTable 5 d", + "doc_type":"api", + "kw":"Manually Creating a Snapshot,Snapshot Management APIs,API Reference", + "title":"Manually Creating a Snapshot", + "githuburl":"" + }, + { + "uri":"css_03_0034.html", + "product_code":"css", + "code":"32", + "des":"This API is used to query all snapshots of a cluster.NoneExample requestExample responseTable 5 describes the status code.", + "doc_type":"api", + "kw":"Querying the List of Snapshots,Snapshot Management APIs,API Reference", + "title":"Querying the List of Snapshots", + "githuburl":"" + }, + { + "uri":"css_03_0035.html", + "product_code":"css", + "code":"33", + "des":"This API is used to manually restore a snapshot.Table 2 describes the request parameters.NoneExample requestExample responseThe return value is empty.Table 3 describes th", + "doc_type":"api", + "kw":"Restoring a Snapshot,Snapshot Management APIs,API Reference", + "title":"Restoring a Snapshot", + "githuburl":"" + }, + { + "uri":"css_03_0036.html", + "product_code":"css", + "code":"34", + "des":"This API is used to delete a snapshot.NoneNoneExample requestTable 2 describes the status code.", + "doc_type":"api", + "kw":"Deleting a Snapshot,Snapshot Management APIs,API Reference", + "title":"Deleting a Snapshot", + "githuburl":"" + }, + { + "uri":"css_03_0039.html", + "product_code":"css", + "code":"35", + "des":"This API is used to disable the snapshot function.NoneNoneExample requestTable 2 describes the status code.", + "doc_type":"api", + "kw":"Disabling the Snapshot Function,Snapshot Management APIs,API Reference", + "title":"Disabling the Snapshot Function", + "githuburl":"" + }, + { + "uri":"css_03_0040.html", + "product_code":"css", + "code":"36", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Common Parameters", + "title":"Common Parameters", + "githuburl":"" + }, + { + "uri":"css_03_0071.html", + "product_code":"css", + "code":"37", + "des":"A project ID or project name is required in some API requests. You need to obtain the project ID and name before calling an API.Log in to the console.In the upper right c", + "doc_type":"api", + "kw":"Obtaining a Project ID and Name,Common Parameters,API Reference", + "title":"Obtaining a Project ID and Name", + "githuburl":"" + }, + { + "uri":"css_03_0073.html", + "product_code":"css", + "code":"38", + "des":"Table 1 describes the common request parameters.", + "doc_type":"api", + "kw":"Common Request Parameters,Common Parameters,API Reference", + "title":"Common Request Parameters", + "githuburl":"" + }, + { + "uri":"css_03_0074.html", + "product_code":"css", + "code":"39", + "des":"Table 1 describes common response headers.", + "doc_type":"api", + "kw":"Common Response Parameters,Common Parameters,API Reference", + "title":"Common Response Parameters", + "githuburl":"" + }, + { + "uri":"css_03_0075.html", + "product_code":"css", + "code":"40", + "des":"Table 1 describes the status code.", + "doc_type":"api", + "kw":"Status Code,Common Parameters,API Reference", + "title":"Status Code", + "githuburl":"" + }, + { + "uri":"css_03_0076.html", + "product_code":"css", + "code":"41", + "des":"No data is returned if an API fails to be invoked. You can locate the cause of an error according to the error code of each API. When the API calling fails, HTTPS status ", + "doc_type":"api", + "kw":"Error Code,Common Parameters,API Reference", + "title":"Error Code", + "githuburl":"" + }, + { + "uri":"css_03_0024.html", + "product_code":"css", + "code":"42", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Change History,API Reference", + "title":"Change History", + "githuburl":"" + } +] \ No newline at end of file diff --git a/docs/css/api-ref/CLASS.TXT.json b/docs/css/api-ref/CLASS.TXT.json new file mode 100644 index 000000000..5478c5d57 --- /dev/null +++ b/docs/css/api-ref/CLASS.TXT.json @@ -0,0 +1,380 @@ +[ + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"css", + "title":"Before You Start", + "uri":"css_03_0001.html", + "doc_type":"api", + "p_code":"", + "code":"1" + }, + { + "desc":"Welcome to Cloud Search Service API Reference. Cloud Search Service (CSS) provides hosted, distributed search engine services. It is fully compatible with open-source Ela", + "product_code":"css", + "title":"Overview", + "uri":"css_03_0051.html", + "doc_type":"api", + "p_code":"1", + "code":"2" + }, + { + "desc":"An endpoint is the request address for calling an API. Endpoints vary depending on services and regions. For the endpoints of all services, see Regions and Endpoints.", + "product_code":"css", + "title":"Endpoints", + "uri":"css_03_0053.html", + "doc_type":"api", + "p_code":"1", + "code":"3" + }, + { + "desc":"In CSS, Elasticsearch 7.6.2 and 7.9.3 and Kibana 7.6.2 and 7.9.3 are supported.", + "product_code":"css", + "title":"Supported Cluster Versions", + "uri":"css_03_0056.html", + "doc_type":"api", + "p_code":"1", + "code":"4" + }, + { + "desc":"The CSS API is a self-developed API that complies with RESTful API design specifications. You can call CSS APIs to implement the CSS functions described in Table 1.", + "product_code":"css", + "title":"API Overview", + "uri":"css_03_0057.html", + "doc_type":"api", + "p_code":"", + "code":"5" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"css", + "title":"Calling APIs", + "uri":"iam_01_0023.html", + "doc_type":"api", + "p_code":"", + "code":"6" + }, + { + "desc":"This section describes the structure of a RESTful API request, and uses the API for Obtaining a User Token as an example to describe how to call an API. A token is a user", + "product_code":"css", + "title":"Making an API Request", + "uri":"iam_02_0008.html", + "doc_type":"api", + "p_code":"6", + "code":"7" + }, + { + "desc":"CSS supports token authentication.The validity period of a token is 24 hours. When using a token for authentication, cache it to prevent frequently calling the IAM API.A ", + "product_code":"css", + "title":"Authentication", + "uri":"iam_02_0510.html", + "doc_type":"api", + "p_code":"6", + "code":"8" + }, + { + "desc":"After sending a request, you will receive a response containing the status code, response header, and response body.A status code is a group of digits, ranging from 1xx t", + "product_code":"css", + "title":"Returned Values", + "uri":"iam_02_0511.html", + "doc_type":"api", + "p_code":"6", + "code":"9" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"css", + "title":"Cluster Management APIs", + "uri":"css_03_0008.html", + "doc_type":"api", + "p_code":"", + "code":"10" + }, + { + "desc":"This API is used to create a cluster.Table 2 describes the request parameters.Table 11 describes the response parameters.Example requestExample response{\n \"cluster\": {\n ", + "product_code":"css", + "title":"Creating a Cluster", + "uri":"css_03_0019.html", + "doc_type":"api", + "p_code":"10", + "code":"11" + }, + { + "desc":"This API is used to query and display the cluster list and cluster status.NoneTable 2 describes the response parameters.Example requestExample request of querying cluster", + "product_code":"css", + "title":"Querying the List of Clusters", + "uri":"css_03_0018.html", + "doc_type":"api", + "p_code":"10", + "code":"12" + }, + { + "desc":"This API is used to query and display details about a cluster.NoneTable 2 describes the response parameters.Example requestExample responseTable 7 describes the status co", + "product_code":"css", + "title":"Querying Cluster Details", + "uri":"css_03_0026.html", + "doc_type":"api", + "p_code":"10", + "code":"13" + }, + { + "desc":"This API is used to delete a cluster. All resources, including customer data, of the deleted cluster will be released. For data security reasons, create a snapshot for th", + "product_code":"css", + "title":"Deleting a Cluster", + "uri":"css_03_0020.html", + "doc_type":"api", + "p_code":"10", + "code":"14" + }, + { + "desc":"This API is used to restart a cluster. Restarting the cluster will interrupt ongoing services.NoneExample requestExample responseTable 3 describes the status code.", + "product_code":"css", + "title":"Restarting a Cluster", + "uri":"css_03_0021.html", + "doc_type":"api", + "p_code":"10", + "code":"15" + }, + { + "desc":"This API is used to scale out a cluster with only common nodes. Clusters with master, client, or cold data nodes cannot use this API.Table 2 describes the request paramet", + "product_code":"css", + "title":"Scaling Out a Cluster with only Common Nodes", + "uri":"css_03_0025.html", + "doc_type":"api", + "p_code":"10", + "code":"16" + }, + { + "desc":"This API is used to scale out a cluster with special nodes. That is, if a cluster has master, client, or cold data nodes, this API is used for scale-out.Table 2 describes", + "product_code":"css", + "title":"Scaling Out a Cluster with Special Nodes", + "uri":"css_03_0038.html", + "doc_type":"api", + "p_code":"10", + "code":"17" + }, + { + "desc":"This API is used to query and display the IDs of supported instance flavors.NoneTable 2 describes the response parameters.Example requestGET /v1.0/6204a5bd270343b5885144c", + "product_code":"css", + "title":"Obtaining the List of Instance Flavors", + "uri":"css_03_0023.html", + "doc_type":"api", + "p_code":"10", + "code":"18" + }, + { + "desc":"This API is used to download the HTTPS certificate file of the server.NoneExample requestExample responseAfter obtaining the preceding character string, run the following", + "product_code":"css", + "title":"Downloading a Certificate File", + "uri":"css_03_0050.html", + "doc_type":"api", + "p_code":"10", + "code":"19" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"css", + "title":"Tag Management APIs", + "uri":"css_03_0077.html", + "doc_type":"api", + "p_code":"10", + "code":"20" + }, + { + "desc":"This API is used to query the tag information about a specified cluster.NoneTable 2 describes the response parameters.Example requestExample responseTable 4 describes the", + "product_code":"css", + "title":"Querying Tags of a Specified Cluster", + "uri":"css_03_0078.html", + "doc_type":"api", + "p_code":"20", + "code":"21" + }, + { + "desc":"This API is used to query all tags in a specified region.NoneTable 2 describes the response parameters.Example requestExample responseTable 4 describes the status code.", + "product_code":"css", + "title":"Querying All Tags", + "uri":"css_03_0079.html", + "doc_type":"api", + "p_code":"20", + "code":"22" + }, + { + "desc":"This API is used to add tags to a cluster. A cluster can have a maximum of 10 tags.NoneExample requestPOST /v1.0/458d905f22da49c39f609e3347d65723/css-cluster/4f3deec3-efa", + "product_code":"css", + "title":"Adding Tags to a Cluster", + "uri":"css_03_0083.html", + "doc_type":"api", + "p_code":"20", + "code":"23" + }, + { + "desc":"This API is used to add or delete tags to or from a specified cluster in batches. Tag Management Service (TMS) uses this API to batch manage tags of a cluster. A cluster ", + "product_code":"css", + "title":"Adding or Deleting Cluster Tags in Batches", + "uri":"css_03_0081.html", + "doc_type":"api", + "p_code":"20", + "code":"24" + }, + { + "desc":"This API is used to delete specified cluster tags.NoneNoneExample requestDELETE /v1.0/458d905f22da49c39f609e3347d65723/css-cluster/4f3deec3-efa8-4598-bf91-560aad1377a3/ta", + "product_code":"css", + "title":"Deleting Specified Cluster Tags", + "uri":"css_03_0082.html", + "doc_type":"api", + "p_code":"20", + "code":"25" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"css", + "title":"Snapshot Management APIs", + "uri":"css_03_0010.html", + "doc_type":"api", + "p_code":"", + "code":"26" + }, + { + "desc":"The API for automatically configuring a cluster snapshot can automatically create OBS buckets and agencies for storing snapthos. If you have multiple clusters, an OBS buc", + "product_code":"css", + "title":"(Not Recommended) Automatically Configuring Basic Settings of a Cluster Snapshot", + "uri":"css_03_0037.html", + "doc_type":"api", + "p_code":"26", + "code":"27" + }, + { + "desc":"Using this API will automatically enable the snapshot function.This API is used to modify the basic configurations of a cluster snapshot. The basic configurations include", + "product_code":"css", + "title":"Modifying Basic Configurations of a Cluster Snapshot", + "uri":"css_03_0030.html", + "doc_type":"api", + "p_code":"26", + "code":"28" + }, + { + "desc":"This API is used to set parameters related to automatic snapshot creation. By default, a snapshot is created per day.Table 2 describes the request parameters.NoneExample ", + "product_code":"css", + "title":"Setting the Automatic Snapshot Creation Policy", + "uri":"css_03_0031.html", + "doc_type":"api", + "p_code":"26", + "code":"29" + }, + { + "desc":"This API is used to query the automatic snapshot creation policy for a cluster.NoneTable 2 describes the response parameters.Example requestExample responseTable 3 descri", + "product_code":"css", + "title":"Querying the Automatic Snapshot Creation Policy for a Cluster", + "uri":"css_03_0032.html", + "doc_type":"api", + "p_code":"26", + "code":"30" + }, + { + "desc":"This API is used to manually create a snapshot.Table 2 describes the request parameters.Table 3 describes the response parameters.Example requestExample responseTable 5 d", + "product_code":"css", + "title":"Manually Creating a Snapshot", + "uri":"css_03_0033.html", + "doc_type":"api", + "p_code":"26", + "code":"31" + }, + { + "desc":"This API is used to query all snapshots of a cluster.NoneExample requestExample responseTable 5 describes the status code.", + "product_code":"css", + "title":"Querying the List of Snapshots", + "uri":"css_03_0034.html", + "doc_type":"api", + "p_code":"26", + "code":"32" + }, + { + "desc":"This API is used to manually restore a snapshot.Table 2 describes the request parameters.NoneExample requestExample responseThe return value is empty.Table 3 describes th", + "product_code":"css", + "title":"Restoring a Snapshot", + "uri":"css_03_0035.html", + "doc_type":"api", + "p_code":"26", + "code":"33" + }, + { + "desc":"This API is used to delete a snapshot.NoneNoneExample requestTable 2 describes the status code.", + "product_code":"css", + "title":"Deleting a Snapshot", + "uri":"css_03_0036.html", + "doc_type":"api", + "p_code":"26", + "code":"34" + }, + { + "desc":"This API is used to disable the snapshot function.NoneNoneExample requestTable 2 describes the status code.", + "product_code":"css", + "title":"Disabling the Snapshot Function", + "uri":"css_03_0039.html", + "doc_type":"api", + "p_code":"26", + "code":"35" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"css", + "title":"Common Parameters", + "uri":"css_03_0040.html", + "doc_type":"api", + "p_code":"", + "code":"36" + }, + { + "desc":"A project ID or project name is required in some API requests. You need to obtain the project ID and name before calling an API.Log in to the console.In the upper right c", + "product_code":"css", + "title":"Obtaining a Project ID and Name", + "uri":"css_03_0071.html", + "doc_type":"api", + "p_code":"36", + "code":"37" + }, + { + "desc":"Table 1 describes the common request parameters.", + "product_code":"css", + "title":"Common Request Parameters", + "uri":"css_03_0073.html", + "doc_type":"api", + "p_code":"36", + "code":"38" + }, + { + "desc":"Table 1 describes common response headers.", + "product_code":"css", + "title":"Common Response Parameters", + "uri":"css_03_0074.html", + "doc_type":"api", + "p_code":"36", + "code":"39" + }, + { + "desc":"Table 1 describes the status code.", + "product_code":"css", + "title":"Status Code", + "uri":"css_03_0075.html", + "doc_type":"api", + "p_code":"36", + "code":"40" + }, + { + "desc":"No data is returned if an API fails to be invoked. You can locate the cause of an error according to the error code of each API. When the API calling fails, HTTPS status ", + "product_code":"css", + "title":"Error Code", + "uri":"css_03_0076.html", + "doc_type":"api", + "p_code":"36", + "code":"41" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"css", + "title":"Change History", + "uri":"css_03_0024.html", + "doc_type":"api", + "p_code":"", + "code":"42" + } +] \ No newline at end of file diff --git a/docs/css/api-ref/PARAMETERS.txt b/docs/css/api-ref/PARAMETERS.txt new file mode 100644 index 000000000..6da8d5f07 --- /dev/null +++ b/docs/css/api-ref/PARAMETERS.txt @@ -0,0 +1,3 @@ +version="" +language="en-us" +type="" \ No newline at end of file diff --git a/docs/css/api-ref/css_03_0001.html b/docs/css/api-ref/css_03_0001.html new file mode 100644 index 000000000..3297a7cd9 --- /dev/null +++ b/docs/css/api-ref/css_03_0001.html @@ -0,0 +1,15 @@ + + +
This API is used to query and display the cluster list and cluster status.
+GET /v1.0/{project_id}/clusters
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
start + |
+No + |
+Integer + |
+Start value of the query. The default value is 1, indicating that the query starts from the first cluster. + |
+
limit + |
+No + |
+Integer + |
+Number of clusters to be queried. The default value is 10, indicating that 10 clusters are queried at a time. + |
+
None
+Table 2 describes the response parameters.
+ +Parameter + |
+Type + |
+Description + |
+
|---|---|---|
clusters + |
+Array of clusters objects + |
+List of cluster objects. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
datastore + |
+Object + |
+Type of the data search engine. For details, see Table 4. + |
+
instances + |
+Array of instances in Table 5. + |
+List of node objects. + |
+
updated + |
+String + |
+Last modification time of a cluster. The format is ISO8601: CCYY-MM-DDThh:mm:ss. + |
+
name + |
+String + |
+Cluster name. + |
+
created + |
+String + |
+Time when a cluster is created. The format is ISO8601: CCYY-MM-DDThh:mm:ss. + NOTE:
+The returned cluster list is sorted by creation time in descending order. Specifically, the cluster with the latest creation time is at the top. + |
+
id + |
+String + |
+Cluster ID. + |
+
status + |
+String + |
+Return value. +
|
+
endpoint + |
+String + |
+IP address and port number of the user used to access the VPC. + |
+
actionProgress + |
+Object + |
+Cluster operation progress, which indicates the progress of cluster creation and expansion in percentage. CREATING specifies the progress of creation. + |
+
actions + |
+Array of strings + |
+Current behavior on a cluster. Value REBOOTING indicates that the cluster is being restarted, GROWING indicates that capacity expansion is being performed on the cluster, RESTORING indicates that the cluster is being restored, and SNAPSHOTTING indicates that the snapshot is being created. + |
+
failed_reasons + |
+Object + |
+Failure cause. If the cluster is in the available status, this parameter is not returned. For details, see Table 6. + |
+
httpsEnable + |
+Boolean + |
+Communication encryption status. +Value false indicates that communication encryption is not enabled. +Value true indicates that communication encryption is enabled. + |
+
authorityEnable + |
+String + |
+Whether to enable authentication. Available values include true and false. Authentication is disabled by default. When authentication is enabled, httpsEnable must be set to true. +
|
+
diskEncrypted + |
+Boolean + |
+Whether disks are encrypted. +
|
+
cmkId + |
+String + |
+Key ID used for disk encryption. + |
+
vpcId + |
+String + |
+VPC ID. + |
+
subnetId + |
+String + |
+Subnet ID. + |
+
securityGroupId + |
+String + |
+Security group ID. + |
+
tags + |
+Array of tags in Table 7. + |
+Tags of a cluster. + |
+
period + |
+Boolean + |
+Whether the cluster is billed. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
type + |
+String + |
+Supported type: elasticsearch + |
+
version + |
+String + |
+Engine version number. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
type + |
+String + |
+Supported type: ess (indicating the Elasticsearch node) + |
+
id + |
+String + |
+Instance ID. + |
+
name + |
+String + |
+Instance name. + |
+
status + |
+String + |
+Instance status. +
|
+
specCode + |
+String + |
+Node specifications. + |
+
azCode + |
+String + |
+AZ to which a node belongs. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
error_code + |
+String + |
+Error code. +
|
+
error_msg + |
+String + |
+Detailed error information. + |
+
GET /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters+
Example 1: Query the first two clusters.
+Method 1
+GET /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters?start=1&limit=2+
GET /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters?limit=2+
Example 2: Query the first 10 clusters.
+GET /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters?start=1&limit=10+
GET /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters?start=1+
{
+ "clusters": [
+ {
+ "datastore": {
+ "type": "elasticsearch",
+ "version": "7.6.2"
+ },
+ "instances": [
+ {
+ "status": "200",
+ "type": "ess",
+ "id": "c8c90973-924d-4201-b9ff-f32279c87d0e",
+ "name": "css-5492-ess-esn-1-1",
+ "specCode": "css.xlarge.2",
+ "azCode": "cn-cmcc1a-01"
+ }
+ ],
+ "updated": "2020-12-01T07:47:34",
+ "name": "css-5492",
+ "created": "2020-12-01T07:47:34",
+ "id": "66ea1e42-4ee2-44ad-bd80-c86e6d8c6b9e",
+ "status": "200",
+ "endpoint": "10.16.0.151:9200",
+ "vpcId": "e7daa617-3ee6-4ff1-b042-8cda4a006a46",
+ "subnetId": "6253dc44-24cd-4c0a-90b3-f965e7f4dcd4",
+ "securityGroupId": "d478041e-bcbe-4d69-a492-b6122d774b7f",
+ "httpsEnable": false,
+ "authorityEnable": false,
+ "diskEncrypted": true,
+ "cmkId": "00f05033-f8ac-4ceb-a1ce-4072fadb6b28",
+ "actionProgress": {},
+ "actions": [],
+ "tags": [],
+ "period": false
+ },
+ {
+ "datastore": {
+ "type": "elasticsearch",
+ "version": "6.2.3"
+ },
+ "instances": [
+ {
+ "status": "200",
+ "type": "ess",
+ "id": "a24adddb-1553-4873-9978-9d064418f903",
+ "name": "css-1d01-ess-esn-1-1",
+ "specCode": "css.xlarge.2",
+ "azCode": "cn-cmcc1a-01"
+ }
+ ],
+ "updated": "2020-11-26T10:08:44",
+ "name": "css-1d01",
+ "created": "2020-11-26T10:08:44",
+ "id": "af5fbac7-b386-4305-b201-820a0f51f4f1",
+ "status": "200",
+ "endpoint": "10.16.0.124:9200",
+ "vpcId": "e7daa617-3ee6-4ff1-b042-8cda4a006a46",
+ "subnetId": "6253dc44-24cd-4c0a-90b3-f965e7f4dcd4",
+ "securityGroupId": "d478041e-bcbe-4d69-a492-b6122d774b7f",
+ "httpsEnable": true,
+ "authorityEnable": false,
+ "diskEncrypted": false,
+ "cmkId": "",
+ "actionProgress": {},
+ "actions": [],
+ "tags": [],
+ "period": false
+ },
+ {
+ "datastore": {
+ "type": "elasticsearch",
+ "version": "7.6.2"
+ },
+ "instances": [
+ {
+ "status": "303",
+ "type": "ess",
+ "id": "071c7ecf-a11d-45bd-9564-201ceb7cfae3",
+ "name": "css-9b36-ess-esn-1-1",
+ "specCode": "css.xlarge.2",
+ "azCode": "cn-cmcc1b-01"
+ }
+ ],
+ "updated": "2020-11-13T14:33:24",
+ "name": "css-9b36",
+ "created": "2020-11-13T14:33:26",
+ "id": "cdb26954-c743-47dd-b23a-b693205eb2da",
+ "status": "303",
+ "endpoint": null,
+ "vpcId": "e7daa617-3ee6-4ff1-b042-8cda4a006a46",
+ "subnetId": "6253dc44-24cd-4c0a-90b3-f965e7f4dcd4",
+ "securityGroupId": "d478041e-bcbe-4d69-a492-b6122d774b7f",
+ "httpsEnable": true,
+ "authorityEnable": true,
+ "diskEncrypted": false,
+ "cmkId": "",
+ "actionProgress": {},
+ "actions": [],
+ "tags": [],
+ "period": false
+ }
+ ]
+}
+
+Table 8 describes the status code.
+ +Status Code + |
+Code + |
+Status Code Description + |
+
|---|---|---|
400 + |
+BadRequest + |
+Invalid request. +The client should not repeat the request without modifications. + |
+
404 + |
+NotFound + |
+The requested resource cannot be found. +The client should not repeat the request without modifications. + |
+
200 + |
+OK + |
+The request is processed successfully. + |
+
This API is used to create a cluster.
+POST /v1.0/{project_id}/clusters
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
Table 2 describes the request parameters.
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
cluster + |
+Yes + |
+Object + |
+Cluster. For details about related parameters, see Table 3. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
instance + |
+Yes + |
+Object + |
+Instance. For details about related parameters, see Table 4. + |
+
datastore + |
+Yes + |
+Object + |
+Type of the data search engine. For details about related parameters, see Table 7. + |
+
name + |
+Yes + |
+String + |
+Cluster name. It contains 4 to 32 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. The value must start with a letter. + |
+
instanceNum + |
+Yes + |
+Integer + |
+Number of clusters. The value range is 1 to 32. + |
+
backupStrategy + |
+No + |
+Object + |
+Automatic snapshot creation. This function is disabled by default. For details about related parameters, see Table 8. + NOTE:
+The automatic snapshot creation policy is enabled only if this parameter is specified. + |
+
diskEncryption + |
+Yes + |
+Object + |
+Whether disks are encrypted. For details about related parameters, see Table 9. + |
+
httpsEnable + |
+No + |
+String + |
+Whether communication is encrypted on the cluster. Available values include true and false. By default, communication is encrypted. +
|
+
authorityEnable + |
+No + |
+Boolean + |
+Whether to enable authentication. Available values include true and false. Authentication is disabled by default. When authentication is enabled, httpsEnable must be set to true. +
|
+
adminPwd + |
+No + |
+String + |
+Password of the cluster user admin in security mode. This parameter is mandatory only when authorityEnable is set to true. + NOTE:
+
|
+
tags + |
+No + |
+Array of tags in Table 10 + |
+Tags in a cluster. + NOTE:
+For details about the tag feature, see the Tag Management Service Overview. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
flavorRef + |
+Yes + |
+String + |
+Instance flavor name. For example: +
|
+
volume + |
+Yes + |
+Object + |
+Information about the volume. For details about related parameters, see Table 5. + |
+
nics + |
+Yes + |
+Object + |
+Subnet information. For details about related parameters, see Table 6. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
volume_type + |
+Yes + |
+String + |
+COMMON: Common I/O +HIGH: High I/O +ULTRAHIGH: Ultra-high I/O + |
+
size + |
+Yes + |
+Integer + |
+Volume size. The minimum value is 40. The value must be a multiple of 4 and 10. +Unit: GB + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
vpcId + |
+Yes + |
+String + |
+VPC ID, which is used for configuring cluster network. + |
+
netId + |
+Yes + |
+String + |
+Subnet ID. All instances in a cluster must have the same subnets and security groups. + |
+
securityGroupId + |
+Yes + |
+String + |
+Security group ID. All instances in a cluster must have the same subnets and security groups. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
version + |
+Yes + |
+String + |
+Engine version. For details about the supported versions, see Supported Cluster Versions. + |
+
type + |
+Yes + |
+String + |
+Cluster type. The default value is Elasticsearch. Currently, the value can only be Elasticsearch. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
period + |
+Yes + |
+String + |
+Time when a snapshot is created every day. Snapshots can only be created on the hour. The time format is the time followed by the time zone, specifically, HH:mm z. In the format, HH:mm refers to the hour time and z refers to the time zone, for example, 00:00 GMT+08:00 and 01:00 GMT+08:00. + |
+
prefix + |
+Yes + |
+String + |
+Prefix of the name of the snapshot that is automatically created. + |
+
keepday + |
+Yes + |
+Integer + |
+Number of days for which automatically created snapshots are reserved. +Value range: 1 to 90 + |
+
bucket + |
+No + |
+String + |
+OBS bucket used for storing backup. If there is snapshot data in an OBS bucket, only the OBS bucket will be used for backup storage and cannot be changed. + |
+
basePath + |
+No + |
+String + |
+Storage path of the snapshot in the OBS bucket. + |
+
agency + |
+No + |
+String + |
+IAM agency used to access OBS. + NOTE:
+If none of the bucket, basePath, and agency parameters are specified, the system will automatically create an OBS bucket and an IAM agency. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
systemEncrypted + |
+Yes + |
+String + |
+Value 1 indicates encryption is performed, and value 0 indicates encryption is not performed. + |
+
systemCmkid + |
+Yes + |
+String + |
+Key ID. +
|
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
key + |
+Yes + |
+String + |
+Tag key. The value can contain 1 to 36 characters. Only digits, letters, hyphens (-) and underscores (_) are allowed. + |
+
value + |
+Yes + |
+String + |
+Tag value. The value can contain 0 to 43 characters. Only digits, letters, hyphens (-) and underscores (_) are allowed. + |
+
Table 11 describes the response parameters.
+ +Parameter + |
+Type + |
+Description + |
+
|---|---|---|
cluster + |
+Object + |
+Cluster. For details, see Table 12. + |
+
Example request
+POST /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters
+{
+ "cluster": {
+ "name": "ES-Test",
+ "instanceNum": 4,
+ "instance": {
+ "flavorRef": "css.large.8",
+ "volume": {
+ "volume_type": "COMMON",
+ "size": 100
+ },
+ "nics": {
+ "vpcId": "fccd753c-91c3-40e2-852f-5ddf76d1a1b2",
+ "netId": "af1c65ae-c494-4e24-acd8-81d6b355c9f1",
+ "securityGroupId": "7e3fed21-1a44-4101-ab29-34e57124f614"
+ }
+ },
+ "httpsEnable": "false",
+ "diskEncryption": {
+ "systemEncrypted": "1",
+ "systemCmkid": "42546bb1-8025-4ad1-868f-600729c341ae"
+ }
+ }
+}
+{
+ "cluster": {
+ "id": "ef683016-871e-48bc-bf93-74a29d60d214",
+ "name": "ES-Test"
+ }
+}
+Table 13 describes the status code.
+ +Status Code + |
+Code + |
+Status Code Description + |
+
|---|---|---|
400 + |
+BadRequest + |
+Invalid request. +The client should not repeat the request without modifications. + |
+
409 + |
+Conflict + |
+The request could not be processed due to a conflict. +This status code indicates that the resource that the client attempts to create already exits, or the request fails to be processed because of the update of the conflict request. + |
+
412 + |
+Precondition Failed + |
+The server does not meet one of the preconditions that the requester puts on the request. + |
+
200 + |
+OK + |
+The request is processed successfully. + |
+
This API is used to delete a cluster. All resources, including customer data, of the deleted cluster will be released. For data security reasons, create a snapshot for the cluster that you want to delete.
+DELETE /v1.0/{project_id}/clusters/{cluster_id}
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
cluster_id + |
+Yes + |
+String + |
+ID of the cluster to be deleted. + |
+
None
+None
+Delete the cluster whose ID is 2a197c4d-5467-4003-931d-83ec49939cf.
+Example request
+DELETE /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/2a197c4d-5467-4003-931d-83ec49939cf+
Example response
+The return value is empty.
+Table 2 describes the status code.
+ +Status Code + |
+Code + |
+Status Code Description + |
+
|---|---|---|
400 + |
+BadRequest + |
+Invalid request. +The client should not repeat the request without modifications. + |
+
404 + |
+NotFound + |
+The requested resource cannot be found. +The client should not repeat the request without modifications. + |
+
200 + |
+OK + |
+The request is processed successfully. + |
+
This API is used to restart a cluster. Restarting the cluster will interrupt ongoing services.
+POST /v1.0/{project_id}/clusters/{cluster_id}/restart
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
cluster_id + |
+Yes + |
+String + |
+ID of the cluster to be restarted. + |
+
None
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
jobId + |
+String + |
+ID of the restart task. + |
+
Example request
+POST /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/47e49a5e-8ced-4d0d-ae15-2af62ac468e3/restart+
Example response
+{
+ "jobId": [
+"ff8080815fa0fa5e015fa365b6300007"
+ ]
+ }
+Table 3 describes the status code.
+ +Status Code + |
+Code + |
+Status Code Description + |
+
|---|---|---|
400 + |
+BadRequest + |
+Invalid request. +The client should not repeat the request without modifications. + |
+
404 + |
+NotFound + |
+The requested resource cannot be found. +The client should not repeat the request without modifications. + |
+
200 + |
+OK + |
+The request is processed successfully. + |
+
This API is used to query and display the IDs of supported instance flavors.
+GET /v1.0/{project_id}/flavors
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
None
+Table 2 describes the response parameters.
+ +Parameter + |
+Type + |
+Description + |
+
|---|---|---|
versions + |
+Array of versions objects + |
+List of engine versions. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
version + |
+String + |
+Engine version. + |
+
type + |
+String + |
+Instance type. The options are ess, ess-cold, ess-master, and ess-client. + |
+
flavors + |
+Array of flavors objects + |
+Flavor list + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
ram + |
+Integer + |
+Memory size of an instance. Unit: GB + |
+
cpu + |
+Integer + |
+Number of vCPUs of an instance. + |
+
name + |
+String + |
+Flavor name. + |
+
region + |
+String + |
+AZ + |
+
diskrange + |
+String + |
+Disk capacity range of an instance. + |
+
flavor_id + |
+String + |
+ID of a flavor. + |
+
GET /v1.0/6204a5bd270343b5885144cf9c8c158d/flavors+
Example response
+{
+ "versions": [
+ {
+ "version": "6.2.3",
+ "flavors": [
+ {
+ "cpu": 1,
+ "ram": 8,
+ "name": "css.medium.8",
+ "region": "eu-de",
+ "diskrange": "40,640",
+ "flavor_id": "6b6c0bcf-750d-4f8a-b6f5-c45a143f5198"
+
+ },
+ {
+ "cpu": 2,
+ "ram": 16,
+ "name": "css.large.8",
+ "region": "eu-de",
+ "diskrange": "40,1280",
+ "flavor_id": "d373e339-3cf4-4c00-9739-2259e9f3ec16"
+
+ },
+ {
+ "cpu": 4,
+ "ram": 32,
+ "name": "css.xlarge.8",
+ "region": "eu-de",
+ "diskrange": "40,2560",
+ "flavor_id": "2d8daf1b-873f-4c2e-a7b9-2f9cbcf2f213"
+
+ },
+ {
+ "cpu": 8,
+ "ram": 64,
+ "name": "css.2xlarge.8",
+ "region": "eu-de",
+ "diskrange": "80,5120",
+ "flavor_id": "b3d33ec6-d58a-40f0-aa51-4f671ce64b2a"
+
+ },
+ {
+ "cpu": 16,
+ "ram": 128,
+ "name": "css.4xlarge.8",
+ "region": "eu-de",
+ "diskrange": "160,10240",
+ "flavor_id": "f74419ca-bc91-4558-b4e2-90eeefb37c6e"
+ }
+ ]
+ }
+ ]
+}
+Table 5 describes the status code.
+ +Status Code + |
+Code + |
+Status Code Description + |
+
|---|---|---|
400 + |
+BadRequest + |
+Invalid request. +The client should not repeat the request without modifications. + |
+
404 + |
+NotFound + |
+The requested resource cannot be found. +The client should not repeat the request without modifications. + |
+
200 + |
+OK + |
+The request is processed successfully. + |
+
Released On + |
+What's New + |
+
|---|---|
2022-06-30 + |
+
|
+
2022-05-30 + |
+Added cluster version 7.9.3. +Modified: Scaling Out a Cluster with only Common Nodes. + + |
+
2020-08-30 + |
+
|
+
2019-03-15 + |
+
|
+
2019-02-27 + |
+Accepted in OTC-4.0/Agile. + |
+
2019-01-26 + |
+
|
+
2019-01-17 + |
+Modified the following section based on software changes: + + |
+
2018-12-10 + |
+Modify parameter description in the following section based on software function changes: + + |
+
2018-12-03 + |
+Optimized the code example: + + |
+
2018-11-26 + |
+Modified the parameter description. + + |
+
2018-11-19 + |
+Added parameters in the following section based on software function changes: + + + + |
+
2018-11-08 + |
+Added parameters in the following section based on software function changes: + + + |
+
2018-10-29 + |
+
|
+
2018-10-19 + |
+
|
+
2018-10-12 + |
+
|
+
2018-10-08 + |
+
|
+
2018-09-29 + |
+
|
+
2018-09-14 + |
+
|
+
2018-09-04 + |
+
|
+
2018-08-21 + |
+
|
+
2018-07-31 + |
+This is the first official release. + |
+
This API is used to scale out a cluster with only common nodes. Clusters with master, client, or cold data nodes cannot use this API.
+POST /v1.0/{project_id}/clusters/{cluster_id}/extend
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
cluster_id + |
+Yes + |
+String + |
+ID of the cluster to be scaled out. + |
+
Table 2 describes the request parameters.
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
grow + |
+Yes + |
+Object + |
+Detailed description about the cluster scale-out request. For details, see Table 3. + |
+
None
+Example request
+POST /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/ea244205-d641-45d9-9dcb-ab2236bcd07e/extend
+{
+ "grow":
+ {
+ "modifySize": 4
+ }
+}
+Example response
+{}
+Table 4 describes the status code.
+ +Status Code + |
+Code + |
+Status Code Description + |
+
|---|---|---|
400 + |
+BadRequest + |
+Invalid request. +The client should not repeat the request without modifications. + |
+
404 + |
+NotFound + |
+The requested resource cannot be found. +The client should not repeat the request without modifications. + |
+
200 + |
+OK + |
+The request is processed successfully. + |
+
This API is used to query and display details about a cluster.
+GET /v1.0/{project_id}/clusters/{cluster_id}
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
cluster_id + |
+Yes + |
+String + |
+ID of the cluster to be queried. + |
+
None
+Table 2 describes the response parameters.
+ +Parameter + |
+Type + |
+Description + |
+
|---|---|---|
datastore + |
+Object + |
+Type of the data search engine. For details, see Table 3. + |
+
instances + |
+Array of instances in Table 4. + |
+List of node objects. + |
+
updated + |
+String + |
+Last modification time of a cluster. The format is ISO8601: CCYY-MM-DDThh:mm:ss. + |
+
name + |
+String + |
+Cluster name. + |
+
created + |
+String + |
+Time when a cluster is created. The format is ISO8601: CCYY-MM-DDThh:mm:ss. + |
+
id + |
+String + |
+Cluster ID. + |
+
status + |
+String + |
+Return value. +
|
+
endpoint + |
+String + |
+Indicates the IP address and port number of the user used to access the VPC. + |
+
actionProgress + |
+Object + |
+Cluster operation progress, which indicates the progress of cluster creation and expansion in percentage. + |
+
actions + |
+Array of strings + |
+Current behavior on a cluster. Value REBOOTING indicates that the cluster is being restarted, GROWING indicates that capacity expansion is being performed on the cluster, RESTORING indicates that the cluster is being restored, and SNAPSHOTTING indicates that the snapshot is being created. + |
+
failed_reasons + |
+Object + |
+Failure cause. If the cluster is in the Available state, this parameter is not returned. For details, see Table 5. + |
+
httpsEnable + |
+Boolean + |
+Communication encryption status. +
|
+
authorityEnable + |
+String + |
+Whether to enable authentication. Available values include true and false. Authentication is disabled by default. When authentication is enabled, httpsEnable must be set to true. +
|
+
diskEncrypted + |
+Boolean + |
+Whether disks are encrypted. +
|
+
cmkId + |
+String + |
+Key ID used for disk encryption. + |
+
vpcId + |
+String + |
+VPC ID. + |
+
subnetId + |
+String + |
+Subnet ID. + |
+
securityGroupId + |
+String + |
+Security group ID. + |
+
tags + |
+Array of tags in Table 6. + |
+Tags in a cluster. + |
+
period + |
+Boolean + |
+Whether the cluster is billed. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
type + |
+String + |
+Supported type: elasticsearch + |
+
version + |
+String + |
+Engine version number. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
type + |
+String + |
+Supported type: ess (indicating the Elasticsearch node) + |
+
id + |
+String + |
+Instance ID. + |
+
name + |
+String + |
+Instance name. + |
+
status + |
+String + |
+Instance status. +
|
+
specCode + |
+String + |
+Node specifications. + |
+
azCode + |
+String + |
+AZ to which a node belongs. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
error_code + |
+String + |
+Error code. +
|
+
error_msg + |
+String + |
+Detailed error information. + |
+
Example request
+GET /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/5c77b71c-5b35-4f50-8984-76387e42451a+
Example response
+{
+ "datastore": {
+ "type": "elasticsearch",
+ "version": "7.6.2"
+ },
+ "instances": [
+ {
+ "status": "200",
+ "type": "ess",
+ "id": "c2f29369-1985-4028-8e72-89cbb96a299d",
+ "name": "css-5977-ess-esn-1-1",
+ "specCode": "css.xlarge.2",
+ "azCode": "cn-cmcc1a-01"
+ }
+ ],
+ "updated": "2020-12-03T07:02:08",
+ "name": "css-5977",
+ "created": "2020-12-03T07:02:08",
+ "id": "bc8ea974-77ef-46de-b011-918b0fdedb45",
+ "status": "200",
+ "endpoint": "10.16.0.88:9200",
+ "vpcId": "e7daa617-3ee6-4ff1-b042-8cda4a006a46",
+ "subnetId": "6253dc44-24cd-4c0a-90b3-f965e7f4dcd4",
+ "securityGroupId": "d478041e-bcbe-4d69-a492-b6122d774b7f",
+ "httpsEnable": true,
+ "authorityEnable": true,
+ "diskEncrypted": false,
+ "actionProgress": {},
+ "actions": [],
+ "tags": [],
+ "period": false
+
+}
+Table 7 describes the status code.
+ +Status Code + |
+Code + |
+Status Code Description + |
+
|---|---|---|
400 + |
+BadRequest + |
+Invalid request. +The client should not repeat the request without modifications. + |
+
404 + |
+NotFound + |
+The requested resource cannot be found. +The client should not repeat the request without modifications. + |
+
200 + |
+OK + |
+The request is processed successfully. + |
+
Using this API will automatically enable the snapshot function.
+This API is used to modify the basic configurations of a cluster snapshot. The basic configurations include the OBS bucket and IAM agency.
+POST /v1.0/{project_id}/clusters/{cluster_id}/index_snapshot/setting
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
cluster_id + |
+Yes + |
+String + |
+ID of the cluster where index data is to be backed up. + |
+
Table 2 describes the request parameters.
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
bucket + |
+Yes + |
+String + |
+OBS bucket used for index data backup. If there is snapshot data in an OBS bucket, only the OBS bucket is used and cannot be changed. + |
+
agency + |
+Yes + |
+String + |
+IAM agency used to access OBS. + |
+
snapshotCmkId + |
+No + |
+String + |
+Key ID used for snapshot encryption. +
|
+
None
+Example request
+POST /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/ea244205-d641-45d9-9dcb-ab2236bcd07e/index_snapshot/setting
+{
+ "bucket":"test-bucket",
+ "agency":"usearch",
+ "snapshotCmkId":"42546bb1-8025-4ad1-868f-600729c341aea"
+}
+Table 3 describes the status code.
+ +Status Code + |
+Code + |
+Status Code Description + |
+
|---|---|---|
200 + |
+OK + |
+The request is processed successfully. + |
+
406 + |
+Not Acceptable + |
+The server cannot fulfill the request according to the content characteristics of the request. + |
+
412 + |
+Precondition Failed + |
+The server does not meet one of the preconditions that the requester puts on the request. + |
+
504 + |
+Gateway Timeout + |
+A gateway timeout error occurred. + |
+
This API is used to set parameters related to automatic snapshot creation. By default, a snapshot is created per day.
+POST /v1.0/{project_id}/clusters/{cluster_id}/index_snapshot/policy
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
cluster_id + |
+Yes + |
+String + |
+ID of the cluster where automatic snapshot creation is enabled. + |
+
Table 2 describes the request parameters.
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
prefix + |
+Yes + |
+String + |
+Prefix of the snapshot name that is automatically created. + |
+
period + |
+Yes + |
+String + |
+Time when a snapshot is created every day. Snapshots can only be created on the hour. The time format is the time followed by the time zone, specifically, HH:mm z. In the format, HH:mm refers to the hour time and z refers to the time zone, for example, 00:00 GMT+08:00 and 01:00 GMT+08:00. + |
+
keepday + |
+Yes + |
+Integer + |
+Number of days that a snapshot can be retained. The value ranges from 1 to 90. The system automatically deletes snapshots that have been retained for the allowed maximum duration on the half hour. + |
+
enable + |
+Yes + |
+String + |
+Value true indicates that the automatic snapshot creation policy is enabled, and value false indicates that the automatic snapshot creation policy is disabled. + |
+
deleteAuto + |
+No + |
+String + |
+Whether to delete all automatically created snapshots when the automatic snapshot creation policy is disabled. The default value is false, indicating that snapshots that have been automatically created are not deleted when the automatic snapshot creation function is disabled. If this parameter is set to true, all automatically created snapshots are deleted when the automatic snapshot creation policy is disabled. + |
+
None
+Example request
+POST /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/ea244205-d641-45d9-9dcb-ab2236bcd07e/index_snapshot/policy
+{
+ "prefix":"snapshot",
+ "period":"16:00 GMT+08:00",
+ "keepday":7,
+ "enable":"true"
+}
+Table 3 describes the status code.
+ + +This API is used to query the automatic snapshot creation policy for a cluster.
+GET /v1.0/{project_id}/clusters/{cluster_id}/index_snapshot/policy
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
cluster_id + |
+Yes + |
+String + |
+ID of the cluster, for which the automatic snapshot creation policy is to be queried. + |
+
None
+Table 2 describes the response parameters.
+ +Parameter + |
+Type + |
+Description + |
+
|---|---|---|
keepday + |
+Integer + |
+Retention days for a snapshot. + |
+
period + |
+String + |
+Time when a snapshot is created every day. + |
+
prefix + |
+String + |
+Snapshot name prefix. + |
+
bucket + |
+String + |
+OBS bucket for storing snapshots. + |
+
basePath + |
+String + |
+Storage path of the snapshot in the OBS bucket. + |
+
agency + |
+String + |
+Agency used to access OBS buckets. + |
+
enable + |
+String + |
+Whether to enable the automatic snapshot creation policy. + |
+
snapshotCmkId + |
+String + |
+Snapshot encryption ID. If the snapshot is not encrypted, value null is returned. + |
+
Example request
+GET /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/ea244205-d641-45d9-9dcb-ab2236bcd07e/index_snapshot/policy+
Example response
+{
+ "keepday":2,
+ "period":"16:00 GMT+08:00",
+ "prefix":"snapshot",
+ "bucket":"es-backup",
+ "basePath": "css_repository/tests",
+ "agency":"usearch",
+ "enable":"true",
+ "snapshotCmkId" : "a7d5d58c-0330-4d25-860d-c488a4cb4ba7"
+}
+Table 3 describes the status code.
+ + +This API is used to manually create a snapshot.
+POST /v1.0/{project_id}/clusters/{cluster_id}/index_snapshot
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
cluster_id + |
+Yes + |
+String + |
+ID of the cluster where index data is to be backed up. + |
+
Table 2 describes the request parameters.
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+Yes + |
+String + |
+Snapshot name. The snapshot name must start with a letter and contains 4 to 64 characters consisting of only lowercase letters, digits, hyphens (-), and underscores (_). + |
+
description + |
+No + |
+String + |
+Description of a snapshot. The value contains 0 to 256 characters, and angle brackets (<) and (>) are not allowed. + |
+
indices + |
+No + |
+String + |
+Name of the index to be backed up. Multiple index names are separated by commas (,). By default, data of all indices is backed up. You can use the asterisk (*) to back up data of certain indices. For example, if you enter 2018-06*, then data of indices with the name prefix of 2018-06 will be backed up. +The value contains 0 to 1,024 characters. Uppercase letters, spaces, and certain special characters (including "\<|>/?) are not allowed. + |
+
Table 3 describes the response parameters.
+ +Parameter + |
+Type + |
+Description + |
+
|---|---|---|
backup + |
+Object + |
+Snapshot object. For details, see Table 4. + |
+
Example request
+POST /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/ea244205-d641-45d9-9dcb-ab2236bcd07e/index_snapshot
+{
+ "name":"snapshot_001",
+ "indices":"myindex1,myindex2",
+ "description":""
+}
+Example response
+{
+ "backup":{
+ "id" : "9dc4f5c9-33c0-45c7-9378-ae35ae350682",
+ "name": "snapshot_101"
+ }
+}
+Table 5 describes the status code.
+ +Status Code + |
+Code + |
+Status Code Description + |
+
|---|---|---|
201 + |
+Created + |
+The request for creating a resource has been fulfilled. + |
+
500 + |
+InternalServerError + |
+The server is able to receive the request but it could not understand the request. + |
+
406 + |
+Not Acceptable + |
+The server cannot fulfill the request according to the content characteristics of the request. + |
+
501 + |
+Not Implemented + |
+The server does not support the requested function. + |
+
403 + |
+Forbidden + |
+The server understood the request, but is refusing to fulfill it. +The client should not repeat the request without modifications. + |
+
400 + |
+BadRequest + |
+Invalid request. +The client should not repeat the request without modifications. + |
+
This API is used to query all snapshots of a cluster.
+GET /v1.0/{project_id}/clusters/{cluster_id}/index_snapshots
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
cluster_id + |
+Yes + |
+String + |
+ID of the cluster, to which the snapshot to be queried belongs. + |
+
None
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
backups + |
+Array of backup objects + |
+Snapshot list. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
created + |
+String + |
+Time when a snapshot is created. + |
+
datastore + |
+Object + |
+Type of the data search engine. For details, see Table 4. + |
+
description + |
+String + |
+Description of the snapshot. + |
+
id + |
+String + |
+ID of the snapshot. + |
+
clusterId + |
+String + |
+Cluster ID. + |
+
clusterName + |
+String + |
+Cluster name. + |
+
name + |
+String + |
+Snapshot name. + |
+
status + |
+String + |
+Snapshot status. + |
+
updated + |
+String + |
+Whether the snapshot status is updated. + |
+
backupType + |
+String + |
+Value 0 indicates that automatic snapshot creation is enabled. Value 1 indicates that you need to manually create the snapshot. + |
+
backupMethod + |
+String + |
+Snapshot creation mode. + |
+
backupExpectedStartTime + |
+String + |
+Time when the snapshot starts to be executed. + |
+
backupKeepDay + |
+Integer + |
+Snapshot retention period. + |
+
backupPeriod + |
+String + |
+Time when a snapshot is executed every day. + |
+
indices + |
+String + |
+Indices that need to be backed up. + |
+
totalShards + |
+Integer + |
+Total number of shards of the indices to be backed up. + |
+
failedShards + |
+Integer + |
+Number of shards that fail to be backed up. + |
+
version + |
+String + |
+Version of the snapshot. + |
+
restoreStatus + |
+String + |
+Snapshot restoration status. + |
+
startTime + |
+integer + |
+Timestamp when the snapshot starts to be executed. + |
+
endTime + |
+integer + |
+Timestamp when the snapshot execution ends. + |
+
bucketName + |
+String + |
+Bucket for storing snapshot data. + |
+
Example request
+GET /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/ea244205-d641-45d9-9dcb-ab2236bcd07e/index_snapshots+
Example response
+{
+ "backups": [
+ {
+ "created": "2018-03-07T07:34:47",
+ "datastore": {
+ "type": "elasticsearch",
+ "version": "*.*.*"
+ },
+ "description": "",
+ "id": "e29d99c1-3d19-4ea4-ae8d-f252df76cbe9",
+ "clusterId": "37cb1075-c38e-4cd8-81df-442d52df3786",
+ "clusterName": "Es-xfx",
+ "name": "snapshot-002",
+ "status": "COMPLETED",
+ "updated": "2018-03-07T07:40:12",
+ "backupType": "1",
+ "backupMethod": "manual",
+ "backupExpectedStartTime": null,
+ "backupKeepDay": null,
+ "backupPeriod": null,
+ "indices": ".kibana,website2",
+ "totalShards": 6,
+ "failedShards": 0,
+ "version": "6.2.3",
+ "restoreStatus": "success",
+ "startTime": 1520408087099,
+ "endTime": 1520408412219,
+ "bucketName": "obs-b8ed"
+ },
+ {
+ "created": "2018-03-06T15:42:37",
+ "datastore": {
+ "type": "elasticsearch",
+ "version": "6.2.3"
+ },
+ "description": "",
+ "id": "29a2254e-947f-4463-b65a-5f0b17515fae",
+ "clusterId": "37cb1075-c38e-4cd8-81df-442d52df3786",
+ "clusterName": "Es-xfx",
+ "name": "snapshot-001",
+ "status": "COMPLETED",
+ "updated": "2018-03-06T15:48:04",
+ "backupType": "1",
+ "backupMethod": "manual",
+ "backupExpectedStartTime": null,
+ "backupKeepDay": null,
+ "backupPeriod": null,
+ "indices": ".kibana",
+ "totalShards": 1,
+ "failedShards": 0,
+ "version": "6.2.3",
+ "restoreStatus": "none",
+ "startTime": 1520350957275,
+ "endTime": 1520351284357,
+ "bucketName": "obs-b8ed"
+ }
+ ]
+}
+Table 5 describes the status code.
+ + +This API is used to manually restore a snapshot.
+POST /v1.0/{project_id}/clusters/{cluster_id}/index_snapshot/{snapshot_id}/restore
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
cluster_id + |
+Yes + |
+String + |
+ID of the cluster to which the snapshot belongs. + |
+
snapshot_id + |
+Yes + |
+String + |
+ID of the snapshot. + |
+
Table 2 describes the request parameters.
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
targetCluster + |
+Yes + |
+String + |
+ID of the cluster, to which the snapshot is to be restored. + |
+
indices + |
+No + |
+String + |
+Name of the index to be restored. Multiple index names are separated by commas (,). By default, data of all indices is restored. You can use the asterisk (*) to back up data of certain indices. For example, if you enter 2018-06*, then data of indices with the name prefix of 2018-06 will be restored. +The value contains 0 to 1,024 characters. Uppercase letters, spaces, and certain special characters (including "\<|>/?) are not allowed. + |
+
renamePattern + |
+No + |
+String + |
+Rule for defining the indices to be restored. The value contains a maximum of 1,024 characters. +Indices that meet the filtering condition specified by this parameter are restored. The filtering condition must be specified using regular expressions. The value contains 0 to 1,024 characters. Uppercase letters, spaces, and certain special characters (including "\<|>/?,) are not allowed. + |
+
renameReplacement + |
+No + |
+String + |
+Rule for renaming an index. The value contains 0 to 1,024 characters. Uppercase letters, spaces, and certain special characters (including "\<|>/?,) are not allowed. For example, value restored_index_$1 indicates that restored_ is added in front of the names of all restored indices. +The renamePattern and renameReplacement parameters must be both configured. + |
+
None
+Example request
+POST /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/ea244205-d641-45d9-9dcb-ab2236bcd07e/index_snapshot/29a2254e-947f-4463-b65a-5f0b17515fae/restore
+{
+ "targetCluster":"ea244205-d641-45d9-9dcb-ab2236bcd07e",
+ "indices":"myindex1,myindex2"
+}
+Example response
+The return value is empty.
+Table 3 describes the status code.
+ +Status Code + |
+Code + |
+Status Code Description + |
+
|---|---|---|
201 + |
+Created + |
+The request for creating a resource has been fulfilled. + |
+
400 + |
+BadRequest + |
+Invalid request. +The client should not repeat the request without modifications. + |
+
403 + |
+Forbidden + |
+The server understood the request, but is refusing to fulfill it. +The client should not repeat the request without modifications. + |
+
This API is used to delete a snapshot.
+DELETE /v1.0/{project_id}/clusters/{cluster_id}/index_snapshot/{snapshot_id}
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
cluster_id + |
+Yes + |
+String + |
+ID of the cluster to which the snapshot belongs. + |
+
snapshot_id + |
+Yes + |
+String + |
+ID of the snapshot to be deleted. + |
+
None
+None
+Example request
+DELETE /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/ea244205-d641-45d9-9dcb-ab2236bcd07e/index_snapshot/29a2254e-947f-4463-b65a-5f0b17515fae+
Table 2 describes the status code.
+ +Status Code + |
+Code + |
+Status Code Description + |
+
|---|---|---|
200 + |
+OK + |
+The request is processed successfully. + |
+
400 + |
+BadRequest + |
+Invalid request. +The client should not repeat the request without modifications. + |
+
403 + |
+Forbidden + |
+The server understood the request, but is refusing to fulfill it. +The client should not repeat the request without modifications. + |
+
The API for automatically configuring a cluster snapshot can automatically create OBS buckets and agencies for storing snapthos. If you have multiple clusters, an OBS bucket will be created for each cluster via this API during automatic configuration and consume your OBS quota. Too many OBS buckets will be difficult to manage. You are advised to perform operations in Modifying Basic Configurations of a Cluster Snapshot.
+This API is used to automatically set basic configurations for a cluster snapshot, including configuring OBS buckets and IAM agency.
+POST /v1.0/{project_id}/clusters/{cluster_id}/index_snapshot/auto_setting
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
cluster_id + |
+Yes + |
+String + |
+ID of the cluster where snapshots are to be backed up. + |
+
None
+None
+Example request
+POST /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/ea244205-d641-45d9-9dcb-ab2236bcd07e/index_snapshot/auto_setting+
Table 2 describes the status code.
+ + +This API is used to scale out a cluster with special nodes. That is, if a cluster has master, client, or cold data nodes, this API is used for scale-out.
+POST /v1.0/{project_id}/clusters/{cluster_id}/role_extend
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
cluster_id + |
+Yes + |
+String + |
+ID of the cluster to be scaled out. + |
+
Table 2 describes the request parameters.
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
grow + |
+Yes + |
+Array of object + |
+Detailed description about the cluster scale-out request. For details, see Table 3. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
type + |
+Yes + |
+String + |
+Type of the instance to be scaled out. Select at least one from ess, ess-cold, ess-master, and ess-client. +You can only add instances, rather than increase storage capacity, on nodes of the ess-master and ess-client types. + |
+
nodesize + |
+Yes + |
+Integer + |
+Number of instances to be scaled out. The total number of existing instances and newly added instances in a cluster cannot exceed 32. + |
+
disksize + |
+Yes + |
+Integer + |
+Storage capacity of the instance to be expanded. The total storage capacity of existing instances and newly added instances in a cluster cannot exceed the maximum instance storage capacity allowed when a cluster is being created. In addition, you can expand the instance storage capacity for a cluster for up to six times. +Unit: GB + |
+
Table 4 describes the response parameters.
+ + +Example request
+POST v1.0/458d905f22da49c39f609e3347d65723/clusters/4f3deec3-efa8-4598-bf91-560aad1377a3/role_extend
+{
+ "grow": [
+ {
+ "type": "ess-master",
+ "nodesize": 2,
+ "disksize": 0
+ },
+ {
+ "type": "ess",
+ "nodesize": 0,
+ "disksize": 50
+ },
+ {
+ "type": "ess-client",
+ "nodesize": 1,
+ "disksize": 0
+ }
+ ]
+}
+Example response
+{
+ "id": "4f3deec3-efa8-4598-bf91-560aad1377a3"
+}
+Table 5 describes the status code.
+ +Status Code + |
+Code + |
+Status Code Description + |
+
|---|---|---|
400 + |
+BadRequest + |
+Invalid request. +The client should not repeat the request without modifications. + |
+
404 + |
+NotFound + |
+The requested resource cannot be found. +The client should not repeat the request without modifications. + |
+
200 + |
+OK + |
+The request is processed successfully. + |
+
This API is used to disable the snapshot function.
+DELETE /v1.0/{project_id}/clusters/{cluster_id}/index_snapshots
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
cluster_id + |
+Yes + |
+String + |
+ID of the cluster to which the snapshot belongs. + |
+
None
+None
+Example request
+DELETE /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters/ea244205-d641-45d9-9dcb-ab2236bcd07e/index_snapshots+
Table 2 describes the status code.
+ + +This API is used to download the HTTPS certificate file of the server.
+GET /v1.0/dev/cluster/sslCert+
None
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
certBase64 + |
+String + |
+This string is obtained after the certificate file is transcoded using Base64. You need to run the following command to parse the string into a certificate file. The generated certificate file is saved in the folder where the command to be executed is located. In the following command, "$certBase64" indicates the string returned in the response message. The name of the generated certificate file is CloudSearchService.cert. You can specify another name for the certificate file, but must use .cert as the suffix of the name. +echo -n "$certBase64" | base64 -d > CloudSearchService.cert + |
+
Example request
+GET /v1.0/dev/cluster/sslCert+
Example response
+{ "certBase64":"MIIDnTCCAoWgAwIBAgIEXXdMtTANBgkqhkiG9w0BAQsFADB/MRAwDgYDVQQGEwdHZXJtYW55MQ0wCwYDVQQIEwROb25lMQ0wCwYDVQQHEwROb25lMRkwFwYDVQQKExBPcGVuVGVsZWtvbUNsb3VkMRUwEwYDVQQLEwxEYXRhQW5hbHlzaXMxGzAZBgNVBAMTEkNsb3VkU2VhcmNoU2VydmljZTAeFw0xODExMTcxODE4NDJaFw0xOTAyMTUxODE4NDJaMH8xEDAOBgNVBAYTB0dlcm1hbnkxDTALBgNVBAgTBE5vbmUxDTALBgNVBAcTBE5vbmUxGTAXBgNVBAoTEE9wZW5UZWxla29tQ2xvdWQxFTATBgNVBAsTDERhdGFBbmFseXNpczEbMBkGA1UEAxMSQ2xvdWRTZWFyY2hTZXJ2aWNlMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApHai9+LMoFSlWqI+YodGiFLw597Vuoo7gG3qTCs+szQTn3PTZtbnzy7TNWjn8K41mkBgUY16wtkhH1nu6AmhRLpZA+2fwAz34v/tDOYahPq045bk9S/znJXQeWWeux93I15z7OP/XC68IF2AKl2NXjmm9bAD/DsqaLuJpoE77d71862sD6uRCBQYyZoQaHw+eKuL8/+5PjWvG9mS+Rxp0DcLd1waFkyK4BjB5Ae3og4bAivKo7vQHH79fgnuK0SQnNpxlU8xLIGaKsQ0/yeJrTrlfy3vBQmj949SbCzFjvmXgkbv4I0jcT5Ax1P68tlasUUnCqFTjGTbzeT82CeE6QIDAQABoyEwHzAdBgNVHQ4EFgQUPPZLu9ElUzQgKURRwn8HpzIliEcwDQYJKoZIhvcNAQELBQADggEBAI/e/sGbZ1jB3ao7Car2p7rm1Pg8ro1kSy9o+Jug6XjJpkwITKGkhPYugtGuKgL6oiYkdJhqmfrm/1R7phf1qzBgRoWtR7eCBg4uorNaYvTelAjbIoYGL03D1c5K6e1XwRsdqNWT3TwiHZ5CuiVOsjAtvt3OrvF2YtPUOJpbbvdXlnLKaLHoaklcyyMJ+KmUbkd2XFhzlhwj4eOaloL8XQcAk/urYFFNTymJPnNiEXjLAgGCfE/j8rX26WKvPUGmcuuqBiK7Ob+VfnfpnssDQoBtQsN9eUNxkYkg6eua8U6zR3nSPxXpdn+TZo3HHnUp3x0f1Xev49MHKe/aPMJOTYE="
+}
+After obtaining the preceding character string, run the following command to obtain the CloudSearchService.cert certificate file:
+echo -n "MIIDnTCCAoWgAwIBAgIEXXdMtTANBgkqhkiG9w0BAQsFADB/MRAwDgYDVQQGEwdHZXJtYW55MQ0wCwYDVQQIEwROb25lMQ0wCwYDVQQHEwROb25lMRkwFwYDVQQKExBPcGVuVGVsZWtvbUNsb3VkMRUwEwYDVQQLEwxEYXRhQW5hbHlzaXMxGzAZBgNVBAMTEkNsb3VkU2VhcmNoU2VydmljZTAeFw0xODExMTcxODE4NDJaFw0xOTAyMTUxODE4NDJaMH8xEDAOBgNVBAYTB0dlcm1hbnkxDTALBgNVBAgTBE5vbmUxDTALBgNVBAcTBE5vbmUxGTAXBgNVBAoTEE9wZW5UZWxla29tQ2xvdWQxFTATBgNVBAsTDERhdGFBbmFseXNpczEbMBkGA1UEAxMSQ2xvdWRTZWFyY2hTZXJ2aWNlMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApHai9+LMoFSlWqI+YodGiFLw597Vuoo7gG3qTCs+szQTn3PTZtbnzy7TNWjn8K41mkBgUY16wtkhH1nu6AmhRLpZA+2fwAz34v/tDOYahPq045bk9S/znJXQeWWeux93I15z7OP/XC68IF2AKl2NXjmm9bAD/DsqaLuJpoE77d71862sD6uRCBQYyZoQaHw+eKuL8/+5PjWvG9mS+Rxp0DcLd1waFkyK4BjB5Ae3og4bAivKo7vQHH79fgnuK0SQnNpxlU8xLIGaKsQ0/yeJrTrlfy3vBQmj949SbCzFjvmXgkbv4I0jcT5Ax1P68tlasUUnCqFTjGTbzeT82CeE6QIDAQABoyEwHzAdBgNVHQ4EFgQUPPZLu9ElUzQgKURRwn8HpzIliEcwDQYJKoZIhvcNAQELBQADggEBAI/e/sGbZ1jB3ao7Car2p7rm1Pg8ro1kSy9o+Jug6XjJpkwITKGkhPYugtGuKgL6oiYkdJhqmfrm/1R7phf1qzBgRoWtR7eCBg4uorNaYvTelAjbIoYGL03D1c5K6e1XwRsdqNWT3TwiHZ5CuiVOsjAtvt3OrvF2YtPUOJpbbvdXlnLKaLHoaklcyyMJ+KmUbkd2XFhzlhwj4eOaloL8XQcAk/urYFFNTymJPnNiEXjLAgGCfE/j8rX26WKvPUGmcuuqBiK7Ob+VfnfpnssDQoBtQsN9eUNxkYkg6eua8U6zR3nSPxXpdn+TZo3HHnUp3x0f1Xev49MHKe/aPMJOTYE=" | base64 -d > CloudSearchService.cert+
Status Code + |
+Code + |
+Status Code Description + |
+
|---|---|---|
400 + |
+BadRequest + |
+Invalid request. +The client should not repeat the request without modifications. + |
+
404 + |
+NotFound + |
+The requested resource cannot be found. +The client should not repeat the request without modifications. + |
+
200 + |
+OK + |
+The request is processed successfully. + |
+
Welcome to Cloud Search Service API Reference. Cloud Search Service (CSS) provides hosted, distributed search engine services. It is fully compatible with open-source Elasticsearch and supports multi-condition retrieval, statistics, and reporting of structured and unstructured texts.
+This document provides CSS API description, syntax, parameters, and examples. CSS provides APIs for cluster management and snapshot management. You can call these APIs to easily create, query, delete, restart, and scale clusters.
+Chapter + |
+Description + |
+
|---|---|
API Overview + |
+API constituents and list + |
+
Environment Preparation + |
+Prerequisites for using the APIs. + |
+
API Calling + |
+Representational State Transfer (REST) message bodies, calling methods, and examples + |
+
APIs for each module + |
+APIs provided by CSS + |
+
Common Parameters + |
+Common parameters, status codes, and error codes of CSS APIs + |
+
An endpoint is the request address for calling an API. Endpoints vary depending on services and regions. For the endpoints of all services, see Regions and Endpoints.
+In CSS, Elasticsearch 7.6.2 and 7.9.3 and Kibana 7.6.2 and 7.9.3 are supported.
+The CSS API is a self-developed API that complies with RESTful API design specifications. You can call CSS APIs to implement the CSS functions described in Table 1.
+ +Type + |
+Description + |
+
|---|---|
Cluster Management APIs + |
+You can use cluster management APIs to create clusters, scale out a cluster, view cluster details, and obtain instance specifications. + |
+
Snapshot Management APIs + |
+Snapshots can be used to back up and restore data. You can use snapshot management APIs to create, restore, or delete a snapshot. + |
+
A project ID or project name is required in some API requests. You need to obtain the project ID and name before calling an API.
+
The API for obtaining a project ID is GET https://{iam-endpoint}/v3/projects. {iam-endpoint} indicates the endpoint of IAM, which can be obtained from Endpoints.
+{
+ "projects": [
+ {
+ "domain_id": "65382450e8f64ac0870cd180d14exxxx",
+ "is_domain": false,
+ "parent_id": "65382450e8f64ac0870cd180d14exxxx",
+ "name": "xxx", //Project name, the name of the deployment zone.
+ "description": "",
+ "links": {
+ "next": null,
+ "previous": null,
+ "self": "https://www.example.com/v3/projects/a4a5d4098fb4474fa22cd05f897dxxxx"
+ },
+ "id": "a4a5d4098fb4474fa22cd05f897dxxxx", //Project ID
+ "enabled": true
+ }
+ ],
+ "links": {
+ "next": null,
+ "previous": null,
+ "self": "https://www.example.com/v3/projects"
+ }
+}
+Table 1 describes the common request parameters.
+ +Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
X-Sdk-Date + |
+This parameter is mandatory for authentication using AK/SK. + |
+Time when the request is sent. The time is in the YYYYMMDD'T'HHMMSS'Z' format. +The value is the current GMT time of the system. + |
+
Authorization + |
+This parameter is mandatory for authentication using AK/SK. + |
+Signature authentication information. The value can be obtained from the request signing result. +See Authentication. + |
+
Host + |
+This parameter is mandatory for authentication using AK/SK. + |
+Server domain name and port number of the resource being requested. The value can be obtained from the URL of the service API. The value is hostname[:port]. If the port number is not specified, the default port is used. The default port number for https is 443. + |
+
Content-Type + |
+Yes + |
+MIME type of the request body. + |
+
Content-Length + |
+This parameter is mandatory for POST and PUT requests, but must be left blank for GET requests. + |
+Length of the request body. The unit is byte. + |
+
X-Project-Id + |
+No + |
+Project ID. This parameter is used to obtain the token for each project. + |
+
X-Auth-Token + |
+No (This parameter is mandatory for authentication using tokens.) + |
+User token. + |
+
X-Language + |
+No + |
+Request language. The value is en-us. + |
+
Accept + |
+No + |
+Type of content that can be received by a client. + |
+
Table 1 describes common response headers.
+ + +Table 1 describes the status code.
+ +Status Code + |
+Code + |
+Description + |
+
|---|---|---|
100 + |
+Continue + |
+The client continues sending the request. +This interim response is used to inform the client that the initial part of the request has been received and has not yet been rejected by the server. + |
+
101 + |
+Switching Protocols + |
+Switching protocols. The target protocol must be later than the source protocol. +For example, the current HTTPS protocol is switched to a later version. + |
+
200 + |
+OK + |
+The request is processed successfully. + |
+
201 + |
+Created + |
+The request for creating a resource has been fulfilled. + |
+
202 + |
+Accepted + |
+The request has been accepted, but the processing has not been completed. + |
+
203 + |
+Non-Authoritative Information + |
+The server successfully processed the request, but is returning information that may be from another source. + |
+
204 + |
+NoContent + |
+The server has successfully processed the request, but has not returned any content. +The status code is returned in response to an HTTPS OPTIONS request. + |
+
205 + |
+Reset Content + |
+The server has fulfilled the request, but the requester is required to reset the content. + |
+
206 + |
+Partial Content + |
+The server has processed certain GET requests. + |
+
300 + |
+Multiple Choices + |
+There are multiple options for the location of the requested resource. The response contains a list of resource characteristics and addresses from which the user or user agent (such as a browser) can choose the most appropriate one. + |
+
301 + |
+Moved Permanently + |
+The requested resource has been assigned a new permanent URI, and the new URI is contained in the response. + |
+
302 + |
+Found + |
+The requested resource resides temporarily under a different URI. + |
+
303 + |
+See Other + |
+Retrieve a location. +The response to the request can be found under a different URI and should be retrieved using a GET or POST method. + |
+
304 + |
+Not Modified + |
+The requested resource has not been modified. When the server returns this status code, it does not return any resources. + |
+
305 + |
+Use Proxy + |
+The requested resource must be accessed through a proxy. + |
+
306 + |
+Unused + |
+The HTTPS status code is no longer used. + |
+
400 + |
+BadRequest + |
+Invalid request. +The client should not repeat the request without modifications. + |
+
401 + |
+Unauthorized + |
+The status code is returned after the client provides the authentication information, indicating that the authentication information is incorrect or invalid. + |
+
402 + |
+Payment Required + |
+This status code is reserved for future use. + |
+
403 + |
+Forbidden + |
+The server understood the request, but is refusing to fulfill it. +The client should not repeat the request without modifications. + |
+
404 + |
+NotFound + |
+The requested resource cannot be found. +The client should not repeat the request without modifications. + |
+
405 + |
+MethodNotAllowed + |
+The method specified in the request is not supported for the requested resource. +The client should not repeat the request without modifications. + |
+
406 + |
+Not Acceptable + |
+The server cannot fulfill the request according to the content characteristics of the request. + |
+
407 + |
+Proxy Authentication Required + |
+This status code is similar to 401, but indicates that the client must first authenticate itself with the proxy. + |
+
408 + |
+Request Time-out + |
+The request timed out. +The client may repeat the request without modifications at any later time. + |
+
409 + |
+Conflict + |
+The request could not be processed due to a conflict. +This status code indicates that the resource that the client attempts to create already exits, or the request fails to be processed because of the update of the conflict request. + |
+
410 + |
+Gone + |
+The requested resource is no longer available. +The status code indicates that the requested resource has been deleted. + |
+
411 + |
+Length Required + |
+The server refuses to process the request without a defined Content-Length. + |
+
412 + |
+Precondition Failed + |
+The server does not meet one of the preconditions that the requester puts on the request. + |
+
413 + |
+Request Entity Too Large + |
+The request is larger than that a server is able to process. The server may close the connection to prevent the client from continuing the request. If the server cannot process the request temporarily, the response will contain a Retry-After header field. + |
+
414 + |
+Request-URI Too Large + |
+The URI provided was too long for the server to process. + |
+
415 + |
+Unsupported Media Type + |
+The server is unable to process the media format in the request. + |
+
416 + |
+Requested range not satisfiable + |
+The requested range is invalid. + |
+
417 + |
+Expectation Failed + |
+The server fails to meet the requirements of the Expect request-header field. + |
+
422 + |
+UnprocessableEntity + |
+The request is well-formed but is unable to be processed due to semantic errors. + |
+
429 + |
+TooManyRequests + |
+The client has sent more requests than its rate limit is allowed within a given amount of time, or the server has received more requests than it is able to process within a given amount of time. In this case, it is advisable for the client to re-initiate requests after the time specified in the Retry-After header of the response expires. + |
+
500 + |
+InternalServerError + |
+The server is able to receive the request but it could not understand the request. + |
+
501 + |
+Not Implemented + |
+The server does not support the requested function. + |
+
502 + |
+Bad Gateway + |
+The server is acting as a gateway or proxy and receives an invalid request from a remote server. + |
+
503 + |
+ServiceUnavailable + |
+The requested service is invalid. +The client should not repeat the request without modifications. + |
+
504 + |
+ServerTimeout + |
+The request cannot be fulfilled within a given time. This status code is returned to the client only when the Timeout parameter is specified in the request. + |
+
505 + |
+HTTP Version not supported + |
+The server does not support the HTTPS protocol version used in the request. + |
+
No data is returned if an API fails to be invoked. You can locate the cause of an error according to the error code of each API. When the API calling fails, HTTPS status code 4xx or 5xx is returned. The returned message body contains the specific error code and error information. If you fail to locate the cause of the error, contact technical support and provide the error code for troubleshooting.
+ +Status Code + |
+Error Code + |
+Error Message + |
+Measure + |
+
|---|---|---|---|
400 + |
+CSS.0001 + |
+The parameter is incorrect. + |
+Check the parameter settings according to the returned information. + |
+
500 + |
+CSS.0005 + |
+Server error. + |
+Contact technical support. + |
+
400 + |
+CSS.0006 + |
+The request body is empty. Enter a request parameter. + |
+Enter the request parameters. + |
+
202 + |
+CSS.0011 + |
+This operation cannot be performed because another operation is being performed on the instance or the instance is faulty. Please try again later. + |
+Try again later. + |
+
403 + |
+CSS.0015 + |
+Resource not found or permission denied. + |
+Change the resource ID or check the access permission. + |
+
404 + |
+CSS.0022 + |
+The instance does not exist or has been deleted. + |
+Change the instance ID. + |
+
403 + |
+CSS.0032 + |
+The current user has no operation permissions. + |
+Check the permissions. + |
+
400 + |
+CSS.0045 + |
+The token is incorrect. + |
+Obtain the token again. + |
+
400 + |
+CSS.1112 + |
+The number of instances has reached the quota. + |
+Delete some clusters or increase the quota. + |
+
400 + |
+CSS.3011 + |
+Invalid retention duration of the backup. + |
+Change the allowed retention duration. + |
+
404 + |
+CSS.3027 + |
+The cluster does not exist. + |
+Check whether the cluster ID is correct. + |
+
400 + |
+CSS.5007 + |
+The selected flavor does not exist. + |
+Check whether the specifications are correct. + |
+
400 + |
+CSS.5009 + |
+The hard disk size is beyond the valid range. + |
+Change the disk size. + |
+
400 + |
+CSS.5014 + |
+Invalid VPC ID. + |
+Check whether the VPC ID is correct. + |
+
400 + |
+CSS.5015 + |
+Invalid subnet ID. + |
+Check whether the subnet ID is correct. + |
+
400 + |
+CSS.5021 + |
+The VPC does not exist or does not belong to the user. + |
+Check whether the VPC is correct. + |
+
400 + |
+CSS.5023 + |
+The security group does not exist or does not belong to the VPC. + |
+Check whether the security group is correct. + |
+
400 + |
+CSS.5157 + |
+The CIDR does not exist or is invalid. + |
+Check whether there are subnets in the VPC. + |
+
400 + |
+CSS.5036 + |
+The engine does not exist. + |
+Check whether the datastore parameter setting is correct. + |
+
400 + |
+CSS.5047 + |
+The number of instances is beyond the valid range. + |
+Check whether the number of instances is within the range. + |
+
409 + |
+CSS.5050 + |
+The cluster name already exists. + |
+Change the cluster name. + |
+
400 + |
+CSS.5052 + |
+Invalid value of the AZ. + |
+Change the AZ. + |
+
400 + |
+CSS.5055 + |
+Invalid flavor. + |
+Modify the specifications. + |
+
400 + |
+CSS.5061 + |
+The hard disk type is invalid. + |
+Change the hard disk type. + |
+
400 + |
+CSS.5071 + |
+The disk type does not match that in the XML configuration file. + |
+Change the hard disk type. + |
+
400 + |
+CSS.5072 + |
+The security group ID is invalid. + |
+Change the security group ID. + |
+
400 + |
+CSS.5074 + |
+The subnet does not belong to the VPC. + |
+Change the subnet ID. + |
+
400 + |
+CSS.5077 + |
+Invalid cluster name. + |
+Change the cluster name. + |
+
400 + |
+CSS.5078 + |
+The hard disk size is beyond the valid range. + |
+Change the disk size. + |
+
400 + |
+CSS.5092 + |
+Invalid hard disk information. + |
+Modify the hard disk information. + |
+
400 + |
+CSS.5093 + |
+Invalid specification information. + |
+Modify the specification information. + |
+
412 + |
+CSS.5130 + |
+The agency name is invalid. + |
+Change the agency name. + |
+
500 + |
+CSS.9999 + |
+Request processing failed. + |
+Contact technical support. + |
+
NA + |
+CSS.6000 + |
+Clusters fail to be created. + |
+Try again later or contact technical support. + |
+
NA + |
+CSS.6001 + |
+Cluster scale-out fails. + + |
+Try again later or contact technical support. + |
+
NA + |
+CSS.6002 + |
+Failed to bind the elastic IP address to the cluster. + |
+Try again later or contact technical support. + |
+
N/A + |
+CSS.6003 + |
+Failed to restore the cluster. + |
+Try again later or contact technical support. + |
+
N/A + |
+CSS.6004 + |
+Failed to create a node. + |
+Try again later or contact technical support. + |
+
N/A + |
+CSS.6005 + |
+The initialization fails. + |
+Perform the initialization again or contact technical support. + |
+
NA + |
+CSS.6006 + |
+Failed to modify the specifications. + |
+Perform the initialization again or contact technical support. + |
+
NA + |
+CSS.6007 + |
+Failed to reset the password. + |
+Reset the password. + |
+
N/A + |
+CSS.6008 + |
+Failed to update the YML file. + |
+Update the .yml file again or contact technical support. + |
+
N/A + |
+CSS.6009 + |
+Failed to create the snapshot. + |
+Try again later or contact technical support. + |
+
N/A + |
+CSS.6010 + |
+Failed to restore the snapshot because the OBS object does not exist or has been deleted. + |
+Check whether the configured OBS object exists. + |
+
N/A + |
+CSS.6011 + |
+Failed to create the snapshot because the OBS bucket you select does not exist or has been deleted. + |
+Check whether the OBS bucket exists. + |
+
N/A + |
+CSS.6012 + |
+Failed to restore the snapshot because the OBS object does not exist or has been deleted. + |
+Check whether the OBS bucket exists. + |
+
N/A + |
+CSS.6013 + |
+The parameters cannot be modified because other operations are being performed on the cluster. + |
+Modify parameters when the cluster is available. + |
+
N/A + |
+CSS.6014 + |
+Some parameters cannot be modified. + |
+Check whether the submitted parameter modification request contains a parameter value that cannot be modified. If yes, delete the parameter and try again. + |
+
N/A + |
+CSS.6015 + |
+The parameter value is not in YAML format. + |
+Modify the parameter format and try again. + |
+
This API is used to query the tag information about a specified cluster.
+GET /v1.0/{project_id}/css-cluster/{cluster_id}/tags
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
cluster_id + |
+Yes + |
+String + |
+ID of the cluster to be queried. + |
+
None
+Table 2 describes the response parameters.
+ +Parameter + |
+Type + |
+Description + |
+
|---|---|---|
tags + |
+Array of tag objects + |
+Tags in a cluster. + |
+
Example request
+GET v1.0/458d905f22da49c39f609e3347d65723/css-cluster/4f3deec3-efa8-4598-bf91-560aad1377a3/tags+
Example response
+{
+ "tags": [
+ {
+ "key": "key1",
+ "value": "value1"
+ },
+ {
+ "key": "key2",
+ "value": "value3"
+ }
+ ]
+}
+Table 4 describes the status code.
+ +Status Code + |
+Message + |
+Description + |
+
|---|---|---|
400 + |
+BadRequest + |
+Invalid request. +The client should not repeat the request without modifications. + |
+
404 + |
+NotFound + |
+The requested resource cannot be found. +The client should not repeat the request without modifications. + |
+
200 + |
+OK + |
+The request is processed successfully. + |
+
This API is used to query all tags in a specified region.
+GET /v1.0/{project_id}/css-cluster/tags
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID. + |
+
None
+Table 2 describes the response parameters.
+ + + + +Example request
+GET v1.0/458d905f22da49c39f609e3347d65723/css-cluster/tags+
Example response
+{
+ "tags": [
+ {
+ "key": "key1",
+ "values": [
+ "value1",
+ "value2"
+ ]
+ },
+ {
+ "key": "key2",
+ "values": [
+ "value1",
+ "value2"
+ ]
+ }
+ ]
+}
+Table 4 describes the status code.
+ +Status Code + |
+Message + |
+Description + |
+
|---|---|---|
400 + |
+BadRequest + |
+Invalid request. +The client should not repeat the request without modifications. + |
+
404 + |
+NotFound + |
+The requested resource cannot be found. +The client should not repeat the request without modifications. + |
+
200 + |
+OK + |
+The request is processed successfully. + |
+
This API is used to add or delete tags to or from a specified cluster in batches. Tag Management Service (TMS) uses this API to batch manage tags of a cluster. A cluster can have a maximum of 10 tags.
+
POST /v1.0/{project_id}/css-cluster/{cluster_id}/tags/action
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID + |
+
cluster_id + |
+Yes + |
+String + |
+IDs of clusters to which tags are to be added or deleted in batches + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
tags + |
+No + |
+Array of tag objects + |
+Tag list + |
+
action + |
+Yes + |
+String + |
+Operation to be performed. The value can be set to create or delete only. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
key + |
+Yes + |
+String + |
+Tag key. The value can contain up to 36 characters. + |
+
value + |
+This parameter is mandatory when action is set to create and optional when action is set to delete. + |
+String + |
+Tag value. The value contains up to 43 characters. +If value is not empty, delete tags by key/value. If value is empty, delete tags by key. + |
+
None
+POST /v1.0/458d905f22da49c39f609e3347d65723/css-cluster/4f3deec3-efa8-4598-bf91-560aad1377a3/tags/action+
This API is used to add tags in batches.
+{
+ "action": "create",
+ "tags": [
+ {
+ "key": "key1",
+ "value": "value1"
+ }
+ ]
+}
+{
+ "action": "delete",
+ "tags": [
+ {
+ "key": "key1"
+ }
+ ]
+}
+Table 4 describes status codes.
+ +Status Code + |
+Encoding + |
+Description + |
+
|---|---|---|
400 + |
+BadRequest + |
+Invalid request. +Do not retry the request before modification. + |
+
404 + |
+NotFound + |
+The requested resource cannot be found. +Do not retry the request before modification. + |
+
204 + |
+OK + |
+The request is processed successfully. + |
+
This API is used to delete specified cluster tags.
+DELETE /v1.0/{project_id}/css-cluster/{cluster_id}/tags/{key}
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID + + |
+
cluster_id + |
+Yes + |
+String + |
+ID of the cluster to which a tag is to be deleted + |
+
key + |
+Yes + |
+String + |
+Tag key +The field cannot be left blank or be an empty character string. + |
+
None
+None
+Table 2 describes status codes.
+ +Status Code + |
+Encoding + |
+Description + |
+
|---|---|---|
400 + |
+BadRequest + |
+Invalid request. +Do not retry the request before modification. + |
+
404 + |
+NotFound + |
+The requested resource cannot be found. +Do not retry the request before modification. + |
+
204 + |
+OK + |
+The request is processed successfully. + |
+
This API is used to add tags to a cluster. A cluster can have a maximum of 10 tags.
+POST /v1.0/{project_id}/css-cluster/{cluster_id}/tags
+
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Project ID + + |
+
cluster_id + |
+Yes + |
+String + |
+ID of the cluster to which a tag is to be added + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
key + |
+Yes + |
+String + |
+Tag key. The value can contain up to 36 characters. + |
+
value + |
+Yes + |
+String + |
+Tag value. The value contains up to 43 characters. +If value is not empty, delete tags by key/value. If value is empty, delete tags by key. + |
+
None
+Table 3 describes status codes.
+ +Status Code + |
+Encoding + |
+Description + |
+
|---|---|---|
400 + |
+BadRequest + |
+Invalid request. +Do not retry the request before modification. + |
+
404 + |
+NotFound + |
+The requested resource cannot be found. +Do not retry the request before modification. + |
+
204 + |
+OK + |
+The request is processed successfully. + |
+
This section describes the structure of a RESTful API request, and uses the API for Obtaining a User Token as an example to describe how to call an API. A token is a user's access credential, which contains the user identity and permission information. The obtained token is used to authenticate the calling of other APIs.
+A request URI is in the following format:
+{URI-scheme}://{Endpoint}/{resource-path}?{query-string}
+ +Parameter + |
+Description + |
+
|---|---|
URI-scheme + |
+Protocol used to transmit requests. All APIs use HTTPS. + |
+
Endpoint + |
+Domain name or IP address of the server running the REST service. The endpoint varies between services in different regions. It can be obtained from Endpoints. + |
+
resource-path + |
+API access path for performing a specified operation. Obtain the value from the URI of the API. For example, the resource-path of the API for obtaining a user token is /v3/auth/tokens. + |
+
query-string + |
+Query parameter, which is optional. Ensure that a question mark (?) is included before a query parameter that is in the format of "Parameter name=Parameter value". For example, limit=10 indicates that a maximum of 10 pieces of data is to be viewed. + |
+
https://<iam-endpoint>/v3/auth/tokens+
To simplify the URI display, each API is provided with only a resource-path and a request method. This is because the URI-scheme value of all APIs is HTTPS, and the endpoints in a region are the same. Therefore, the two parts are omitted.
+HTTP-based request methods, which are also called operations or actions, specify the type of operations that you are requesting.
+If POST is displayed in the URI of the API for obtaining a user token, the request is as follows:
+
+POST https://{iam-endpoint}/v3/auth/tokens
+You can also add additional fields to a request, such as the fields required by a specified URI or an HTTP method. For example, add Content-Type that defines a request body type to request for the authentication information.
+Common request headers are as follows:
+
In addition to supporting authentication using tokens, APIs support authentication using the access key ID (AK)/secret access key (SK), which uses SDKs to sign a request. During the signing, the Authorization (signature authentication information) and X-Sdk-Date (time when a request is sent) headers are automatically added to the request. For more details, see Authentication Using AK/SK.
+The API used to obtain a user token does not require authentication. Therefore, only the Content-Type field needs to be added to requests for calling the API. An example of such requests is as follows:
+POST https://{iam-endpoint}/v3/auth/tokens
+Content-Type: application/json
+A request body conveys information other than the request header and is generally sent in a structured format defined by the request header field Content-Type.
+The request body varies according to the APIs. Certain APIs do not require the request body, such as the GET and DELETE APIs.
+In the case of the API used to obtain a user token, the request parameters and parameter description can be obtained from the API request. The following provides an example request with a body included. Replace username, domainname, ******** (login password), and xxxxxxxxxxxxxxxxxx (project ID) with the actual values. To learn how to obtain a project ID, see Obtaining a Project ID and Name.
+
The scope parameter defines the application scope of the token, indicating that the obtained token can access only the resources in the specified project.
+POST https://{iam-endpoint}/v3/auth/tokens
+Content-Type: application/json
+{
+ "auth": {
+ "identity": {
+ "methods": [
+ "password"
+ ],
+ "password": {
+ "user": {
+ "name": "username", //Username
+ "password": "********", //Login password
+ "domain": {
+ "name": "domainname " //Name of the account to which the user belongs
+ }
+ }
+ }
+ },
+ "scope": {
+ "project": {
+ "id": "xxxxxxxxxxxxxxxxxx" //Project ID
+ }
+ }
+ }
+}
+If all data required by a request is available, you can send the request to call an API through curl, Postman, or coding. For the API of obtaining a user token, x-subject-token in the response header is the desired user token. Then, you can use the token to authenticate the calling of other APIs.
+CSS supports token authentication.
+
The validity period of a token is 24 hours. When using a token for authentication, cache it to prevent frequently calling the IAM API.
+A token specifies certain permissions in a computer system. Authentication using a token adds the token to a request as its header during API calling to obtain permissions to operate APIs through IAM.
+The API for obtaining a token is POST https://{IAM endpoint}/v3/auth/tokens. For details about how to obtain IAM endpoints, see Endpoints.
+{
+ "auth": {
+ "identity": {
+ "methods": [
+ "password"
+ ],
+ "password": {
+ "user": {
+ "name": "username", //Username
+ "password": "********", //Login password
+ "domain": {
+ "name": "domainname" //Name of the account that the user belongs to
+ }
+ }
+ }
+ },
+ "scope": {
+ "project": {
+ "name": "xxxxxxxx" //Project name
+ }
+ }
+ }
+}
+After a token is obtained, the X-Auth-Token header field must be added to requests to specify the token when calling other APIs. For example, if the token is ABCDEFJ...., X-Auth-Token: ABCDEFJ.... can be added to a request as follows:
+POST https://{endpoint}/v3/auth/projects
+Content-Type: application/json
+X-Auth-Token: ABCDEFJ....
+After sending a request, you will receive a response containing the status code, response header, and response body.
+A status code is a group of digits, ranging from 1xx to 5xx. It indicates the status of a request. For more information, see Status Code.
+If status code 201 is returned for the calling of the API for obtaining a user token, the request is successful.
+A response header corresponds to a request header, for example, Content-Type.
+Figure 1 shows the response header for the API of obtaining a user token, where x-subject-token is the desired user token. Then, you can use the token to authenticate the calling of other APIs.
+ +A response body is generally returned in a structured format, corresponding to the Content-Type in the response header, and is used to transfer content other than the response header.
+The following shows part of the response body for the API of obtaining a user token.
+{
+ "token": {
+ "expires_at": "2019-02-13T06:52:13.855000Z",
+ "methods": [
+ "password"
+ ],
+ "catalog": [
+ {
+ "endpoints": [
+ {
+ "region_id": "xxx",
+......
+If an error occurs during API calling, the system returns an error code and a message to you. The following shows the format of an error response body:
+{
+ "error_msg": "The format of message is error",
+ "error_code": "AS.0001"
+}
+In the preceding information, error_code is an error code, and error_msg describes the error.
+Released On + |
+Description + |
+
|---|---|
2022-06-30 + |
+Added cluster version 7.9.3. +Supported the VPC endpoint service: VPC Endpoint Service +Optimized the following content based on use scenarios and operation processes: + + |
+
2020-08-30 + |
+
|
+
2019-03-15 + |
+
|
+
2019-01-26 + |
+
|
+
2019-01-17 + |
+
|
+
2018-12-17 + |
+
|
+
2018-12-03 + |
+
|
+
2018-11-02 + |
+
|
+
2018-10-19 + |
+
|
+
2018-10-12 + |
+
|
+
2018-10-08 + |
+
|
+
2018-09-28 + |
+
|
+
2018-09-14 + |
+
|
+
2018-08-20 + |
+
|
+
2018-07-31 + |
+This issue is the first official release. + |
+
This section describes how to use Elasticsearch to provide the search function for users. You can use the Elasticsearch search engine of CSS to search for data based on the scenario example. The basic operation process is as follows:
+ +A women's clothing brand builds an e-commerce website. It uses traditional databases to provide a product search function for users. However, due to an increase in the number of users and business growth, the traditional databases have slow response and low accuracy. To improve user experience and user retention, the e-commerce website plans to use Elasticsearch to provide the product search function for users.
+This section describes how to use Elasticsearch to provide the search function for users.
+Assume that the e-commerce website provides the following data:
+{
+"products":[
+{"productName":"Latest art shirts for women in 2017 autumn","size":"L"}
+{"productName":"Latest art shirts for women in 2017 autumn","size":"M"}
+{"productName":"Latest art shirts for women in 2017 autumn","size":"S"}
+{"productName":"Latest jeans for women in spring 2018","size":"M"}
+{"productName":"Latest jeans for women in spring 2018","size":"S"}
+{"productName":"Latest casual pants for women in spring 2017","size":"L"}
+{"productName":"Latest casual pants for women in spring 2017","size":"S"}
+]
+}
+Create a cluster using Elasticsearch as the search engine. In this example, suppose that you create a cluster named Es-xfx. This cluster is used only for getting started with Elasticsearch. For this cluster, you are advised to select css.medium.8 for Node Specifications, Common I/O for Node Storage Type, and 40 GB for Node Storage Capacity. For details, see Creating an Elasticsearch Cluster in Non-Security Mode.
+After you create the cluster, switch to the cluster list to view the created cluster. If the Status of the cluster is Available, the cluster is created successfully.
+
CSS supports importing data to Elasticsearch using Logstash, Kibana, or APIs. Kibana lets you visualize your Elasticsearch data. The following procedure illustrates how to import data to Elasticsearch using Kibana.
+The text box on the left is the input box. The triangle icon in the upper right corner of the input box is the command execution button. The text box on the right area is the result output box.
+
The Kibana UI varies depending on the Kibana version.
+PUT /my_store
+{
+ "settings": {
+ "number_of_shards": 1
+ },
+ "mappings": {
+ "products": {
+ "properties": {
+ "productName": {
+ "type": "text",
+ "analyzer": "ik_smart"
+ },
+ "size": {
+ "type": "keyword"
+ }
+ }
+ }
+ }
+}
+(Versions later than 7.x)
+PUT /my_store
+{
+ "settings": {
+ "number_of_shards": 1
+ },
+ "mappings": {
+ "properties": {
+ "productName": {
+ "type": "text",
+ "analyzer": "ik_smart"
+ },
+ "size": {
+ "type": "keyword"
+ }
+ }
+ }
+ }
+The command output is similar to the following:
+{
+ "acknowledged" : true,
+ "shards_acknowledged" : true,
+ "index" : "my_store"
+}
+(Versions earlier than 7.x)
+POST /my_store/products/_bulk
+{"index":{}}
+{"productName":"Latest art shirts for women in 2017 autumn","size":"L"}
+{"index":{}}
+{"productName":"Latest art shirts for women in 2017 autumn","size":"M"}
+{"index":{}}
+{"productName":"Latest art shirts for women in 2017 autumn","size":"S"}
+{"index":{}}
+{"productName":"Latest jeans for women in spring 2018","size":"M"}
+{"index":{}}
+{"productName":"Latest jeans for women in spring 2018","size":"S"}
+{"index":{}}
+{"productName":"Latest casual pants for women in spring 2017","size":"L"}
+{"index":{}}
+{"productName":"Latest casual pants for women in spring 2017","size":"S"}
+
+(Versions later than 7.x)
+POST /my_store/_doc/_bulk
+{"index":{}}
+{"productName":"Latest art shirts for women in 2017 autumn","size":"L"}
+{"index":{}}
+{"productName":"Latest art shirts for women in 2017 autumn","size":"M"}
+{"index":{}}
+{"productName":"Latest art shirts for women in 2017 autumn","size":"S"}
+{"index":{}}
+{"productName":"Latest jeans for women in spring 2018","size":"M"}
+{"index":{}}
+{"productName":"Latest jeans for women in spring 2018","size":"S"}
+{"index":{}}
+{"productName":"Latest casual pants for women in spring 2017","size":"L"}
+{"index":{}}{"productName":"Latest casual pants for women in spring 2017","size":"S"}
+If the value of the errors field in the command output is false, the data is imported successfully.
+If you access the e-commerce website and want to search for commodities whose names include "spring jeans", enter "spring jeans" to begin your search. The following text provides the command to be executed on Kibana and the command output.
+Command to be executed on Kibana:
+(Versions earlier than 7.x)
+GET /my_store/products/_search
+{
+ "query": {"match": {
+ "productName": "spring jeans"
+ }}
+}
+(Versions later than 7.x)
+GET /my_store/_search
+{
+ "query": {"match": {
+ "productName": "spring jeans"
+ }}
+}
+The command output is similar to the following:
+{
+ "took": 80,
+ "timed_out": false,
+ "_shards": {
+ "total": 1,
+ "successful": 1,
+ "skipped": 0,
+ "failed": 0
+ },
+ "hits": {
+ "total": 4,
+ "max_score": 1.8069603,
+ "hits": [
+ {
+ "_index": "my_store",
+ "_type": "products",
+ "_id": "yTG1QWUBRuneTTG2KJSq",
+ "_score": 1.8069603,
+ "_source": {
+ "productName": "Latest jeans for women in spring 2018",
+ "size": "M"
+ }
+ },
+ {
+ "_index": "my_store",
+ "_type": "products",
+ "_id": "yjG1QWUBRuneTTG2KJSq",
+ "_score": 1.8069603,
+ "_source": {
+ "productName": "Latest jeans for women in spring 2018",
+ "size": "S"
+ }
+ },
+ {
+ "_index": "my_store",
+ "_type": "products",
+ "_id": "yzG1QWUBRuneTTG2KJSq",
+ "_score": 0.56677663,
+ "_source": {
+ "productName": "Latest casual pants for women in spring 2017",
+ "size": "L"
+ }
+ },
+ {
+ "_index": "my_store",
+ "_type": "products",
+ "_id": "zDG1QWUBRuneTTG2KJSq",
+ "_score": 0.56677663,
+ "_source": {
+ "productName": "Latest casual pants for women in spring 2017",
+ "size": "S"
+ }
+ }
+ ]
+ }
+}
+The e-commerce website provides the function of displaying aggregation results. For example, it classifies commodities corresponding to "spring" based on the size so that you can collect the number of products of different sizes. The following provides the command to be executed on Kibana and the command output.
+Command to be executed on Kibana:
+(Versions earlier than 7.x)
+GET /my_store/products/_search
+{
+"query": {
+"match": { "productName": "spring" }
+},
+"size": 0,
+"aggs": {
+"sizes": {
+"terms": { "field": "size" }
+}
+}
+}
+
+(Versions later than 7.x)
+GET /my_store/_search
+{
+"query": {
+"match": { "productName": "spring" }
+},
+"size": 0,
+"aggs": {
+"sizes": {
+"terms": { "field": "size" }
+}
+}
+}
+The command output is similar to the following:
+(Versions earlier than 7.x)
+{
+ "took": 66,
+ "timed_out": false,
+ "_shards": {
+ "total": 1,
+ "successful": 1,
+ "skipped": 0,
+ "failed": 0
+ },
+ "hits": {
+ "total": 4,
+ "max_score": 0,
+ "hits": []
+ },
+ "aggregations": {
+ "sizes": {
+ "doc_count_error_upper_bound": 0,
+ "sum_other_doc_count": 0,
+ "buckets": [
+ {
+ "key": "S",
+ "doc_count": 2
+ },
+ {
+ "key": "L",
+ "doc_count": 1
+ },
+ {
+ "key": "M",
+ "doc_count": 1
+ }
+ ]
+ }
+ }
+}
+(Versions later than 7.x)
+{
+ "took" : 27,
+ "timed_out" : false,
+ "_shards" : {
+ "total" : 1,
+ "successful" : 1,
+ "skipped" : 0,
+ "failed" : 0
+ },
+ "hits" : {
+ "total" : {
+ "value" : 3,
+ "relation" : "eq"
+ },
+ "max_score" : null,
+ "hits" : [ ]
+ },
+ "aggregations" : {
+ "sizes" : {
+ "doc_count_error_upper_bound" : 0,
+ "sum_other_doc_count" : 0,
+ "buckets" : [
+ {
+ "key" : "L",
+ "doc_count" : 1
+ },
+ {
+ "key" : "M",
+ "doc_count" : 1
+ },
+ {
+ "key" : "S",
+ "doc_count" : 1
+ }
+ ]
+ }
+ }
+}
+Once you understand the process and method of using Elasticsearch, you can perform the following steps to delete the cluster you created for the example and its data to avoid resource wastage.
+After you delete a cluster, its data cannot be restored. Exercise caution when deleting a cluster.
+You can enable security mode when you create a cluster of version 6.5.4 and later versions.
+
Parameter + |
+Description + |
+
|---|---|
Region + |
+Select a region for the cluster from the drop-down list on the right. Currently, only eu-de is supported. + |
+
AZ + |
+Select an AZ associated with the cluster region. +You can select one or more AZs. For details, see Multi-AZ HA. + |
+
Parameter + |
+Description + |
+
|---|---|
Version + |
+Select a cluster version from the drop-down list box. + |
+
Name + |
+Name of a cluster. Cluster names contain 4 to 32 characters. Only letters, numbers, hyphens (-), and underscores (_) are allowed and the value must start with a letter. + NOTE:
+After a cluster is created, you can modify the cluster name as required. Click the name of a cluster to be modified. On the displayed Basic Information page, click |
+

Parameter + |
+Description + |
+
|---|---|
Nodes + |
+Number of nodes in a cluster. +
|
+
CPU Architecture + |
+Currently, x86 and Kunpeng are supported. The supported type is determined by the actual regional environment. + |
+
Node Specifications + |
+Specifications of nodes in a cluster. You can select a specified specification based on your needs. Only one node specification can be selected for each cluster. You cannot select the CPU and memory resources that have been sold out. +Currently, the following flavors are supported: css.medium.8, css.large.8, css.xlarge.8, css.2xlarge.8, and css.4xlarge.8. +After you select a flavor, the CPU and memory corresponding to the current specification are displayed below the parameter. For example, if you select css.medium.8, then 1 vCPUs | 8 GB will be displayed, indicating that the node flavor you select contains one vCPU and 8 GB memory. + |
+
Node Storage Type + |
+In the current version, the following options are available: Common I/O, High I/O, and Ultra-high I/O. + |
+
Node Storage Capacity + |
+Storage space. Its value varies with node specifications. +
|
+
Disk Encryption + |
+If you select this option, the nodes in the cluster you create will use encrypted EVS disks to protect data. By default, this option is not selected. Note that you cannot modify this setting after the cluster is created. Therefore, exercise caution when performing the setting. +After you select this option, you need to select an available key from the Key Name drop-down list. If no key is available, click Create/View Key to go to the KMS management console and create or modify a key. For details, see Creating a CMK. +Enabling disk encryption has no impact on your operations on a cluster (such as accessing the cluster and importing data to the cluster). However, after you enable disk encryption, operation performance deteriorates by about 10%. + NOTE:
+
|
+
Master node + |
+The master node manages all nodes in the cluster. If 20 or more nodes are required to store and analyze the large amount of data, you are advised to enable the master node to ensure cluster stability. Otherwise, you are advised to set only the Nodes parameter and use the nodes as both master and client nodes.. +After enabling the master node, specify Node Specifications, Nodes, and Node Storage Type. The value of Nodes must be an odd number equal to or greater than 3. You can set a maximum of nine nodes. The value of Node Storage Capacity is fixed. You can select a storage type based on your needs. By default, the node storage type is High I/O and the node storage capacity is 40 GB. + |
+
Client node + |
+The client node allows clients to access clusters and analyze data. If more than 20 nodes are required to store and analyze a large amount of data, you are advised to enable the client node to ensure cluster stability. Otherwise, you are advised to set only the Nodes parameter and use the nodes as both master and client nodes.. +After enabling the client node, specify Node Specifications, Nodes and Node Storage Type. The value of Nodes ranges from 1 to 32. The value of Node Storage Capacity is fixed. You can select a storage type based on your needs. By default, the node storage type is High I/O and the node storage capacity is 40 GB. + |
+
Cold data node + |
+The cold data node is used to store historical data, for which query responses can be returned in minutes. If you do not quire a quick query response, store historical data on cold data nodes to reduce costs. +After enabling cold data node, configure Node Specifications, Nodes, Node Storage Type, and Node Storage Capacity. The value of Nodes ranges from 1 to 32. Select Node Storage Type and Node Storage Capacity as requirement. +After the cold data node is enabled, CSS automatically adds cold and hot tags to related nodes. + |
+

Parameter + |
+Description + |
+
|---|---|
VPC + |
+A VPC is a secure, isolated, and logical network environment. +Select the target VPC. Click View VPC to enter the VPC management console and view the created VPC names and IDs. If no VPC is available, create a VPC. + NOTE:
+The VPC must contain CIDRs. Otherwise, cluster creation will fail. By default, a VPC will contain CIDRs. + |
+
Subnet + |
+A subnet provides dedicated network resources that are isolated from other networks, improving network security. +Select the target subnet. You can access the VPC management console to view the names and IDs of the existing subnets in the VPC. + |
+
Security Group + |
+A security group is a collection of access control rules for ECSs that have the same security protection requirements and are mutually trusted in a VPC. To view more details about the security group, click View Security Group. + NOTE:
+
|
+
Security Mode + |
+This parameter is supported in version 6.5.4 and later versions. After enabling security mode, communication is encrypted and authentication is required for the cluster. The default administrator username is admin, and the password needs to be set and confirmed. For details about the security mode, see Clusters in Security Mode. + NOTE:
+You can enable Security Mode only when you create a cluster. After a cluster is created, its security mode cannot be changed. + |
+
HTTPS Access + |
+When security mode is enabled for a cluster, HTTPS access is enabled by default. A security cluster uses HTTPS for communication. Compared with a non-security cluster that uses HTTP for communication, the read performance of a security cluster is much slower. If you need fast read performance and user permission isolation for a security cluster for the purpose of isolating resources (such as indices, documents, and fields), you can disable HTTPS access. After HTTPS access is disabled, HTTP is used to communicate with the cluster. In this case, data security cannot be ensured and public IP address access cannot be enabled. +After a cluster is created, HTTPS access status cannot be changed. + |
+
Public IP Address + |
+You can configure this parameter only when the cluster has the Security Mode enabled. After enabling this function, you can obtain an IP address for accessing the cluster from the Internet. For details, see Public Network Access. + |
+

When creating a CSS cluster, you can bind an enterprise project to the cluster if you have enabled enterprise project. You can select an enterprise project created by the current user from the drop-down list or click View Project Project to go to the Enterprise Project Management console and create a new project or view existing projects.
+By default, the cluster snapshot function is enabled. If you do not need this function, you can disable Cluster Snapshot.
+For details, see Managing Automatic Snapshot Creation.
+Automatic Snapshot Creation
+You can customize Snapshot Name Prefix, Backup Start Time, and Retention Period (days) as required.
+Parameter + |
+Description + |
+
|---|---|
VPC Endpoint Service + |
+After enabling this function, you can obtain a private domain name for accessing the cluster in the same VPC. For details, see VPC Endpoint Service. + |
+
Kibana Public Access + |
+You can configure this parameter only when security mode is enabled for a cluster. After enabling this function, you can obtain a public IP address for accessing Kibana. For details, see Kibana Public Access. + |
+
Tag + |
+Adding tags to clusters can help you identify and manage your cluster resources. You can customize tags or use tags predefined by Tag Management Service (TMS). For details, see Managing Tags. + |
+
If the cluster creation fails, create the cluster again.
+After a cluster is created, you can access the cluster to use Elasticsearch and perform operations, such as, defining index data, importing data, and searching for data. For more information about Elasticsearch, see the Elasticsearch Reference. You can use any of the following methods to access a cluster:
+The ECS that you use to access the cluster by calling Elasticsearch APIs, must meet the following requirements. For details about how to create and log in to an ECS, see Logging In to a Linux ECS or Logging In to a Windows ECS.
+If this requirement is not met, modify the ECS security group or configure the inbound and outbound rules of the ECS security group to allow the ECS security group to be accessed by all security groups of the cluster. For details, see Configuring Security Group Rules.
+To access a cluster by calling Elasticsearch APIs on the ECS that is located in the same VPC as the cluster, perform the following steps:
+Assume that there are two nodes in a cluster. Value 10.62.179.32:9200 10.62.179.33:9200 indicates that the private network addresses of the two nodes are 10.62.179.32 and 10.62.179.33 respectively, and port 9200 is used to access both nodes.
+curl -k 'https://10.62.179.32:9200/_cat/indices'+
curl 'http://10.62.179.32:9200/_cat/indices'+
In the preceding command, the private network address and port number of only one node in the cluster are used. If the node fails, the command will fail to be executed. If the cluster contains multiple nodes, you can replace the private network address and port number of the faulty node with those of any available node in the cluster. If the cluster contains only one node, restore the node and execute the command again.
+If encryption has not been enabled for the communication with the cluster, the command output is similar to that shown in the following figure.
+
For clusters in the non-security mode, you are advised to use use RestHighLevelClient.
+1 +2 +3 | RestHighLevelClient client = new RestHighLevelClient(
+ RestClient.builder(
+ new HttpHost("localhost", 9200, "http")));
+ |
After enabling the security mode function for Elasticsearch 7.1.1 and later versions, accessing a cluster requires the use of HTTPS and the username and password for authentication.
+You need to use clusters 7.1.1 and later versions as well as related APIs if you use the Java API to access a cluster, because the TransportClient class in the earlier version cannot access a cluster using the username and password.
+Two access modes are available: Create a client using either the TransportClient or RestHighLevelClient class. RestHighLevelClient is recommended.
+1 +2 | keytool -genkeypair -alias certificatekey -keyalg RSA -keystore transport-keystore.jks
+keytool -import -alias certificatekey -file CloudSearchService.cer -keystore truststore.jks
+ |
Use the keystore and truststore files to access the cluster, create the TransportClient class using the PreBuiltTransportClient method, and add the settings in the client thread.
+ +1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 | String userPw = "username:password";
+String path = Paths.get(SecurityTransportClientDemo.class.getClassLoader().getResource(".").toURI()).toString();
+
+Settings settings = Settings.builder()
+ .put("opendistro_security.ssl.transport.enforce_hostname_verification", false)
+ .put("opendistro_security.ssl.transport.keystore_filepath", path + "/transport-keystore.jks")
+ .put("opendistro_security.ssl.transport.keystore_password", "tscpass")
+ .put("opendistro_security.ssl.transport.truststore_filepath", path + "/truststore.jks")
+ .put("client.transport.ignore_cluster_name", "true")
+ .put("client.transport.sniff", false).build();
+
+TransportClient client = (new PreBuiltTransportClient(settings, new Class[]{OpenDistroSecurityPlugin.class})).addTransportAddress(new
+ TransportAddress(InetAddress.getByName(ip), 9300));
+
+String base64UserPw = Base64.getEncoder().encodeToString(userPw.getBytes("utf-8"));
+ client.threadPool().getThreadContext().putHeader("Authorization", "Basic " + base64UserPw);
+ |
The HttpHost class is used to process HTTP requests. In the HttpHost class, the CredentialsProvider and SSLIOSessionStrategy configuration parameter classes are encapsulated in the customized SecuredHttpClientConfigCallback class to configure request connection parameters.
+SecuredHttpClientConfigCallback: encapsulates all user-defined connection parameters.
+CredentialsProvider: Elasticsearch API, which is used to encapsulate the username and password using the method provided by Elasticsearch.
+SSLIOSessionStrategy: Configure SSL parameters, including the SSL domain name authentication mode and certificate processing mode. The SSLContext class is used to encapsulate related settings.
+You can access a cluster through either of the following modes: ignore certificates and use certificates.
+Construct the TrustManager. Use the default X509TrustManager. Do not rewrite any method. That is, ignore all related operations.
+1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 | static TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
+ @Override
+ public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
+
+ }
+ @Override
+ public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
+
+ }
+ @Override
+ public X509Certificate[] getAcceptedIssuers() {
+ return null;
+ }
+ }};
+ final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+ credentialsProvider.setCredentials(AuthScope.ANY,
+ new UsernamePasswordCredentials(userName, password));
+ SSLContext sc = null;
+ try{
+ sc = SSLContext.getInstance("SSL");
+ sc.init(null, trustAllCerts, new SecureRandom());
+ }catch(KeyManagementException e){
+ e.printStackTrace();
+ }catch(NoSuchAlgorithmException e){
+ e.printStackTrace();
+ }
+ SSLIOSessionStrategy sessionStrategy = new SSLIOSessionStrategy(sc, new NullHostNameVerifier());
+
+ SecuredHttpClientConfigCallback httpClientConfigCallback = new SecuredHttpClientConfigCallback(sessionStrategy,credentialsProvider);
+
+ RestClientBuilder builder = RestClient.builder(new HttpHost(clusterAddress, 9200,
+ "https")).setHttpClientConfigCallback(httpClientConfigCallback);
+
+ RestHighLevelClient client = new RestHighLevelClient(builder);
+ |
keytool -import -alias custom name -keystore path for exporting the certificate and its new name -file path for uploading the certificate+
Customize the TrustManager class, which is inherited from the X509TrustManager. Read the certificate generated in the preceding step, add it to the trust certificate, and rewrite the three methods of the X509TrustManager interface.
+1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 | public static class MyX509TrustManager implements X509TrustManager {
+
+ X509TrustManager sunJSSEX509TrustManager;
+ MyX509TrustManager() throws Exception {
+ File file = new File("certification file path");
+ if (file.isFile() == false) {
+ throw new Exception("Wrong Certification Path");
+ }
+ System.out.println("Loading KeyStore " + file + "...");
+ InputStream in = new FileInputStream(file);
+ KeyStore ks = KeyStore.getInstance("JKS");
+ ks.load(in, "changeit".toCharArray());
+ TrustManagerFactory tmf =
+ TrustManagerFactory.getInstance("SunX509", "SunJSSE");
+ tmf.init(ks);
+ TrustManager tms [] = tmf.getTrustManagers();
+ for (int i = 0; i < tms.length; i++) {
+ if (tms[i] instanceof X509TrustManager) {
+ sunJSSEX509TrustManager = (X509TrustManager) tms[i];
+ return;
+ }
+ }
+ throw new Exception("Couldn't initialize");
+ }
+
+final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+ credentialsProvider.setCredentials(AuthScope.ANY,
+ new UsernamePasswordCredentials(userName, password));
+
+ SSLContext sc = null;
+ try{
+ TrustManager[] tm = {new MyX509TrustManager()};
+ sc = SSLContext.getInstance("SSL", "SunJSSE");
+ sc.init(null, tm, new SecureRandom());
+ }catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ SSLIOSessionStrategy sessionStrategy = new SSLIOSessionStrategy(sc, new NullHostNameVerifier());
+
+ SecuredHttpClientConfigCallback httpClientConfigCallback = new SecuredHttpClientConfigCallback(sessionStrategy,credentialsProvider);
+ RestClientBuilder builder = RestClient.builder(new HttpHost(clusterAddress, 9200, "https"))
+ .setHttpClientConfigCallback(httpClientConfigCallback);
+ RestHighLevelClient client = new RestHighLevelClient(builder);
+ |
When the code is running, transfer three parameters: access address, cluster login username, and password. The request is GET /_search{"query": {"match_all": {}}}.
+
The access address of a cluster with security mode enabled usually starts with https.
+ESSecuredClient class (Ignore certificates)
+1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 | package securitymode;
+
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.CredentialsProvider;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.HttpHost;
+import org.apache.http.nio.conn.ssl.SSLIOSessionStrategy;
+import org.elasticsearch.action.search.SearchRequest;
+import org.elasticsearch.action.search.SearchResponse;
+import org.elasticsearch.client.RequestOptions;
+import org.elasticsearch.client.RestClient;
+import org.elasticsearch.client.RestClientBuilder;
+import org.elasticsearch.client.RestHighLevelClient;
+import org.elasticsearch.index.query.QueryBuilders;
+import org.elasticsearch.search.SearchHit;
+import org.elasticsearch.search.SearchHits;
+import org.elasticsearch.search.builder.SearchSourceBuilder;
+
+import java.io.IOException;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+
+public class ESSecuredClientIgnoreCerDemo {
+
+ public static void main(String[] args) {
+ String clusterAddress = args[0];
+ String userName = args[1];
+ String password = args[2];
+ // Create a client.
+ RestHighLevelClient client = initESClient(clusterAddress, userName, password);
+ try {
+ // Search match_all, which is equivalent to {\"query\": {\"match_all\": {}}}.
+ SearchRequest searchRequest = new SearchRequest();
+ SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
+ searchSourceBuilder.query(QueryBuilders.matchAllQuery());
+ searchRequest.source(searchSourceBuilder);
+
+ SearchResponse searchResponse = client.search(searchRequest, RequestOptions.DEFAULT);
+ System.out.println("query result: " + searchResponse.toString());
+ SearchHits hits = searchResponse.getHits();
+ for (SearchHit hit : hits) {
+ System.out.println(hit.getSourceAsString());
+ }
+ System.out.println("query success");
+ Thread.sleep(2000L);
+ } catch (InterruptedException | IOException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ client.close();
+ System.out.println("close client");
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ private static RestHighLevelClient initESClient(String clusterAddress, String userName, String password) {
+ final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+ credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(userName, password));
+ SSLContext sc = null;
+ try {
+ sc = SSLContext.getInstance("SSL");
+ sc.init(null, trustAllCerts, new SecureRandom());
+ } catch (KeyManagementException | NoSuchAlgorithmException e) {
+ e.printStackTrace();
+ }
+ SSLIOSessionStrategy sessionStrategy = new SSLIOSessionStrategy(sc, new NullHostNameVerifier());
+ SecuredHttpClientConfigCallback httpClientConfigCallback = new SecuredHttpClientConfigCallback(sessionStrategy,
+ credentialsProvider);
+ RestClientBuilder builder = RestClient.builder(new HttpHost(clusterAddress, 9200, "https"))
+ .setHttpClientConfigCallback(httpClientConfigCallback);
+ RestHighLevelClient client = new RestHighLevelClient(builder);
+ return client;
+ }
+
+ static TrustManager[] trustAllCerts = new TrustManager[] {
+ new X509TrustManager() {
+ @Override
+ public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
+ }
+
+ @Override
+ public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
+ }
+
+ @Override
+ public X509Certificate[] getAcceptedIssuers() {
+ return null;
+ }
+ }
+ };
+
+ public static class NullHostNameVerifier implements HostnameVerifier {
+ @Override
+ public boolean verify(String arg0, SSLSession arg1) {
+ return true;
+ }
+ }
+
+}
+ |
ESSecuredClient class (Uses certificates)
+1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 | package securitymode;
+
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.CredentialsProvider;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.HttpHost;
+import org.apache.http.nio.conn.ssl.SSLIOSessionStrategy;
+import org.elasticsearch.action.search.SearchRequest;
+import org.elasticsearch.action.search.SearchResponse;
+import org.elasticsearch.client.RequestOptions;
+import org.elasticsearch.client.RestClient;
+import org.elasticsearch.client.RestClientBuilder;
+import org.elasticsearch.client.RestHighLevelClient;
+import org.elasticsearch.index.query.QueryBuilders;
+import org.elasticsearch.search.SearchHit;
+import org.elasticsearch.search.SearchHits;
+import org.elasticsearch.search.builder.SearchSourceBuilder;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.KeyStore;
+import java.security.SecureRandom;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+import javax.net.ssl.X509TrustManager;
+
+public class ESSecuredClientWithCerDemo {
+
+ public static void main(String[] args) {
+ String clusterAddress = args[0];
+ String userName = args[1];
+ String password = args[2];
+ String cerFilePath = args[3];
+ String cerPassword = args[4];
+ // Create a client.
+ RestHighLevelClient client = initESClient(clusterAddress, userName, password, cerFilePath, cerPassword);
+ try {
+ // Search match_all, which is equivalent to {\"query\": {\"match_all\": {}}}.
+ SearchRequest searchRequest = new SearchRequest();
+ SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
+ searchSourceBuilder.query(QueryBuilders.matchAllQuery());
+ searchRequest.source(searchSourceBuilder);
+
+ // query
+ SearchResponse searchResponse = client.search(searchRequest, RequestOptions.DEFAULT);
+ System.out.println("query result: " + searchResponse.toString());
+ SearchHits hits = searchResponse.getHits();
+ for (SearchHit hit : hits) {
+ System.out.println(hit.getSourceAsString());
+ }
+ System.out.println("query success");
+ Thread.sleep(2000L);
+ } catch (InterruptedException | IOException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ client.close();
+ System.out.println("close client");
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ private static RestHighLevelClient initESClient(String clusterAddress, String userName, String password,
+ String cerFilePath, String cerPassword) {
+ final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+ credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(userName, password));
+ SSLContext sc = null;
+ try {
+ TrustManager[] tm = {new MyX509TrustManager(cerFilePath, cerPassword)};
+ sc = SSLContext.getInstance("SSL", "SunJSSE");
+ //You can also use SSLContext sslContext = SSLContext.getInstance("TLSv1.2");
+ sc.init(null, tm, new SecureRandom());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ SSLIOSessionStrategy sessionStrategy = new SSLIOSessionStrategy(sc, new NullHostNameVerifier());
+ SecuredHttpClientConfigCallback httpClientConfigCallback = new SecuredHttpClientConfigCallback(sessionStrategy,
+ credentialsProvider);
+ RestClientBuilder builder = RestClient.builder(new HttpHost(clusterAddress, 9200, "https"))
+ .setHttpClientConfigCallback(httpClientConfigCallback);
+ RestHighLevelClient client = new RestHighLevelClient(builder);
+ return client;
+ }
+
+ public static class MyX509TrustManager implements X509TrustManager {
+ X509TrustManager sunJSSEX509TrustManager;
+
+ MyX509TrustManager(String cerFilePath, String cerPassword) throws Exception {
+ File file = new File(cerFilePath);
+ if (!file.isFile()) {
+ throw new Exception("Wrong Certification Path");
+ }
+ System.out.println("Loading KeyStore " + file + "...");
+ InputStream in = new FileInputStream(file);
+ KeyStore ks = KeyStore.getInstance("JKS");
+ ks.load(in, cerPassword.toCharArray());
+ TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509", "SunJSSE");
+ tmf.init(ks);
+ TrustManager[] tms = tmf.getTrustManagers();
+ for (TrustManager tm : tms) {
+ if (tm instanceof X509TrustManager) {
+ sunJSSEX509TrustManager = (X509TrustManager) tm;
+ return;
+ }
+ }
+ throw new Exception("Couldn't initialize");
+ }
+
+ @Override
+ public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
+
+ }
+
+ @Override
+ public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
+
+ }
+
+ @Override
+ public X509Certificate[] getAcceptedIssuers() {
+ return new X509Certificate[0];
+ }
+ }
+
+ public static class NullHostNameVerifier implements HostnameVerifier {
+ @Override
+ public boolean verify(String arg0, SSLSession arg1) {
+ return true;
+ }
+ }
+
+}
+ |
SecuredHttpClientConfigCallback class
+1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 | import org.apache.http.client.CredentialsProvider;
+import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
+import org.apache.http.nio.conn.ssl.SSLIOSessionStrategy;
+import org.elasticsearch.client.RestClientBuilder;
+import org.elasticsearch.common.Nullable;
+import java.util.Objects;
+class SecuredHttpClientConfigCallback implements RestClientBuilder.HttpClientConfigCallback {
+ @Nullable
+ private final CredentialsProvider credentialsProvider;
+ /**
+ * The {@link SSLIOSessionStrategy} for all requests to enable SSL / TLS encryption.
+ */
+ private final SSLIOSessionStrategy sslStrategy;
+ /**
+ * Create a new {@link SecuredHttpClientConfigCallback}.
+ *
+ * @param credentialsProvider The credential provider, if a username/password have been supplied
+ * @param sslStrategy The SSL strategy, if SSL / TLS have been supplied
+ * @throws NullPointerException if {@code sslStrategy} is {@code null}
+ */
+ SecuredHttpClientConfigCallback(final SSLIOSessionStrategy sslStrategy,
+ @Nullable final CredentialsProvider credentialsProvider) {
+ this.sslStrategy = Objects.requireNonNull(sslStrategy);
+ this.credentialsProvider = credentialsProvider;
+ }
+ /**
+ * Get the {@link CredentialsProvider} that will be added to the HTTP client.
+ *
+ * @return Can be {@code null}.
+ */
+ @Nullable
+ CredentialsProvider getCredentialsProvider() {
+ return credentialsProvider;
+ }
+ /**
+ * Get the {@link SSLIOSessionStrategy} that will be added to the HTTP client.
+ *
+ * @return Never {@code null}.
+ */
+ SSLIOSessionStrategy getSSLStrategy() {
+ return sslStrategy;
+ }
+ /**
+ * Sets the {@linkplain HttpAsyncClientBuilder#setDefaultCredentialsProvider(CredentialsProvider) credential provider},
+ *
+ * @param httpClientBuilder The client to configure.
+ * @return Always {@code httpClientBuilder}.
+ */
+ @Override
+ public HttpAsyncClientBuilder customizeHttpClient(final HttpAsyncClientBuilder httpClientBuilder) {
+ // enable SSL / TLS
+ httpClientBuilder.setSSLStrategy(sslStrategy);
+ // enable user authentication
+ if (credentialsProvider != null) {
+ httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
+ }
+ return httpClientBuilder;
+ }
+}
+ |
<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>1</groupId> + <artifactId>ESClient</artifactId> + <version>1.0-SNAPSHOT</version> + <name>ESClient</name> + <!-- FIXME change it to the project's website --> + <url>http://www.example.com</url> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <maven.compiler.source>1.7</maven.compiler.source> + <maven.compiler.target>1.7</maven.compiler.target> + </properties> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.11</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.elasticsearch.client</groupId> + <artifactId>transport</artifactId> + <version>6.5.4</version> + </dependency> + <dependency> + <groupId>org.elasticsearch</groupId> + <artifactId>elasticsearch</artifactId> + <version>6.5.4</version> + </dependency> + <dependency> + <groupId>org.elasticsearch.client</groupId> + <artifactId>elasticsearch-rest-high-level-client</artifactId> + <version>6.5.4</version> + </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-api</artifactId> + <version>2.7</version> + </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-core</artifactId> + <version>2.7</version> + </dependency> + </dependencies> + <build> + <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> + <plugins> + <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle --> + <plugin> + <artifactId>maven-clean-plugin</artifactId> + <version>3.1.0</version> + </plugin> + <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <version>3.0.2</version> + </plugin> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.8.0</version> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.22.1</version> + </plugin> + <plugin> + <artifactId>maven-jar-plugin</artifactId> + <version>3.0.2</version> + </plugin> + <plugin> + <artifactId>maven-install-plugin</artifactId> + <version>2.5.2</version> + </plugin> + <plugin> + <artifactId>maven-deploy-plugin</artifactId> + <version>2.8.2</version> + </plugin> + <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --> + <plugin> + <artifactId>maven-site-plugin</artifactId> + <version>3.7.1</version> + </plugin> + <plugin> + <artifactId>maven-project-info-reports-plugin</artifactId> + <version>3.0.0</version> + </plugin> + </plugins> + </pluginManagement> + </build> +</project>+
If a cluster becomes faulty, you can restart it to check if it can run normally. Only clusters in the Available or Abnormal status can be restarted.
+
You can delete clusters you no longer require. If you delete a cluster, snapshots created for the cluster will not be deleted and will be saved in the OBS bucket.
+
After you delete a cluster, its data cannot be restored. Exercise caution when deleting a cluster.
+You can import data in various formats, such as JSON and CSV, to Elasticsearch in CSS by using Kibana or APIs.
+If there is an available index in the cluster where you want to import data, skip this step. If there is no available index, create an index by referring to the following sample code.
+For example, on the Console page of Kibana, run the following command to create an index named my_store and specify a user-defined mapping to define the data type:
+PUT /my_store
+{
+ "settings": {
+ "number_of_shards": 1
+ },
+ "mappings": {
+ "products": {
+ "properties": {
+ "productName": {
+ "type": "text"
+ },
+ "size": {
+ "type": "keyword"
+ }
+ }
+ }
+ }
+}
+Versions later than 7.x
+PUT /my_store
+{
+ "settings": {
+ "number_of_shards": 1
+ },
+ "mappings": {
+ "properties": {
+ "productName": {
+ "type": "text"
+ },
+ "size": {
+ "type": "keyword"
+ }
+ }
+ }
+}
+POST /my_store/products/_bulk
+{"index":{}}
+{"productName":"Latest art shirts for women in 2017 autumn","size":"L"}
+Versions later than 7.x
+POST /my_store/_bulk
+{"index":{}}
+{"productName":"Latest art shirts for women in 2017 autumn","size":"L"}
+The command output is similar to that shown in Figure 1. If the value of the errors field in the result is false, the data is successfully imported.
+ +The following procedure illustrates how you can import a JSON data file using bulk APIs through the cURL command.
+
You are advised to import a file smaller than 50 MB.
+For details about how to access a cluster, see Accessing a Cluster by Calling Elasticsearch APIs on the ECS That Is Located in the Same VPC as the Cluster.
+curl -X PUT "http://{Private network address and port number of the node} /_bulk" -H 'Content-Type: application/json' --data-binary @test.json
+If communication encryption has been enabled on the cluster where you will import data, you need to send HTTPS requests and add -k to the cURL command.
+curl -X PUT -k "https://{Private network address and port number of the node} /_bulk" -H 'Content-Type: application/json' --data-binary @test.json
+
The value of the -X parameter is a command and that of the -H parameter is a message header. In the preceding command, PUT is the value of the -X parameter and 'Content-Type: application/json' --data-binary @test.json is the value of the -H parameter. Do not add -k between a parameter and its value.
+Example 1: In this example, assume that you need to import data in the testdata.json file to an Elasticsearch cluster, where communication encryption is disabled and the private network address and port number of one node are 192.168.0.90 and 9200 respectively. The data in the testdata.json file is as follows:
+Versions earlier than 7.x
+{"index": {"_index":"my_store","_type":"products"}}
+{"productName":"Autumn new woman blouses 2019","size":"M"}
+{"index": {"_index":"my_store","_type":"products"}}
+{"productName":"Autumn new woman blouses 2019","size":"L"}
+Versions later than 7.x
+{"index": {"_index":"my_store"}}
+{"productName":"Autumn new woman blouse 2019","size":"M"}
+{"index": {"_index":"my_store"}}
+{"productName":"Autumn new woman blouse 2019","size":"L"}
+Perform the following steps to import the data:
+curl -X PUT http://192.168.0.90:9200/my_store -H 'Content-Type: application/json' -d '
+ {
+ "settings": {
+ "number_of_shards": 1
+ },
+ "mappings": {
+ "products": {
+ "properties": {
+ "productName": {
+ "type": "text"
+ },
+ "size": {
+ "type": "keyword"
+ }
+ }
+ }
+ }
+ }'
+Versions later than 7.x
+curl -X PUT http://192.168.0.90:9200/my_store -H 'Content-Type: application/json' -d '
+{
+ "settings": {
+ "number_of_shards": 1
+ },
+ "mappings": {
+ "properties": {
+ "productName": {
+ "type": "text"
+ },
+ "size": {
+ "type": "keyword"
+ }
+ }
+ }
+}'
+curl -X PUT "http://192.168.0.90:9200/_bulk" -H 'Content-Type: application/json' --data-binary @testdata.json+
Example 2: In this example, assume that you need to import data in the testdata.json file to an Elasticsearch cluster, where communication encryption has been enabled and the node access address and content in the testdata.json are the same as those in example 1. Perform the following steps to import the data:
+curl -X PUT -k https://192.168.0.90:9200/my_store -H 'Content-Type: application/json' -d '
+ {
+ "settings": {
+ "number_of_shards": 1
+ },
+ "mappings": {
+ "products": {
+ "properties": {
+ "productName": {
+ "type": "text"
+ },
+ "size": {
+ "type": "keyword"
+ }
+ }
+ }
+ }
+ }'
+curl -X PUT -k "https://192.168.0.90:9200/_bulk" -H 'Content-Type: application/json' --data-binary @testdata.json+
You can scale-in/out your cluster nodes to improve resource utilization and reduce O&M costs.
+If none of the master nodes, client nodes, and cold data nodes are enabled in your cluster, you can modify the number of nodes or the node storage capacity. You can add 1 to 32 nodes.
+If your cluster has a master node, client node, or cold data node enabled, you can modify the number of master nodes, client nodes, cold data nodes, or the node storage capacity. You can add 1 to 200 nodes, including a maximum of nine master nodes and 32 client nodes.
+

Elasticsearch is an open-source search engine. This section provides some suggestions on using Elasticsearch to help you better use CSS.
+A single thread that sends bulk requests is unlikely to max out the indexing capability of a cluster. However, to maximize utilization of cluster resources and improve data processing efficiency, send data through multiple threads or processes.
+By testing, you can determine the optimal number of threads for bulk requests of the same size. You can progressively increase the number of threads until the CPU is saturated in the cluster. You are advised to use the nodes stats API to view the CPU status of a node. View the os.cpu.percent, os.cpu.load_average.1m, os.cpu.load_average.5m, and os.cpu.load_average.15m parameter settings for more details. For information on how to use the nodes stats API and parameter descriptions, see https://www.elastic.co/guide/en/elasticsearch/reference/6.2/cluster-nodes-stats.html#os-stats.
+For example, check whether the CPU is saturated if two threads are used during execution of bulk requests. If it is not saturated, increase the number of threads. If the load or CPU is saturated when the number of threads reaches N, you are advised to use N threads (the optimal number according to your testing) to execute bulk requests and improve indexing efficiency.
+By default, each shard is automatically refreshed once per second. However, the refresh frequency is not applicable to all scenarios. If you use Elasticsearch to index a large number of log files and want to increase the indexing speed instead of obtaining near-real-time search performance, you can reduce the refresh frequency of each index.
+PUT /my_logs
+{
+ "settings": {
+ "refresh_interval": "30s"
+ }
+}
+If you need to import a large amount of data at a time, it is recommended that you disable refresh and replicas by setting refresh_interval to -1 and number_of_replicas to 0. After you import the data, set refresh_interval and number_of_replicas to the original values.
+When you create index data, you are advised to specify the number of shards and replicas. Otherwise, default settings (five shards and one replica) will be used.
+The shard quantity is strongly relevant to the indexing speed. Too many or too few shards will lead to slow indexing. If you specify too many shards, numerous files will be opened during retrieval, slowing down the communication between servers. If you specify too few shards, the index size of a single shard may be too large, slowing down the indexing speed.
+Specify the shard quantity based on the node quantity, disk quantity, and index size. It is recommended that the size of a single shard not exceed 30 GB. The shard size is calculated using the following formula: Size of a shard = Total amount of data/Shard quantity
+PUT /my_index
+{
+ "settings": {
+ "number_of_shards": 1,
+ "number_of_replicas": 0
+ }
+}
+Elasticsearch relies on Lucene to index and store data and it suits dense data, which means that all documents have the same field.
+Do not put documents that have different data structures into the same index. You can consider creating some smaller indices and use fewer shards to store the documents into the indices.
+It may save time and efforts to put different types of documents into an index. However, be aware that Elasticsearch does not store documents based on type. Therefore, putting different types into one index will slow down indexing. If your document types do not have similar mappings, put them in the same index.
+Avoid two different types that have fields of the same name but different mappings.
+You are advised to create indices to store time-related data, such as log data, by time range, instead of storing all data in a super large index.
+For example, you can store data in an index named by year (example: logs_2014) or by month (example: logs_2014-10). When the volume of data becomes very large, you can store data in an index named by day (example: logs_2014-10-24).
+Creating indices by time range has the following advantages:
+You can flexibly set the number of shards and replicas for each index created by time range so that there is no need to set a large shard at the beginning. After the cluster capacity is expanded, the time range can be set to adapt to the cluster scale.
+DELETE /logs_2014-09+
POST /_aliases
+{
+ "actions": [
+ { "add": { "alias": "logs_current", "index": "logs_2014-10" }},
+ { "remove": { "alias": "logs_current", "index": "logs_2014-09" }}
+ ]
+}
+Combine multiple segments in the logs_2014-09-30 index into a shard, improving the query efficiency.
+PUT /logs_2014-09-30/_settings
+{ "number_of_replicas": 0 }
+
+POST /logs_2014-09-30/_forcemerge?max_num_segments=1
+
+PUT /logs_2014-09-30/_settings
+{ "number_of_replicas": 1 }
+Versions later than 7.x
+PUT /logs_2014-09-30/_settings
+{ "number_of_replicas": 0 }
+
+POST /logs_2014-09-30/_forcemerge
+{
+ "max_num_segments":1
+}
+
+PUT /logs_2014-09-30/_settings
+{ "number_of_replicas": 1 }
+In Elasticsearch, the string field is divided into two new data types: text used for full-text search and keyword used for keyword search.
+You are advised to configure exact-value fields without word segmentation, such as tags or enumerated values, as the keyword type.
+Versions earlier than 7.x
+PUT my_index1
+{
+ "mappings": {
+ "my_type": {
+ "properties": {
+ "tags": {
+ "type": "keyword"
+ },
+ "full_name": {
+ "type": "text"
+ }
+ }
+ }
+ }
+}
+Versions later than 7.x
+PUT my_index1
+{
+ "mappings": {
+ "properties": {
+ "tags": {
+ "type": "keyword"
+ },
+ "full_name": {
+ "type": "text"
+ }
+ }
+ }
+ }
+Aggregated statistics based on the text field is not a common requirement. In Elasticsearch, to use aggregated statistics based on the text field, you need to enable fielddata (disabled by default). However, enabling fielddata will consume significant memory.
+You are advised to conduct multifield mapping on the sub-word string to a text field for full-text search and a keyword field for aggregated statistics.
+Versions earlier than 7.x
+PUT my_index2
+{
+ "mappings": {
+ "my_type": {
+ "properties": {
+ "full_name": {
+ "type": "text",
+ "fields": {
+ "raw": {
+ "type": "keyword"
+ }
+ }
+ }
+ }
+ }
+ }
+}
+Versions later than 7.x
+PUT my_index2
+{
+ "mappings": {
+ "properties": {
+ "full_name": {
+ "type": "text",
+ "fields": {
+ "raw": {
+ "type": "keyword"
+ }
+ }
+ }
+ }
+ }
+ }
+Elasticsearch allows you to use index templates to control settings and mappings of certain created indices, for example, controlling the shard quantity to 1 and disabling the _all field. You can use the index template to control the settings you want to apply to the created indices.
+In the following example, the index matching logstash-* uses the my_logs template, and the priority value of the my_logs template is 1.
+Versions earlier than 7.x
+PUT /_template/my_logs
+{
+ "template": "logstash-*",
+ "order": 1,
+ "settings": {
+ "number_of_shards": 1
+ },
+ "mappings": {
+ "_default_": {
+ "_all": {
+ "enabled": false
+ }
+ }
+ },
+ "aliases": {
+ "last_3_months": {}
+ }
+}
+Versions later than 7.x
+PUT /_template/my_logsa
+{
+ "index_patterns": ["logstasaah-*"],
+ "order": 1,
+ "settings": {
+ "number_of_shards": 1
+ },
+ "mappings": {
+ "properties": {
+ "_all": {
+ "enabled": false
+ }
+ }
+ },
+ "aliases": {
+ "last_3_months": {}
+ }
+}
+Elasticsearch replicas provide high availability during runtime, which ensures service continuity even when sporadic data loss occurs.
+However, replicas do not protect against failures. In case of a failure, you need a backup of your cluster so that you can restore data.
+To back up cluster data, create snapshots and save them in OBS buckets. This backup process is "smart". You are advised to use your first snapshot to store a copy of your data. All subsequent snapshots will save the differences between the existing snapshots and the new data. As the number of snapshots increases, backups are added or deleted accordingly. This means that subsequent backups will take a shorter time because only a small volume of data needs to be transferred.
+Filters are important because they are fast. They do not calculate relevance (skipping the entire scoring phase) and are easily cached.
+Usually, when you look for an exact value, you will not want to score the query. You would want to include/exclude documents, so you will use a constant_score query to execute the term query in a non-scoring mode and apply a uniform score of one.
+GET /my_store/products/_search
+{
+ "query" : {
+ "constant_score" : {
+ "filter" : {
+ "term" : {
+ "city" : "London"
+ }
+ }
+ }
+ }
+}
+
+In the scenario where a large amount of data is returned, the query-then-fetch process supports pagination with the from and size parameters, but within limits. Results are sorted on each shard before being returned. However, with larger from values, the sorting process can become very heavy, using vast amounts of CPU, memory, and bandwidth. For this reason, deep pagination is not recommended.
+You can use a scroll query to retrieve large numbers of documents from Elasticsearch efficiently, without affecting system performance. Scrolling allows you to do an initial search and to keep pulling batches of results from Elasticsearch until there are no more results left.
+In general, a filter will outperform a scoring query.
+When used in filtering context, the query is said to be a non-scoring or filtering query. That is, the query simply asks the question: Does this document match? The answer is always a simple, binary yes|no.
+Typical filtering cases are listed as follows:
+When used in a querying context, the query becomes a "scoring" query. Similar to the non-scoring query, this query also determines if a document matches and how well the document matches. A typical use for a scoring query is to find documents:
+Queries can become quite complex. Especially, when they are combined with different analyzers and field mappings, they can become a little difficult to follow. You can use the validate-query API to check whether a query is valid.
+For example, on the Kibana Console page, run the following command to check whether the query is valid. In this example, the validate request tells you that the query is invalid.
+Versions earlier than 7.x
+GET /gb/tweet/_validate/query
+{
+ "query": {
+ "tweet" : {
+ "match" : "really powerful"
+ }
+}
+}
+Versions later than 7.x
+GET /gb/tweet/_validate/query
+{
+"query": {
+ "productName" : {
+ "match" : "really powerful"
+ }
+ }
+ }
+The response to the preceding validate request tells us that the query is invalid. To find out why it is invalid, add the explain parameter to the query string and execute the following command.
+Versions earlier than 7.x
+GET /gb/tweet/_validate/query?explain
+{
+"query": {
+ "tweet" : {
+ "match" : "really powerful"
+ }
+ }
+ }
+Versions later than 7.x
+GET /gb/tweet/_validate/query?explain
+{
+ "query": {
+ "productName" : {
+ "match" : "really powerful"
+ }
+}
+}
+According to the command output shown in the following, the type of query (match) is mixed up with the name of the field (tweet).
+{
+ "valid": false,
+ "error": "org.elasticsearch.common.ParsingException: no [query] registered for [tweet]"
+}
+Using the explain parameter has the added advantage of returning a human-readable description of the (valid) query, which helps in understanding exactly how CSS interprets your query.
+You can back up index data in clusters. If data loss occurs or you want to retrieve data of a specified duration, you can restore the index data. Index backup is implemented by creating cluster snapshots. When creating a backup for the first time, you are advised to back up data of all indices.
+
To use the function of creating or restoring snapshots, the account or IAM user that logs in to the CSS management console must have both of the following permissions:
+Alternatively, on the Clusters page, locate the row that contains the target cluster and click More > Back Up and Restore in the Operation column to switch to the Cluster Snapshots page.
+
indicates that the cluster snapshot function is disabled.
indicates that the cluster snapshot function is enabled.
to the right of Basic Configuration. To ensure the security of snapshot data, you can select a key to encrypt the snapshot.In the displayed Edit Basic Configuration dialog box, you can either select an existing OBS bucket and IAM agency or create an OBS bucket and IAM agency. To create an OBS bucket, click Create Bucket. To create an IAM agency, click Create IAM Agency. For details, see Creating a Bucket and Creating an Agency. To encrypt the snapshot, select Snapshot Encryption and select a key.
+Parameter + |
+Description + |
+Restrictions + |
+
|---|---|---|
OBS Bucket + |
+Name of the OBS bucket used for storing snapshots. + |
+The following requirements must be met for existing OBS buckets or those that will be created: +
NOTE:
+To let an IAM user access an OBS bucket, you need to grant the GetBucketStoragePolicy, GetBucketLocation, ListBucket, and ListAllMyBuckets permissions to the user. + |
+
IAM Agency + |
+IAM agency authorized by the current account to CSS access or maintain data stored in the OBS bucket. + |
+The following requirements must be met for existing IAM agencies or those that will be created: +
|
+
Snapshot Encryption + |
+Whether to enable the snapshot encryption function. Enabling the snapshot encryption function ensures the security of your snapshot data. + |
+After selecting Snapshot Encryption, select a key from the Key Name drop-down list. If no key is available, click Create/View Key to switch to the KMS management console to create a key or modify an existing key. For details, see Creating a CMK. +
|
+

indicates that the automatic snapshot function is enabled.
indicates that the automatic snapshot function is disabled.
You can run the GET /_cat/indices command in Kibana to query names of all indices in the cluster. You can then enter the names of the indices you want to back up.
+After the policy for automatic snapshot creation is created, the policy information will be displayed on the Cluster Snapshots page. If you need to change the policy due to business changes, click
.
Snapshots that are automatically created according to the snapshot policy are displayed in the snapshot list, along with manually created snapshots. You can distinguish them by the Snapshot Type setting. In the upper right corner of the snapshot list, enter the keyword of the snapshot name or snapshot ID to search for the desired snapshots. You can also click
to sort snapshots based on related parameter settings.

After you disable the automatic snapshot creation function, the system stops automatic creation of snapshots. If the system is creating a snapshot based on the automatic snapshot creation policy and the snapshot is not yet displayed in the snapshot list, you cannot disable the automatic snapshot creation function. In this case, if you click the button next to Automatic Snapshot Creation, a message is displayed, indicating that you cannot disable the function. You are advised to disable the function after the system completes automatic creation of the snapshot, and the created snapshot is displayed in the snapshot list.
+When disabling the automatic snapshot creation function, you can choose whether to delete the snapshots that have been automatically created by selecting Delete automated snapshots in the displayed dialog box. By default, automatically created snapshots are not deleted.
+Alternatively, on the Clusters page, locate the row that contains the target cluster and click More > Back Up and Restore in the Operation column to switch to the Cluster Snapshots page.
+
indicates that the cluster snapshot function is disabled.
indicates that the cluster snapshot function is enabled.
to the right of Basic Configuration. For details about how to configure parameters involved in the basic configuration, see 4.
Run the GET /_cat/indices command in Kibana to query all index names in the cluster.
+
After the snapshot is created, it will be displayed in the snapshot list. The status Available indicates that the snapshot is created successfully. All automatically and manually created snapshots are displayed in the snapshot list. You can distinguish them by the Snapshot Type setting. In the upper right corner of the snapshot list, enter the keyword of the snapshot name or snapshot ID to search for the desired snapshots. You can also click
to sort snapshots based on related parameter settings.
You can use snapshots whose Snapshot Status is Available to restore cluster data. The stored snapshot data can be restored to other clusters.
+Restoring data will overwrite current data in clusters. Therefore, exercise caution when restoring data.
+Index: Enter the name of the index you want to restore. If you do not specify any index name, data of all indices will be restored. The value can contain 0 to 1,024 characters. Uppercase letters, spaces, and certain special characters (including "\<|>/?) are not allowed.
+Rename Pattern: Enter a regular expression. Indices that match the regular expression are restored. The default value index_(.+) indicates restoring data of all indices. The value contains 0 to 1,024 characters. Uppercase letters, spaces, and certain special characters (including "\<|>/?,) are not allowed.
+Rename Replacement: Enter the index renaming rule. The default value restored_index_$1 indicates that restored_ is added in front of the names of all restored indices. The value can contain 0 to 1,024 characters. Uppercase letters, spaces, and certain special characters (including "\<|>/?,) are not allowed. You can set Rename Replacement only if you have specified Rename Pattern.
+Cluster: Select the cluster that you want to restore. You can select the current cluster or others. However, you can only restore the snapshot to clusters whose status is Available. If the status of the current cluster is Unavailable, you cannot restore the snapshot to the current cluster. If you select another cluster and two or more indices in the cluster have the same name, data of all indices with the same name as the name you specify will be overwritten. Therefore, exercise caution when you set the parameters.
+

If you no longer need a snapshot, delete it to release storage resources. If the automatic snapshot creation function is enabled, snapshots that are automatically created cannot be deleted manually, and the system automatically deletes these snapshots on the half hour after the time specified by Retention Period (days). If you disable the automatic snapshot creation function while retaining the automated snapshots, then you can manually delete them later. If you do not manually delete the automatically created snapshots and enable the automatic snapshot creation function again, then all snapshots with Snapshot Type set to Automated in the snapshot list of the cluster can only be automatically deleted by the system.
+
After a snapshot is deleted, its data cannot be restored. Exercise caution when deleting a snapshot.
+You can migrate data from one cluster to another. In certain scenarios, for example, if you cannot get sufficient capacity by changing the specifications of the current cluster, you can create a cluster of higher specifications and migrate all data of the current cluster to the new one. Alternatively, you can merge indices in two clusters to one cluster to meet your business needs. CSS enables you to migrate cluster data by using the index backup and restoration function, specifically, by restoring the snapshot of a cluster to the target cluster.
+In this section, assume that data of cluster Es-1 is migrated to cluster Es-2. Cluster Es-2 runs a version later than that of cluster Es-1 and the number of nodes in cluster Es-2 is greater than half of that in cluster Es-1.
+If you use the index backup and restoration function for the first time, you need to perform basic configurations first. For more details, see Manually Creating a Snapshot.
+
Click OK. You can also rename the restored index.
+
You can use Cloud Eye to monitor cluster metrics of CSS in real time and quickly handle exceptions. For details about Cloud Eye, see the Cloud Eye User Guide.
+Table 1 lists the metrics supported by CSS.
+ +Metric + |
+Description + |
+Formula + |
+Value Range + |
+Monitoring Interval + |
+
|---|---|---|---|---|
Disk Usage + |
+Calculates the disk usage of a CSS cluster. +Unit: % + |
+Used disk space of a cluster/Total disk space of a cluster + |
+0 to 100% + |
+1 minute + |
+
Cluster Health Status + |
+Measures the health status of a CSS cluster. + |
+- + |
+Available values are 0, 1, and 2. +
|
+1 minute + |
+
You can create the alarm rules for cluster metrics on the Cloud Eye management console. If the monitored metrics meet the specified alarm rule, alarms are reported. In this case, you can learn about cluster exceptions in time and take proper measures.
+You can create an alarm rule for a specific metric or use the alarm template to create alarm rules in batches for multiple cloud service instances. In this example, assume that you use the alarm template to create the alarm rule for the CSS cluster.
+Parameter + |
+Description + |
+Example Value + |
+
|---|---|---|
Name + |
+Name of the alarm rule. The system automatically generates a name, which you can change if required. + |
+alarm-p8v9 + |
+
Description + |
+Alarm rule description. This parameter is optional. + |
+- + |
+
Parameter + |
+Description + |
+Example Value + |
+
|---|---|---|
Resource Type + |
+Name of the service for which the alarm rule is configured + |
+Cloud Search Service + |
+
Dimension + |
+Metric dimension of the alarm rule. Currently, the following dimensions are supported: +
|
+CSS clusters + |
+
Monitoring Scope + |
+Resource range to which the alarm rule applies. You can select Resource groups or Specific resources. +Note: +
|
+Specific resources + |
+
Parameter + |
+Description + |
+Example Value + |
+
|---|---|---|
Method + |
+Select Use template or Create manually. +If you set Monitoring Scope to Specific resources, you can set Method to Use template. + |
+Create manually + |
+
Template + |
+Template you want to import + |
+- + |
+
Alarm Notification + |
+If you enable this function, specify Validity Period, Notification Object, and Trigger Condition. + |
+- + |
+
After the alarm rule is successfully created, it will be displayed in the alarm rule list
+Cloud Eye performs daily monitoring on core cluster metrics for CSS. You can log in to the Cloud Eye management console to view cluster metrics.
+Cloud Eye only monitors clusters that have been successfully created in real time.
+
You cannot view the metrics for deleted clusters or the metrics for the clusters those whose Status is Abnormal or Creating on the Cloud Eye management console. If the status of a cluster changes from Abnormal or Creating to Available, you can view its metrics in real time after approximately 10 minutes.
+You can use Logstash to collect data and migrate collected data to Elasticsearch in CSS. This method helps you effectively obtain and manage data through Elasticsearch. Data files can be in the JSON or CSV format.
+Logstash is an open-source, server-side data processing pipeline that ingests data from a multitude of sources simultaneously, transforms it, and then sends it to Elasticsearch. For details about Logstash, visit the following website: https://www.elastic.co/guide/en/logstash/current/getting-started-with-logstash.html
+The following two scenarios are involved depending on the Logstash deployment:
+
Logstash requires an OSS version same as the CSS version.
+Figure 1 illustrates how data is imported when Logstash is deployed on an external network.
+ + +ssh -g -L <Local port of the jump host:Private network address and port number of a node> -N -f root@<Private IP address of the jump host>+
For example, port 9200 on the jump host is assigned external network access permissions, the private network address and port number of the node are 192.168.0.81 and 9200, respectively, and the private IP address of the jump host is 192.168.0.227. You need to run the following command to perform port mapping:
+ssh -g -L 9200:192.168.0.81:9200 -N -f root@192.168.0.227+
For example, data file access_20181029_log needs to be imported, the file storage path is /tmp/access_log/, and the data file includes the following data:
+
Create the access_log folder if it does not exist.
+| All | Heap used for segments | | 18.6403 | MB | +| All | Heap used for doc values | | 0.119289 | MB | +| All | Heap used for terms | | 17.4095 | MB | +| All | Heap used for norms | | 0.0767822 | MB | +| All | Heap used for points | | 0.225246 | MB | +| All | Heap used for stored fields | | 0.809448 | MB | +| All | Segment count | | 101 | | +| All | Min Throughput | index-append | 66232.6 | docs/s | +| All | Median Throughput | index-append | 66735.3 | docs/s | +| All | Max Throughput | index-append | 67745.6 | docs/s | +| All | 50th percentile latency | index-append | 510.261 | ms |+
cd /<Logstash installation directory>/ +vi logstash-simple.conf+
input {
+Location of data
+}
+filter {
+Related data processing
+}
+output {
+ elasticsearch {
+ hosts => "<EIP of the jump host>:<Number of the port assigned external network access permissions on the jump host>"
+ (Optional) If communication encryption has been enabled on the cluster, you need to add the following configuration:
+ ssl => true
+ ssl_certificate_verification => false
+ }
+}
+Consider the data files in the /tmp/access_log/ path mentioned in 4 as an example. Assume that data import starts from data in the first row of the data file, the filtering condition is left unspecified (indicating no data processing operations are performed), the public IP address and port number of the jump host are 192.168.0.227 and 9200, respectively, and the name of the target index is myindex. Edit the configuration file as follows, and enter :wq to save the configuration file and exit.
+input {
+ file{
+ path => "/tmp/access_log/*"
+ start_position => "beginning"
+ }
+}
+filter {
+}
+output {
+ elasticsearch {
+ hosts => "192.168.0.227:9200"
+ index => "myindex"
+
+ }
+}
+
If a license error is reported, set ilm_enabled to false.
+If the cluster has the security mode enabled, you need to download a certificate first.
+
input{
+ file {
+ path => "/tmp/access_log/*"
+ start_position => "beginning"
+ }
+}
+filter {
+ }
+output{
+ elasticsearch{
+ hosts => ["https://192.168.0.227:9200"]
+ index => "myindex"
+ user => "admin"
+ password => "******"
+ cacert => "/logstash/logstash6.8/config/CloudSearchService.cer"
+ }
+}
+
password: password for logging in to the cluster
+./bin/logstash -f logstash-simple.conf+
This command must be executed in the directory where the logstash-simple.conf file is stored. For example, if the logstash-simple.conf file is stored in /root/logstash-7.1.1/, go to the directory before running the command.
+
On the Console page of Kibana, enter the following command to search for data. View the search results. If the searched data is consistent with the imported data, the data has been imported successfully.
+GET myindex/_search+
Figure 4 illustrates how data is imported when Logstash is deployed on an ECS that resides in the same VPC as the cluster to which data is to be imported.
+ +
| All | Heap used for segments | | 18.6403 | MB | +| All | Heap used for doc values | | 0.119289 | MB | +| All | Heap used for terms | | 17.4095 | MB | +| All | Heap used for norms | | 0.0767822 | MB | +| All | Heap used for points | | 0.225246 | MB | +| All | Heap used for stored fields | | 0.809448 | MB | +| All | Segment count | | 101 | | +| All | Min Throughput | index-append | 66232.6 | docs/s | +| All | Median Throughput | index-append | 66735.3 | docs/s | +| All | Max Throughput | index-append | 67745.6 | docs/s | +| All | 50th percentile latency | index-append | 510.261 | ms |+
cd /<Logstash installation directory>/ +vi logstash-simple.conf+
input {
+Location of data
+}
+filter {
+Related data processing
+}
+output {
+ elasticsearch{
+ hosts => "<Private network address and port number of the node>"}
+ (Optional) If communication encryption has been enabled on the cluster, you need to add the following configuration:
+ ssl => true
+ ssl_certificate_verification => false
+}
+If the cluster contains multiple nodes, you are advised to replace the value of <Private network address and port number of a node> with the private network addresses and port numbers of all nodes in the cluster to prevent node faults. Use commas (,) to separate the nodes' private network addresses and port numbers. The following is an example:
+hosts => ["192.168.0.81:9200","192.168.0.24:9200"]+
If the cluster contains only one node, the format is as follows:
+hosts => "192.168.0.81:9200"+
Consider the data files in the /tmp/access_log/ path mentioned in 2 as an example. Assume that data import starts from data in the first row of the data file, the filtering condition is left unspecified (indicating no data processing operations are performed), the private network address and port number of the node in the cluster where data is to be imported are 192.168.0.81 and 9200, respectively, and the name of the target index is myindex. Edit the configuration file as follows, and enter :wq to save the configuration file and exit.
+input {
+ file{
+ path => "/tmp/access_log/*"
+ start_position => "beginning"
+ }
+}
+filter {
+}
+output {
+ elasticsearch {
+ hosts => "192.168.0.81:9200"
+ index => "myindex"
+
+ }
+}
+If the cluster has the security mode enabled, you need to download a certificate first.
+
input{
+ file {
+ path => "/tmp/access_log/*"
+ start_position => "beginning"
+ }
+}
+filter {
+ }
+output{
+ elasticsearch{
+ hosts => ["https://192.168.0.227:9200"]
+ index => "myindex"
+ user => "admin"
+ password => "******"
+ cacert => "/logstash/logstash6.8/config/CloudSearchService.cer"
+ }
+}
+
password: password for logging in to the cluster
+./bin/logstash -f logstash-simple.conf+

On the Console page of Kibana, enter the following command to search for data. View the search results. If the searched data is consistent with the imported data, the data has been imported successfully.
+GET myindex/_search+
Cloud Trace Service (CTS) is available on the public cloud platform. With CTS, you can record operations associated with CSS for later query, audit, and backtrack operations.
+CTS has been enabled. For details, see Enabling CTS.
+Operation + |
+Resource Type + |
+Event Name + |
+
|---|---|---|
Creating a cluster + |
+cluster + |
+createCluster + |
+
Deleting a cluster + |
+cluster + |
+deleteCluster + |
+
Expanding the cluster capacity + |
+cluster + |
+growCluster + |
+
Restarting a cluster + |
+cluster + |
+rebootCluster + |
+
Performing basic configurations for a cluster snapshot + |
+cluster + |
+updateSnapshotPolicy + |
+
Setting the automatic snapshot creation policy + |
+cluster + |
+updateAutoSnapshotPolicy + |
+
Manually creating a snapshot + |
+snapshot + |
+createSnapshot + |
+
Restoring a snapshot + |
+snapshot + |
+restoreSnapshot + |
+
Deleting a snapshot + |
+snapshot + |
+deleteSnapshot + |
+
After you enable CTS, it starts recording operations related to CSS. The CTS management console stores the last seven days of operation records. This section describes how to query the last seven days of operation records on the CTS management console.
+
in the upper left corner and select a region.Select a filter criterion from the drop-down list.
+When you select Trace name for Search By, select a specific trace name.
+When you select Resource ID for Search By, enter a specific resource ID.
+When you select Resource name for Search By, select or enter a specific resource name.
+
on the left of a trace to expand its details.For details about the key fields in the CTS trace structure, see the Cloud Trace Service User Guide.
+On the Dashboard page of the CSS management console, you can view information about the status and storage capacity of existing clusters.
+ +Status + |
+Description + |
+
|---|---|
Available + |
+The cluster is running properly and is providing services. + |
+
Abnormal + |
+The cluster creation failed or the cluster is unavailable. +If a cluster is in the unavailable status, you can delete the cluster or use snapshots created when the cluster is available to restore data to other clusters. However, operations such as expanding cluster capacity, accessing Kibana, creating snapshots, and restoring snapshots to the cluster are not allowed. When a cluster is in the unavailable status, data importing is not recommended to avoid data loss. You can view the cluster metrics or restart the cluster. However, the operations may fail. If the operations fail, contact technical support in a timely manner. + |
+
Processing + |
+The cluster is being restarted, scaled, backed up, or recovered. + |
+
Creating + |
+The cluster is being created. + |
+
Status + |
+Description + |
+
|---|---|
Normal + |
+The storage capacity usage of all nodes in a cluster is less than 50%. + |
+
Warning + |
+The storage capacity usage of any node in a cluster is from 50% to less than 80%. + |
+
Danger + |
+The storage capacity usage of any node in a cluster is greater than or equal to 80%. You are advised to increase the storage space of the cluster to achieve normal data search or analysis. + |
+
Abnormal + |
+The cluster storage capacity usage is unknown. For example, if the status of a cluster is Abnormal due to faults, the storage space status of the cluster will be Abnormal. + |
+
The cluster list displays all CSS clusters. If there are a large number of clusters, these clusters will be displayed on multiple pages. You can view clusters of all statuses from the cluster list.
+Clusters are listed in chronological order by default in the cluster list, with the most recent cluster displayed at the top. You can click
next to the related parameter in the table heading to modify cluster sorting. Table 1 describes the parameters involved in the cluster list.
In the upper right corner of the cluster list, you can enter the name or ID of a cluster and click
to search for a cluster. You can also click
in the upper right corner to refresh the cluster list.
Parameter + |
+Description + |
+
|---|---|
Name/ID + |
+Name and ID of a cluster. You can click a cluster name to switch to the Basic Information page. The cluster ID is automatically generated by the system and uniquely identifies a cluster. + |
+
Cluster Status + |
+Status of a cluster. + |
+
Task Status + |
+Status of a task, such as cluster restart, cluster capacity expansion, cluster backup, and cluster restoration. + |
+
Version + |
+Elasticsearch version of the cluster. + |
+
Created + |
+Time when the cluster is created. + |
+
Private Network Address + |
+Private network address and port number of the cluster. You can use these parameters to access the cluster. If the cluster has multiple nodes, the private network addresses and port numbers of all nodes are displayed. + |
+
Operation + |
+Operations that can be performed on a cluster, including Access Kibana, View Metric, Modify, Restart, Delete, Manage Word Dictionary, Back Up and Restore, Migrate, and Access Cerebro. If an operation is not allowed, the button is gray. + |
+
In the Failed Tasks dialog box, you can view the failed tasks related to a cluster, such as failing to create, restart, scale out, back up, or restore a cluster. In addition, you can view the failure cause of each task and choose to delete one or all failed tasks.
+

You can delete one or all failed tasks at a time.
+
Error Code + |
+Failure Cause + |
+Solution + |
+
|---|---|---|
CSS.6000 + |
+Failed to create the cluster because of an internal error. Please try again later. If the problem persists, contact customer service. + |
+Please try again later or contact customer service. + |
+
CSS.6001 + |
+Failed to scale out the cluster because of an internal error. Please try again later. If the problem persists, contact customer service. + |
+|
CSS.6002 + |
+Failed to restart the cluster because of an internal error. Please try again later. If the problem persists, contact customer service. + |
+|
CSS.6003 + |
+Failed to restore the cluster because of an internal error. Please try again later. If the problem persists, contact customer service. + |
+|
CSS.6004 + |
+Failed to create the node because of ECS exceptions (<ECS error code>). Please try again later. If the problem persists, contact customer service. + NOTE:
+<ECS error code> indicates the error information reported by ECS. For details about the cause and solution, see ECS Error Code Description. + |
+|
CSS.6005 + |
+Failed to initialize the service because of an internal error. Please try again later. If the problem persists, contact customer service. + |
+|
CSS.6007 + |
+Failed to create the snapshot because of an internal error. Please try again later. If the problem persists, contact customer service. + |
+|
CSS.6008 + |
+Failed to create the snapshot because the OBS bucket you select does not exist or has been deleted. + |
+Modify the OBS bucket. + |
+
CSS.6009 + |
+Failed to restore the snapshot because the OBS bucket you select does not exist or has been deleted. + |
+|
CSS.6010 + |
+Failed to restore the snapshot because the OBS object does not exist or has been deleted. + |
+
For Elasticsearch 6.5.4 and later versions, Open Distro for Elasticsearch SQL lets you write queries in SQL rather than in the Elasticsearch query domain-specific language (DSL).
+If you are already familiar with SQL and do not want to learn query DSL, this feature is a great option.
+To use this function, send requests to the _opendistro/_sql URI. You can use a request parameter or the request body (recommended).
+GET https://<host>:<port>/_opendistro/_sql?sql=select * from my-index limit 50+
POST https://<host>:<port>/_opendistro/_sql
+{
+ "query": "SELECT * FROM my-index LIMIT 50"
+}
+You can run the cURL command:
+curl -XPOST https://localhost:9200/_opendistro/_sql -u username:password -k -d '{"query": "SELECT * FROM kibana_sample_data_flights LIMIT 10"}' -H 'Content-Type: application/json'
+By default, JSON is returned for query. You can also set the format parameter for the data to be returned in CSV format.
+POST _opendistro/_sql?format=csv
+{
+ "query": "SELECT * FROM my-index LIMIT 50"
+}
+When data is returned in CSV format, each row corresponds to a document and each column corresponds to a field.
+Open Distro for Elasticsearch supports the following SQL operations: statements, conditions, aggregations, include and exclude fields, common functions, joins, and show.
+Statement + |
+Example + |
+
|---|---|
Select + |
+SELECT * FROM my-index + |
+
Delete + |
+DELETE FROM my-index WHERE _id=1 + |
+
Where + |
+SELECT * FROM my-index WHERE ['field']='value' + |
+
Order by + |
+SELECT * FROM my-index ORDER BY _id asc + |
+
Group by + |
+SELECT * FROM my-index GROUP BY range(age, 20,30,39) + |
+
Limit + |
+SELECT * FROM my-index LIMIT 50 (default is 200) + |
+
Union + |
+SELECT * FROM my-index1 UNION SELECT * FROM my-index2 + |
+
Minus + |
+SELECT * FROM my-index1 MINUS SELECT * FROM my-index2 + |
+
As with any complex query, large UNION and MINUS statements can strain or even crash your cluster.
+Condition + |
+Example + |
+
|---|---|
Like + |
+SELECT * FROM my-index WHERE name LIKE 'j%' + |
+
And + |
+SELECT * FROM my-index WHERE name LIKE 'j%' AND age > 21 + |
+
Or + |
+SELECT * FROM my-index WHERE name LIKE 'j%' OR age > 21 + |
+
Count distinct + |
+SELECT count(distinct age) FROM my-index + |
+
In + |
+SELECT * FROM my-index WHERE name IN ('alejandro', 'carolina') + |
+
Not + |
+SELECT * FROM my-index WHERE name NOT IN ('jane') + |
+
Between + |
+SELECT * FROM my-index WHERE age BETWEEN 20 AND 30 + |
+
Aliases + |
+SELECT avg(age) AS Average_Age FROM my-index + |
+
Date + |
+SELECT * FROM my-index WHERE birthday='1990-11-15' + |
+
Null + |
+SELECT * FROM my-index WHERE name IS NULL + |
+
Aggregation + |
+Example + |
+
|---|---|
avg() + |
+SELECT avg(age) FROM my-index + |
+
count() + |
+SELECT count(age) FROM my-index + |
+
max() + |
+SELECT max(age) AS Highest_Age FROM my-index + |
+
min() + |
+SELECT min(age) AS Lowest_Age FROM my-index + |
+
sum() + |
+SELECT sum(age) AS Age_Sum FROM my-index + |
+
Pattern + |
+Example + |
+
|---|---|
include() + |
+SELECT include('a*'), exclude('age') FROM my-index + |
+
exclude() + |
+SELECT exclude('*name') FROM my-index + |
+
Function + |
+Example + |
+
|---|---|
floor + |
+SELECT floor(number) AS Rounded_Down FROM my-index + |
+
trim + |
+SELECT trim(name) FROM my-index + |
+
log + |
+SELECT log(number) FROM my-index + |
+
log10 + |
+SELECT log10(number) FROM my-index + |
+
substring + |
+SELECT substring(name, 2,5) FROM my-index + |
+
round + |
+SELECT round(number) FROM my-index + |
+
sqrt + |
+SELECT sqrt(number) FROM my-index + |
+
concat_ws + |
+SELECT concat_ws(' ', age, height) AS combined FROM my-index + |
+
/ + |
+SELECT number / 100 FROM my-index + |
+
% + |
+SELECT number % 100 FROM my-index + |
+
date_format + |
+SELECT date_format(date, 'Y') FROM my-index + |
+
You must enable fielddata in the document mapping for most string functions to work properly.
+Join + |
+Example + |
+
|---|---|
Inner join + |
+SELECT p.firstname, p.lastname, p.gender, dogs.name FROM people p JOIN dogs d ON d.holdersName = p.firstname WHERE p.age > 12 AND d.age > 1 + |
+
Left outer join + |
+SELECT p.firstname, p.lastname, p.gender, dogs.name FROM people p LEFT JOIN dogs d ON d.holdersName = p.firstname + |
+
Cross join + |
+SELECT p.firstname, p.lastname, p.gender, dogs.name FROM people p CROSS JOIN dogs d + |
+
For details about the constraints and limitations, see Joins.
+Open Distro for Elasticsearch SQL supports inner joins, left outer joins and cross joins. Joins have the following constraints:
+WHERE (a.type1 > 3 OR a.type1 < 0) AND (b.type2 > 4 OR b.type2 < -1)+
WHERE (a.type1 > 3 OR b.type2 < 0) AND (a.type1 > 4 OR b.type2 < -1)+
The Java Database Connectivity (JDBC) driver allows you to integrate Open Distro for Elasticsearch with your business intelligence (BI) applications.
+For details about how to download and use JAR files, see GitHub Repositories.
+Tags are cluster identifiers. Adding tags to clusters can help you identify and manage your cluster resources.
+You can add tags to a cluster when creating the cluster or add them on the details page of the created cluster.
+You can select a predefined tag and set Tag value for the tag. You can click View Predefined Tag to switch to the TMS management console and view existing tags.
+You can also create new tags by specifying Tag key and Tag value.
+You can add a maximum of 10 tags for a CSS cluster. If the entered tag is incorrect, you can click Delete on the right of the tag to delete the tag.
+ +Parameter + |
+Description + |
+
|---|---|
Tag key + |
+Cannot be left blank. +Must be unique in a cluster. +Can contain a maximum of 36 characters. +Can only consist of digits, letters, hyphens (-), and underscores (_). + |
+
Tag value + |
+Can contain a maximum of 43 characters. +Can only consist of digits, letters, hyphens (-), and underscores (_). +Cannot be left blank. + |
+
You can modify, delete, or add tags for a cluster.
+The Basic Information page is displayed.
+On the Tags page, you can view details about tags of the cluster, including the number of tags and the key and value of each tag.
+Click Add in the upper left corner. In the displayed Add Tag dialog box, enter the key and value of the tag to be added, and click OK.
+You can only change the value of an existing tag.
+In the Operation column of a tag, click Edit. In the displayed Edit Tag page, enter a new tag value and click OK.
+In the Operation column of the tag, click Delete. After confirmation, click Yes on the displayed Delete Tag page.
+You can select a tag key or tag value from their drop-down lists. The system returns a list of clusters that exactly match the tag key or tag value. If you enter multiple tags, the cluster that meets requirements of all the tags will be filtered.
+You can add a maximum of 10 tags at one time.
+The system searches for the target cluster by tag key and value.
+You can access a cluster that has the security mode enabled through the public IP address provided by the system.
+
If public access is enabled for CSS, then EIP and bandwidth resources will be used and billed.
+You can enable Security Mode for clusters in Version 6.5.4 and later versions.
+Parameter + |
+Description + |
+
|---|---|
Bandwidth + |
+Bandwidth of the public network access + |
+
Access Control + |
+If you disable access control, all IP addresses can access the cluster through the public IP address. If you enable access control, only IP addresses in the whitelist can access the cluster through the public IP address. + |
+
Whitelist + |
+IP address or IP address range allowed to access a cluster. Use commas (,) to separate multiple addresses. + |
+
You can configure, modify, view the public network access of, or disassociate the public IP address from a cluster.
+If you do not configure the public network access during cluster creation, you can configure it on the Basic Information page after configuring the cluster.
+Click Associate next to Public IP Address, set the access bandwidth, and click OK.
+If the association fails, wait for several minutes and try again.
+For a cluster for which you have configured public network access, you can click Edit next to Bandwidth to modify the bandwidth, or you can click Set next to Access Control to set the access control function and the whitelist for access.
+On the Basic Information page, you can view the public IP address associated with the current cluster.
+To disassociate the public IP address, click Disassociate next to Public IP Address.
+After configuring the public IP address, you can use it to access the cluster. The access address is https://public IP address:9200/interface URL.
+CSS provides log backup and search functions to help you locate faults. You can back up cluster logs to OBS buckets and download required log files to analyze and locate faults.
+
indicates that the log management function is disabled.
indicates that it is enabled.
In the displayed dialog box, OBS Bucket, Backup Path, and IAM Agency are automatically created for log backup. You can modify the default value by referring to Table 1.
+ +Parameter + |
+Description + |
+Remarks + |
+
|---|---|---|
OBS Bucket + |
+Select an OBS bucket from the drop-down list for storing logs. You can also click Create Bucket on the right to create a new OBS bucket. + |
+The OBS bucket and the cluster must be in the same region. + NOTE:
+To let an IAM user access an OBS bucket, you need to grant the GetBucketStoragePolicy, GetBucketLocation, ListBucket, and ListAllMyBuckets permissions to the user. + |
+
IAM Agency + |
+IAM agency authorized by the current account for CSS to access or maintain data stored in the OBS bucket. You can also click Create IAM Agency on the right to create a new IAM agency. + |
+The IAM agency must meet the following requirements: +
|
+
Click
on the right of Log Backup Configuration. The Edit Log Backup Configuration dialog box is displayed. You can modify the log backup parameters.
Click the icon on the right of Auto Backup to enable the auto backup function.
+
indicates that the auto backup function is enabled, and
indicates that it is disabled.
After the automatic backup function is enabled, set the backup start time in the Modify Log Backup Policy dialog box. When the scheduled time arrives, the system will back up logs automatically. Click
on the right of the switch to change Backup Start Time.
On the Log Backup tab page, click Back Up. On the displayed page, click Yes to start backup.
+If Task Status in the log backup list is Successful, the backup is successful.
+
All logs in the cluster are copied to a specified OBS path. You can view or download log files from the path of the OBS bucket.
+On the Log Search page, select the desired node, log type, and log level, and click
. The search results are displayed.
When you search for logs, the latest 10,000 logs are matched. A maximum of 100 logs are displayed.
+After backing up logs, you can click Backup Path to go to the OBS console and view the logs.
+Backed up logs mainly include deprecation logs, run logs, index slow logs, and search slow logs. Table 2 lists the storage types of the OBS bucket.
+ +Log Name + |
+Description + |
+
|---|---|
clustername_deprecation.log + |
+Deprecation log + |
+
clustername_index_indexing_slowlog.log + |
+Search slow log + |
+
clustername_index_search_slowlog.log + |
+Index slow log + |
+
clustername.log + |
+Elasticsearch run log + |
+
clustername_access.log + |
+Access log + |
+
clustername_audit.log + |
+Audit log + |
+
CSS allows you to view default plugins.
+The Basic Information page is displayed.
+On the Default page, view default plugins supported by the current version.
+CSS provides you with cold data nodes. You can store data that requires query response in seconds on high-performance nodes and store data that requires query response in minutes on cold data nodes with large capacity and low specifications.
+
After you enable the cold data node function, the cold data node is labeled with cold. In addition, data nodes are labeled with hot and become hot nodes. You can specify indices to distribute data to cold or hot nodes.
+You can configure a template to store indices on the specified cold or hot node.
+The following figure shows this process. Log in to the Kibana Console page of the cluster, modify the template by configuring the index starting with myindex, and store the indices on the cold node. In this case, the myindex* date is stored on the cold data node by modifying the template.
+PUT _template/test
+{
+ "order": 1,
+ "template": "myindex*",
+ "settings": {
+ "index": {
+ "refresh_interval": "30s",
+ "number_of_shards": "3",
+ "number_of_replicas": "1",
+ "routing.allocation.require.box_type": "cold"
+ }
+ }
+}
+PUT _template/test
+{
+ "order": 1,
+ "index_patterns": "myindex*",
+ "settings": {
+ "refresh_interval": "30s",
+ "number_of_shards": "3",
+ "number_of_replicas": "1",
+ "routing.allocation.require.box_type": "cold"
+ }
+}
+You can perform operations on the created index.
+PUT myindex/_settings
+ {
+ "index.routing.allocation.require.box_type": "cold"
+ }
+You can cancel the configurations of hot and cold data nodes.
+PUT myindex/_settings
+{
+ "index.routing.allocation.require.box_type": null
+ }
+CSS allows you to modify configurations in the elasticsearch.yml file on the CSS console. You need to restart the cluster for the modifications to take effect.
+Module Name + |
+Parameter + |
+Description + |
+
|---|---|---|
Cross-domain Access + |
+http.cors.allow-credentials + |
+Whether to return the Access-Control-Allow-Credentials of the header during cross-domain access +Value: true and false +Default value: false + |
+
http.cors.allow-origin + |
+Origin IP address allowed for cross-domain access, for example, 122.122.122.122:9200 + |
+|
http.cors.max-age + |
+Cache duration of the browser. The cache is automatically cleared after the time range you specify. +Unit: s +Default value: 1,728,000 + |
+|
http.cors.allow-headers + |
+Headers allowed for cross-domain access, including X-Requested-With, Content-Type, and Content-Length. Use commas (,) and spaces to separate headers. + |
+|
http.cors.enabled + |
+Whether to allow cross-domain access +Value: true and false +Default value: false + |
+|
http.cors.allow-methods + |
+Methods allowed for cross-domain access, including OPTIONS, HEAD, GET, POST, PUT, and DELETE. Use commas (,) and spaces to separate methods. + |
+|
Reindexing + |
+reindex.remote.whitelist + |
+Configured for migrating data from the current cluster to the target cluster through the reindex API. The example value is 122.122.122.122:9200. + |
+
Custom Cache + |
+indices.queries.cache.size + |
+Cache size in the query phase +Value range: 1 to 100 +Unit: % +Default value: 10% + |
+
Queue Size in a Thread Pool + |
+thread_pool.bulk.queue_size + |
+Queue size in the bulk thread pool. The value is an integer. +Default value: 200 + |
+
thread_pool.write.queue_size + |
+Queue size in the write thread pool. The value is an integer. +Default value: 200 + |
+|
thread_pool.force_merge.size + |
+Queue size in the force merge thread pool. The value is an integer. +Default value: 1 + |
+|
Customize + |
+You can add parameters based on your needs. + |
+Customized parameters + NOTE:
+
|
+
In the displayed Submit Configuration dialog box, select the box indicating "I understand that the modification will take effect after the cluster is restarted." and click Yes.
+You can view the modification records on the displayed page. The system displays a maximum of 20 records.
+
You need to restart the cluster after modification. If you do not restart the cluster after modifying the parameter configurations, Configuration unupdated is displayed in the Task Status column on the Clusters page.
+If you restart the cluster after the modification, Task Status displays Configuration error, the parameter configuration file fails to be modified.
+The VPC endpoint service allows you to access the cluster through a private domain name. When the VPC endpoint service is enabled, the system creates a VPC endpoint for you by default. To create a VPC endpoint, you must have the required permissions. For details, see .
+
The public IP address access and VPC endpoint service share a load balancer. If you have configured a public access whitelist, public and private IP addresses that access the cluster through VPCEP are restricted because the public IP address access shares the load balancer with the VPC endpoint service. In this case, you need to add IP address 198.19.128.0/17 to the public access whitelist to allow traffic through VPCEP.
+Click
to add multiple accounts. You can also click Delete in the Operation column to delete accounts.
You can enable the VPC endpoint service while creating a cluster, and also enable it by performing the following steps after cluster creation.
+
indicates disabling the VPC endpoint service and
indicates enabling the VPC endpoint service.
In the displayed dialog box, you can determine whether to enable the private domain name. After a private domain name is created, you can access the cluster using the private domain name.
+
The VPC Endpoint Service page displays all VPC endpoints connected to the current VPC endpoint service. You can accept or reject the connection with these endpoints. If you reject the connection with a VPC endpoint, you cannot access the cluster through the private domain name generated by the VPC endpoint.
+Log in to the CSS console, click the target cluster name and go to the Basic Information page. Click the VPC Endpoint Service tab and view the private domain name.
+If you have applied for the VPC endpoint service, log in to the and click the target ID to go to the Summary page and view the private domain name.
+The ECS must meet the following requirements:
+If this requirement is not met, modify the ECS security group or configure the inbound and outbound rules of the ECS security group to allow the ECS security group to be accessed by all security groups of the cluster. For details, see Configuring Security Group Rules.
+For CSS clusters that have security mode enabled, you can access Kibana through the Internet after configuring Kibana public access. For a cluster that has security mode enabled, CSS allows you to enable Kibana public access and configure access bandwidth. After the configuration is complete, the cluster obtains a Kibana public IP address that you can use to access Kibana of this cluster.
+You can configure Kibana public access when creating a cluster or configure this function after enabling security mode for a cluster.
+
Clusters purchased before rollout of this feature do not support this function.
+You can enable Security Mode for clusters of version 6.5.4 and later versions.
+Parameter + |
+Description + |
+
|---|---|
Bandwidth + |
+Bandwidth for accessing Kibana with the public IP address +Value range: 1 to 100 +Unit: Mbit/s + |
+
Access Control + |
+If you disable this function, any IP addresses can access the cluster through the public IP address. If you enable this function, only IP addresses or IP address ranges in the whitelist can access the cluster through the public IP address. + |
+
Whitelist + |
+IP address or IP address range allowed to access a cluster. Use commas (,) to separate multiple addresses. +You are advised to enable this function. + |
+
After the cluster is created, click the cluster name to go to the Basic Information page. On the Kibana Public Access page, you can view the Kibana public IP address.
+You can enable, disable, modify, and view Kibana public access for an existing cluster that has security mode enabled.
+
indicates that Kibana public access is disabled.
indicates that Kibana public access is enabled.
Parameter + |
+Description + |
+
|---|---|
Bandwidth + |
+Bandwidth for accessing Kibana with the public IP address +Value range: 1 to 100 +Unit: Mbit/s + |
+
Access Control + |
+If you disable this function, any IP addresses can access the cluster through the public IP address. If you enable this function, only IP addresses or IP address ranges in the whitelist can access the cluster through the public IP address. + |
+
Whitelist + |
+IP address or IP address range allowed to access a cluster. Use commas (,) to separate multiple addresses. +You are advised to enable this function. + |
+
CSS allows you to modify bandwidth and access control of clusters configured with Kibana public access.
+After configuring Kibana public access, you will obtain a public IP address that you can use to access Kibana of this cluster.
+Parameter + |
+Description + |
+
|---|---|
Region + |
+Select a region for the cluster from the drop-down list on the right. Currently, only eu-de is supported. + |
+
AZ + |
+Select an AZ associated with the cluster region. +You can select one or more AZs. For details, see Multi-AZ HA. + |
+
Parameter + |
+Description + |
+
|---|---|
Version + |
+Select a cluster version from the drop-down list box. + |
+
Name + |
+Name of a cluster. Cluster names contain 4 to 32 characters. Only letters, numbers, hyphens (-), and underscores (_) are allowed and the value must start with a letter. + NOTE:
+After a cluster is created, you can modify the cluster name as required. Click the name of a cluster to be modified. On the displayed Basic Information page, click |
+

Parameter + |
+Description + |
+
|---|---|
Nodes + |
+Number of nodes in a cluster. +
|
+
CPU Architecture + |
+Currently, x86 and Kunpeng are supported. The supported type is determined by the actual regional environment. + |
+
Node Specifications + |
+Specifications of nodes in a cluster. You can select a specified specification based on your needs. Only one node specification can be selected for each cluster. You cannot select the CPU and memory resources that have been sold out. +Currently, the following flavors are supported: css.medium.8, css.large.8, css.xlarge.8, css.2xlarge.8, and css.4xlarge.8. +After you select a flavor, the CPU and memory corresponding to the current specification are displayed below the parameter. For example, if you select css.medium.8, then 1 vCPUs | 8 GB will be displayed, indicating that the node flavor you select contains one vCPU and 8 GB memory. + |
+
Node Storage Type + |
+In the current version, the following options are available: Common I/O, High I/O, and Ultra-high I/O. + |
+
Node Storage Capacity + |
+Storage space. Its value varies with node specifications. +
|
+
Disk Encryption + |
+If you select this option, the nodes in the cluster you create will use encrypted EVS disks to protect data. By default, this option is not selected. Note that you cannot modify this setting after the cluster is created. Therefore, exercise caution when performing the setting. +After you select this option, you need to select an available key from the Key Name drop-down list. If no key is available, click Create/View Key to go to the KMS management console and create or modify a key. For details, see Creating a CMK. +Enabling disk encryption has no impact on your operations on a cluster (such as accessing the cluster and importing data to the cluster). However, after you enable disk encryption, operation performance deteriorates by about 10%. + NOTE:
+
|
+
Master node + |
+The master node manages all nodes in the cluster. If 20 or more nodes are required to store and analyze the large amount of data, you are advised to enable the master node to ensure cluster stability. Otherwise, you are advised to set only the Nodes parameter and use the nodes as both master and client nodes.. +After enabling the master node, specify Node Specifications, Nodes, and Node Storage Type. The value of Nodes must be an odd number equal to or greater than 3. You can set a maximum of nine nodes. The value of Node Storage Capacity is fixed. You can select a storage type based on your needs. By default, the node storage type is High I/O and the node storage capacity is 40 GB. + |
+
Client node + |
+The client node allows clients to access clusters and analyze data. If more than 20 nodes are required to store and analyze a large amount of data, you are advised to enable the client node to ensure cluster stability. Otherwise, you are advised to set only the Nodes parameter and use the nodes as both master and client nodes.. +After enabling the client node, specify Node Specifications, Nodes and Node Storage Type. The value of Nodes ranges from 1 to 32. The value of Node Storage Capacity is fixed. You can select a storage type based on your needs. By default, the node storage type is High I/O and the node storage capacity is 40 GB. + |
+
Cold data node + |
+The cold data node is used to store historical data, for which query responses can be returned in minutes. If you do not quire a quick query response, store historical data on cold data nodes to reduce costs. +After enabling cold data node, configure Node Specifications, Nodes, Node Storage Type, and Node Storage Capacity. The value of Nodes ranges from 1 to 32. Select Node Storage Type and Node Storage Capacity as requirement. +After the cold data node is enabled, CSS automatically adds cold and hot tags to related nodes. + |
+

Parameter + |
+Description + |
+
|---|---|
VPC + |
+A VPC is a secure, isolated, and logical network environment. +Select the target VPC. Click View VPC to enter the VPC management console and view the created VPC names and IDs. If no VPC is available, create a VPC. + NOTE:
+The VPC must contain CIDRs. Otherwise, cluster creation will fail. By default, a VPC will contain CIDRs. + |
+
Subnet + |
+A subnet provides dedicated network resources that are isolated from other networks, improving network security. +Select the target subnet. You can access the VPC management console to view the names and IDs of the existing subnets in the VPC. + |
+
Security Group + |
+A security group is a collection of access control rules for ECSs that have the same security protection requirements and are mutually trusted in a VPC. To view more details about the security group, click View Security Group. + NOTE:
+
|
+
Security Mode + |
+Security mode is disabled. + NOTE:
+You can enable Security Mode only when you create a cluster. After a cluster is created, its security mode cannot be changed. + |
+

When creating a CSS cluster, you can bind an enterprise project to the cluster if you have enabled enterprise project. You can select an enterprise project created by the current user from the drop-down list or click View Project Project to go to the Enterprise Project Management console and create a new project or view existing projects.
+By default, the cluster snapshot function is enabled. If you do not need this function, you can disable Cluster Snapshot.
+For details, see Managing Automatic Snapshot Creation.
+Automatic Snapshot Creation
+You can customize Snapshot Name Prefix, Backup Start Time, and Retention Period (days) as required.
+Parameter + |
+Description + |
+
|---|---|
VPC Endpoint Service + |
+After enabling this function, you can obtain a private domain name for accessing the cluster in the same VPC. For details, see VPC Endpoint Service. + |
+
Kibana Public Access + |
+Clusters in non-security mode cannot access Kibana through the Internet. + |
+
Tag + |
+Adding tags to clusters can help you identify and manage your cluster resources. You can customize tags or use tags predefined by TMS. For details, see Managing Tags. + |
+
If the cluster creation fails, create the cluster again.
+CSS uses network isolation, in addition to various host and data security measures.
+The entire network is divided into two planes: service plane and management plane. The two planes are deployed and isolated physically to ensure the security of the service and management networks.
+CSS provides the following security measures:
+Multiple replicas, cross-AZ deployment of clusters, and third-party (OBS) backup of index data ensure the security of user data.
+Disk usage and cluster health status are two key metrics that you can focus on. You can log in to Cloud Eye and configure alarm rules for these metrics. If alarms are reported, handle them by taking appropriate measures. For details about how to configure alarms, see Creating Alarm Rules.
+Configuration examples:
+Measures:
+CSS uses EVS and local disks to store your indices. During cluster creation, you can specify the EVS disk type and specifications (the EVS disk size).
+You can configure up to 200 nodes for a cluster (each node corresponds to an ECS). The maximum storage capacity of an ECS is the total capacity of EVS disks attached to the ECS. You can calculate the total storage capacity of CSS based on the sizes of EVS disks attached to different ECSs. The EVS disk size is determined by the node specifications selected when you create the cluster.
+You can store the following logs and files:
+curl is a command-line tool used to transfer data to or from a given URL. It serves as an HTTP client that can send HTTP requests to the HTTP server and receive response messages. You can also use curl to debug APIs. For more information about curl, visit https://curl.haxx.se/.
+You can call APIs through code to assemble, send, and process request messages.
+Both Mozilla Firefox and Google Chrome provide a graphical browser plugin, the REST client, which you can use to send and process requests.
+– For Mozilla Firefox, see Firefox REST Client.
+– For Google Chrome, see Postman.
+Filebeat is a high-performance file collection tool. By default, one core is allocated to Filebeat, and it writes 1 MB data to Elasticsearch per second. However, in practice, when a large number of service logs are generated, Filebeat cannot promptly collect and write them to Elasticsearch. In this case, you can optimize parameter settings in the filebeat.yml file to improve the Filebeat performance.
+Increase the value of harvester_buffer_size based on actual requirements. This parameter defines the buffer size used by every harvester.
+harvester_buffer_size: 40,960,000
+Increase the value of filebeat.spool_size based on actual requirements. This parameter defines the number of log records that can be uploaded by the spooler at a time.
+filebeat.spool_size: 250,000
+Adjust the value of filebeat.idle_timeout based on actual requirements. This parameter defines how often the spooler is flushed. After the idle_timeout is reached, the spooler is flushed regardless of whether the spool_size has been reached.
+filebeat.idle_timeout: 1s
+Set the value of worker to the number of Elasticsearch clusters based on actual requirements. This parameter indicates the number of Elasticsearch clusters. The default value is 1.
+worker: 1
+Increase the value of bulk_max_size based on actual requirements. This parameter defines the maximum number of events to bulk in a single Elasticsearch bulk API index request. The default is 50.
+bulk_max_size: 15,000
+Adjust the value of flush_interval based on the actual requirements. This parameter defines the number of seconds to wait for new events between two bulk API index requests. If bulk_max_size is reached before this interval expires, additional bulk index requests are made.
+flush_interval: 1s
+After I click Access Kibana in the Operation column in the row where cluster Es-event resides on the Clusters page of the CSS management console, the Kibana page fails to be loaded and access to Kibana fails.
+The browser cache is not cleared.
+
If the cluster has the security mode enabled, enter the username and password you for login. Generally, the username is admin and the password is the one specified during cluster creation.
+If you forget the password, you can reset it on the cluster details page and then log in. For details, see .
+In CSS, Elasticsearch 7.6.2, and 7.9.3 and Kibana 7.6.2, and 7.9.3 are supported.
+Yes. It is recommended that the Logstash version be the same as the Elasticsearch version. You need to apply for an ECS to install and configure Logstash.
+Perform the following steps:
+
If the cluster contains multiple nodes, check whether the ECS can be connected to each node in the cluster.
+CSS supports full-text search, highlighting, facet search, near real-time search, dynamic clustering, processing of documents of various types like word and PDF, and geographic information search.
+For details about the search function supported by Elasticsearch, see section "Search in Depth" in the Elasticsearch Reference.
+The following reasons may cause cluster creation to fail:
+Index backup is implemented by creating cluster snapshots. If index backup fails, perform the following steps:
+For details, see Viewing or Modifying User Information.
+For details, see Viewing and Modifying User Group Information.
+For details, see Viewing and Modifying User Group Information.
+ +A region and availability zone (AZ) identify the location of a data center. You can create resources in a specific region and AZ.
+You are advised to select a region close to you or your target users. This reduces network latency and improves the access success rate.
+When determining whether to deploy resources in the same AZ, consider your application's requirements for disaster recovery (DR) and network latency.
+Before using an API to call resources, you will need to specify the resource region and endpoint. For details about public cloud regions and endpoints, see Regions and Endpoints.
+Cloud Search Service (CSS) is a fully managed, distributed search service that enables you to perform quick, real-time search. It is fully compatible with open-source Elasticsearch and provides users with structured and unstructured data search, statistical analysis, and reporting capabilities. CSS works in the way similar to a database.
+You can easily deploy CSS and quickly create clusters. With optimal configurations, CSS is O&M-free. CSS provides you with key metrics regarding the system, clusters, and query performance, freeing you to focus on business logic.
+For details about Elasticsearch, see the Elasticsearch Reference.
+CSS has the following advantages:
+You can derive insights from terabyte-scale data in milliseconds. In addition, you can use its visualized data platform to easily analyze data.
+You can request clusters and scale out a cluster online with zero service interruption.
+Custom word dictionaries are supported. You can modify the word dictionary without having to restart instances.
+CSS is fully-managed and out-of-the-box. You can start using it with a few clicks. Professionals are ready to assist you whenever you want.
+You can choose to trigger snapshots manually or periodically restore snapshots of clusters. You can restore snapshots of a cluster to another cluster to migrate cluster data.
+CSS provides the following functions:
+The management console allows you to securely manage and maintain clusters using a web browser.
+CSS Elasticsearch clusters are suitable to scenarios such as log analysis and site search.
+You can perform O&M analysis and troubleshoot IT devices, and perform operation analytics based on service metrics.
+You can search website content by keyword as well or search for products on e-commerce sites with recommendations obtained.
+CSS provides functions on a per cluster basis. A cluster represents an independent search service that contains multiple nodes.
+Index is similar to "database" in the relational database (RDB) and stores Elasticsearch data. It refers to a logical space that consists of one or more shards.
+ +Elasticsearch + |
+Index + |
+Type + |
+Document + |
+Field + |
+Mapping + |
+
|---|---|---|---|---|---|
RDB + |
+Database + |
+Table + |
+Row + |
+Column + |
+Schema + |
+
An index can potentially store a large amount of data that exceeds the hardware limits of a single node. To solve this problem, Elasticsearch subdivides your index into multiple pieces called shards. When you create an index, you can simply define the number of shards that you want. Each shard is in itself a fully-functional and independent "index" that can be hosted on any node in the cluster.
+You need to specify the number of shards before creating an index and cannot change the number of shards after the index is created.
+A replica is a copy of the actual storage index in a shard. It can be understood as a backup of the shard. Replicas help prevent single point of failures (SPOFs). You can increase or decrease the number of replicas based on your service requirements.
+An entity for Elasticsearch storage. Equivalent to a row in the RDB, the document is the basic unit that can be indexed.
+Similar to a table in the RDB, type is used to distinguish between different data. One index can contain multiple document types. A document must be indexed to a document type inside an index.
+A mapping is used to restrict the type of a field and is automatically created based on data. It is similar to a schema in the database.
+Minimum unit of a document. A field is similar to a column in a database.
+This section describes the relationship between CSS and other services.
+CSS clusters are created in the subnets of a VPC. VPCs provide a secure, isolated, and logical network environment for your clusters.
+In a CSS cluster, each node represents an ECS. When you create a cluster, ECSs are automatically created.
+CSS uses EVS to store index data. When you create a cluster, EVSs are automatically created for cluster data storage.
+CSS uses Cloud Eye to monitor cluster metrics in real time. The supported CSS metrics include the disk usage and cluster health status. You can learn about the disk usage of the cluster based on the disk usage metric. You can learn about the health status of a cluster based on the cluster health status metric.
+With CTS, you can record operations associated with CSS for query, audit, and backtrack operations.
+If disk encryption is enabled on CSS clusters, you need to obtain the key provided by KMS to encrypt and decrypt the disk data.
+The following table describes restrictions on clusters and nodes in CSS.
+ +Cluster and Node + |
+Restriction + |
+
|---|---|
Maximum number of nodes in a cluster + |
+32 + |
+
Minimum number of nodes in a cluster + |
+1 + |
+
Kibana is an open-source data analytics and visualization platform that works with Elasticsearch. You can use Kibana to search, view, and interact with data stored in Elasticsearch indices and to visualize your data in a variety of charts, tables, and maps.
+To learn more about Kibana, go to the Kibana official website: https://www.elastic.co/guide/en/kibana/current/index.html
+CSS is integrated with Kibana. You can access Kibana with just a few clicks, without installing Kibana.
+Log in to the CSS management console. In the left navigation pane, click Clusters. On the displayed Clusters page, locate the row containing the target cluster and click Access Kibana in the Operation column.
+Kibana delivers visualization and Elasticsearch statistics and analysis functions. Kibana supports:
+Security mode is supported for Elasticsearch 7.1.1 and later versions. After you enable security mode, identity verification, authorization, and encryption are required.
+This section describes the security mode using Kibana as an example.
+
You can enable security mode only during cluster creation and not after the cluster is created.
+Term + |
+Description + |
+
|---|---|
Permission + |
+Single action, for example, creating an index (for example, indices:admin/create) + |
+
Action group + |
+A group of permissions. For example, the predefined SEARCH action group grants roles permissions to use _search and _msearchAPI. + |
+
Role + |
+A role is a combination of permissions and action groups, including operation permissions on clusters, indices, documents, or fields. + |
+
Backend role + |
+(Optional) Other external roles from the backend such as LDAP/Active Directory + |
+
User + |
+A user can send operation requests to the Elasticsearch cluster. The user has credentials such as username and password, zero or more backend roles, and zero or more custom attributes. + |
+
Role mapping + |
+A user will be assigned a role after successful authentication. Role mapping is to map a role to a user (or a backend role). For example, the mapping from kibana_user (role) to jdoe (user) means that John Doe obtains all permissions of kibana_user after being authenticated by kibana_user. Similarly, the mapping from all_access (role) to admin (backend role) means that any user with the backend role admin (from the LDAP/Active Directory server) has all the permissions of role all_access after being authenticated. You can map each role to multiple users or backend roles. + |
+
After enabling the security mode, you need to log in to the cluster with the username and password that you set when you create the cluster. You can perform other operations after you log in successfully.
+
On the Kibana console, click Security to control user permissions in Elasticsearch clusters. You can configure hierarchical user permissions by cluster, index, document, and field.
+You can add or delete users, and map users to different roles for permissions control.
+
You can use role mapping to configure roles and map a user's username, backend role, and host name to a role.
+
You can set permissions for each role to access clusters, indices and documents and assign Kibana tenants different roles.
+
You can set action groups, assign the groups to roles, and configure the roles' permission for accessing indices and documents.
+
You can view the parameters of authentication and authorization for the current cluster. You can also run the securityadmin command to modify the configuration.
+
You can also clear the security cache.
+
When key data is transferred between nodes or over HTTP, SSL/TLS encryption is used to ensure data security.
+You can perform the preceding functions on Kibana, using .yml files (not recommended), or by calling RESTful APIs. For more information about the security mode, see Security.
+If you want to change the login password of a cluster with the security mode enabled or you have forgotten the password, reset the cluster password.
+
Cerebro is an open-source Elasticsearch web visualized management tool built using Scala, Play Framework, AngularJS, and Bootstrap. Cerebro allows you to manage clusters on a visualized page, such as executing REST requests, modifying Elasticsearch configurations, monitoring real-time disks, cluster load, and memory usage.
+CSS is integrated with Cerebro. You can access Cerebro with a few clicks, without installing Cerebro.
+Log in to the CSS management console. In the left navigation pane, click Clusters. On the displayed Clusters page, locate the row containing the target cluster and choose More > Access Cerebro in the Operation column.
+On the displayed page, enter one private access address of the cluster.
+CSS is fully compatible with the open-source Cerebro and the latest version Cerebro 0.8.4 is supported. Cerebro delivers the following functions:
+To prevent data loss and minimize the cluster downtime in case of service interruption, select two or three AZs in the same region when you create a cluster.
+If you select two or three AZs when creating a cluster, CSS automatically enables the cross-AZ HA function and properly allocates nodes to different AZs.
+The following table lists the way nodes are allocated.
+ +Nodes + |
+One AZ + |
+Two AZs + |
+Three AZs + |
+|||
AZ1 + |
+AZ1 + |
+AZ2 + |
+AZ1 + |
+AZ2 + |
+AZ3 + |
+|
1 + |
+1 + |
+Not supported + |
+Not supported + |
+|||
2 + |
+2 + |
+1 + |
+1 + |
+Not supported + |
+||
3 + |
+3 + |
+2 + |
+1 + |
+1 + |
+1 + |
+1 + |
+
4 + |
+4 + |
+2 + |
+2 + |
+2 + |
+1 + |
+1 + |
+
... + |
+... + |
+... + |
+... + |
+... + |
+... + |
+... + |
+
HA can be ensured when you properly configure the number of replicas.
+You can run the following command to modify the number of index replicas:
+curl -XPUT http://ip:9200/{index_name}/_settings -d '{"number_of_replicas":2}'
+Alternatively, specify the number of replicas in the template:
+curl -XPUT http://ip:9200/ _template/templatename -d '{ "template": "*", "settings": {"number_of_replicas": 2}}'
+
If you select the master node function when you create a cluster, master nodes will be allocated in different AZs when you select multiple AZs.
+Table 1 shows the service fault analysis if you select two or three AZs when you create a cluster and one AZ is faulty.
+ +AZs + |
+Master Nodes + |
+Service Interruption Analysis + |
+
|---|---|---|
2 + |
+0 + |
+
|
+
2 + |
+3 + |
+There is a 50% possibility for service interruption. When two dedicated master nodes are allocated to one AZ and another master node is allocated to the other AZ, +
|
+
3 + |
+0 + |
+If you configure four nodes in three AZs, each AZ is allocated with two, one, and one node respectively. Services will be interrupted if the AZ with two nodes is faulty. You are advised not to configure four nodes when selecting three AZs. + |
+
3 + |
+3 + |
+Service interruption does not occur. + |
+