Creating a Graph (2.2.2)
Function
This API is used to create a graph.
URI
POST /v2/{project_id}/graphs
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition Project ID. For details about how to obtain a project ID, see Obtaining a Project ID. Constraints N/A Range The value can contain up to 64 characters. Only letters and digits are allowed. Default Value N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition User token. It is used to obtain the permission to call APIs. For how to obtain the token, see Authentication. (The token is the value of X-Subject-Token in the response header.) Constraints N/A Range N/A Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
graph |
Yes |
graph object |
Definition Graph type. Constraints N/A Range N/A Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Definition Graph name. Constraints The value must contain 4 to 50 characters and must start with a letter. Only letters, digits, and underscores (_) are allowed. Range N/A Default Value N/A |
|
graph_size_type_index |
Yes |
String |
Definition Graph size type. Constraints N/A Range
Default Value N/A |
|
arch |
No |
String |
Definition CPU architecture of a graph instance. Constraints N/A Range
Default Value x86_64 |
|
vpc_id |
Yes |
String |
Definition VPC ID. Constraints N/A Range N/A Default Value N/A |
|
subnet_id |
Yes |
String |
Definition Subnet ID in the VPC. Constraints N/A Range N/A Default Value N/A |
|
security_group_id |
Yes |
String |
Definition Security group ID. Constraints N/A Range N/A Default Value N/A |
|
public_ip |
No |
public_ip object |
Definition Public IP address. If unspecified, a public connection will not be used by default. Constraints N/A Range N/A Default Value N/A |
|
enable_multi_az |
No |
Boolean |
Definition Whether the graph supports cross-AZ deployment. Constraints N/A Range
Default Value false |
|
sys_tags |
No |
Array of sys_tags objects |
Definition Enterprise project information. Constraints N/A Range N/A Default Value N/A |
|
tags |
No |
Array of tags objects |
Definition Whether to support TMS for cost allocation. Constraints N/A Range N/A Default Value N/A |
|
enable_rbac |
No |
Boolean |
Definition Whether to enable fine-grained permission control for the graph. If set to true, all users will have no permissions by default after the graph is created. Access to the graph can only be granted by calling the service-plane fine-grained permission control API to authorize specific operations or users. Constraints N/A Range
Default Value false |
|
enable_full_text_index |
No |
Boolean |
Definition Whether to enable full-text indexing control for the graph. If set to true, full-text indexes are available for Billion-edge-pro graphs, and a Cloud Search Service (CSS) cluster will be created when you create a graph. Constraints N/A Range
Default Value false |
|
enable_hyg |
No |
Boolean |
Definition Whether to enable HyG for the graph. This parameter is available only for database edition graphs. Constraints N/A Range N/A Default Value N/A |
|
crypt_algorithm |
No |
String |
Definition Cryptographic algorithm of a graph instance. Constraints N/A Range
Default Value N/A |
|
enable_https |
No |
Boolean |
Definition Whether the security mode is enabled. Enabling the security mode will have a significant impact on performance. Constraints N/A Range
Default Value true |
|
product_type |
No |
String |
Definition Graph product type. Constraints N/A Range
Default Value The default value is Persistence when graph_size_type_index is 6. |
|
vertex_id_type |
No |
vertex_id_type object |
Definition ID type of a vertex. Constraints This parameter is mandatory only for database edition graphs. The vertex ID type cannot be changed once set. Exercise caution when setting this parameter. Range N/A Default Value N/A |
|
capacity_ratio |
No |
Integer |
Definition Capacity rate of a graph. Constraints This parameter is only available for Ten-billion-edge graphs of the database edition since version 2.3.18. Range N/A Default Value N/A |
|
is_dynamic_graph |
No |
Boolean |
Definition Whether a graph is a dynamic one. Constraints N/A Range N/A Default Value N/A |
|
sort_key_type |
No |
String |
Definition Type of the sort key for a database edition graph. Different sort key values are configured to distinguish duplicate edges (edges with the same source vertex, end vertex, and label). Constraints This parameter is mandatory only for database edition graphs. Range
Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
public_bind_type |
No |
String |
Definition EIP binding type. Constraints N/A Range
Default Value N/A |
|
eip_id |
No |
String |
Definition ID of an EIP. When publicBindType is set to bind_existing, the value is the ID of a user's existing EIP that has been created but not yet bound. When publicBindType is set to auto_assign, this value should be left empty. Constraints N/A Range N/A Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
No |
String |
Definition Key of an enterprise project. The value is _sys_enterprise_project_id. Constraints N/A Range N/A Default Value N/A |
|
value |
No |
String |
Definition Enterprise project ID. You can obtain it from the enterprise project. Constraints N/A Range N/A Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
No |
String |
Definition Tag key. Constraints N/A Range N/A Default Value N/A |
|
value |
No |
String |
Definition Tag value. Constraints N/A Range N/A Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
id_type |
Yes |
String |
Definition ID type. Constraints When creating a HyG graph, id_type can only be fixedLengthString. Range
Default Value N/A |
|
id_length |
No |
Integer |
Definition ID length. Constraints This parameter is mandatory when id_type is fixedLengthString. Range N/A Default Value N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Definition Graph ID. Range N/A |
|
name |
String |
Definition Graph name. Range N/A |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
Definition System prompt.
Range N/A |
|
error_code |
String |
Definition System prompt.
Range N/A |
Example Request
Create a graph. The graph name is demo, the graph size is Million-edge, the graph instance CPU architecture type is x86 64-bit, the VPC ID is 2d8af840-fd57-4e3b-a8f1-cda0f55ccd99, the subnet ID is dc018ec3-67d1-46c9-b2fc-19d83367f4e2, and the security group ID is 11d27338-8649-4076-8579-5ebc1a60f79e.
POST https://{Endpoint}/v2/{project_id}/graphs
{
"graph" : {
"name" : "demo",
"graph_size_type_index" : "1",
"arch" : "x86_64",
"vpc_id" : "2d8af840-fd57-4e3b-a8f1-cda0f55ccd99",
"subnet_id" : "dc018ec3-67d1-46c9-b2fc-19d83367f4e2",
"security_group_id" : "11d27338-8649-4076-8579-5ebc1a60f79e",
"public_ip" : {
"public_bind_type" : "bind_existing",
"eip_id" : "30ef2d58-08a9-4481-b526-b2cbe67d020d"
},
"enable_multi_az" : false,
"sys_tags" : [ {
"key" : "_sys_enterprise_project_id",
"value" : "54c0b33c-8627-462f-948e-bae08c0887b4"
} ],
"crypt_algorithm" : "generalCipher",
"enable_https" : false
}
}
Example Response
Status code: 200
Example response for a successful request
{
"id" : "f1529b88-c958-493e-8452-fccfe932cde1",
"name" : "demo"
}
Status code: 400
Example response for a failed request
{
"error_code" : "GES.7016",
"error_msg" : "The parameter [subnetId] is not exist."
}
Status Codes
|
Return Value |
Description |
|---|---|
|
400 Bad Request |
Request error. |
|
401 Unauthorized |
Authorization failed. |
|
403 Forbidden |
No operation permissions. |
|
404 Not Found |
No resources found. |
|
500 Internal Server Error |
Internal server error. |
|
503 Service Unavailable |
Service unavailable. |
Error Codes
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot