华为云用户手册

  • URI GET /api/v1/namespaces/{namespace}/pods/{name}/status 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the Pod namespace 是 String object name and auth scope, such as for teams and projects 表2 Query参数 参数 是否必选 参数类型 描述 pretty 否 String If 'true', then the output is pretty printed.
  • 状态码 状态码 描述 200 OK 201 Created 202 Accepted 400 BadRequest 401 Unauthorized 403 Forbidden 404 NotFound 405 MethodNotAllowed 406 NotAcceptable 409 AlreadyExists 415 UnsupportedMediaType 422 Invalid 429 TooManyRequests 500 InternalError 503 ServiceUnavailable 504 ServerTimeout
  • 请求示例 创建Network,指定账号ID、项目ID和安全组ID,关联VPC和子网网段。 metadata.annotations必选字段数据结构说明 参数 是否必选 参数类型 描述 network.alpha.kubernetes.io/default-security-group Yes String Network对应子网所属安全组ID。 network.alpha.kubernetes.io/project-id Yes String Network所属用户的project-id,获取方法请参见获取项目ID。 network.alpha.kubernetes.io/domain-id Yes String Network所属用户的domain-id,获取方法请参见获取帐号ID。 VPC网络类型 参数 是否必选 参数类型 描述 cidr No String Network对应VPC子网的网段。**说明:**此处VPC和子网的网段不能为10.247.0.0/16,10.247.0.0/16是云容器实例预留给Service的网段。如果您使用此网段,后续可能会造成IP冲突,导致负载无法创建或服务不可用;如果您不需要通过Service访问,而是直接访问Pod,则可以使用此网段。 attachedVPC Yes String Network所在VPC的ID。 networkType Yes String Network网络类型,VPC网络类型取值:underlay_neutron。 networkID Yes String Network对应VPC子网的网络ID。 subnetID Yes String Network对应VPC子网的子网ID。 availableZone Yes String Network对应VPC子网所在可用区。当前支持“华北-北京四”、“华东-上海一”、“华东-上海二”和“华南-广州”区域,该值可设置为、“cn-north-4a”、“cn-east-3a”、“cn-east-2d”或“cn-south-1f”。 { "apiVersion" : "networking.cci.io/v1beta1", "kind" : "Network", "metadata" : { "annotations" : { "network.alpha.kubernetes.io/default-security-group" : "security-group-id", "network.alpha.kubernetes.io/domain-id" : "domain-id", "network.alpha.kubernetes.io/project-id" : "project-id" }, "name" : "test-network", "namespace" : "test-ns" }, "spec" : { "attachedVPC" : "vpc-id", "availableZone" : "cn-north-4a", "cidr" : "192.168.0.0/24", "networkID" : "network-id", "networkType" : "underlay_neutron", "subnetID" : "subnet-id" } }
  • URI POST /apis/networking.cci.io/v1beta1/namespaces/{namespace}/networks 表1 路径参数 参数 是否必选 参数类型 描述 namespace 是 String object name and auth scope, such as for teams and projects 表2 Query参数 参数 是否必选 参数类型 描述 dryRun 否 String When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed fieldManager 否 String fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. pretty 否 String If 'true', then the output is pretty printed.
  • 响应示例 状态码: 200 OK { "apiVersion" : "networking.cci.io/v1beta1", "kind" : "Network", "metadata" : { "annotations" : { "network.alpha.kubernetes.io/default-security-group" : "security-group-id", "network.alpha.kubernetes.io/domain-id" : "domain-id", "network.alpha.kubernetes.io/project-id" : "project-id", "network.alpha.kubernetes.io/type" : "underlay_neutron" }, "creationTimestamp" : "2018-08-21T02:35:59Z", "name" : "test-network", "namespace" : "test-ns", "resourceVersion" : "2025736", "selfLink" : "/apis/networking.cci.io/v1beta1/namespaces/test-ns/networks/test-network", "uid" : "f03452ac-a4ea-11e8-8500-c81fbe371a17" }, "spec" : { "attachedVPC" : "vpc-id", "availableZone" : "cn-north-4a", "cidr" : "192.168.0.0/24", "networkID" : "network-id", "networkType" : "underlay_neutron", "subnetID" : "subnet-id" }, "status" : { "state" : "Initializing" } }
  • 功能介绍 创建一个Network对象。 Network对象是华为云CCI新增对象,用于定义kubernetes中一个namespace内的网络。目前CCI支持VPC网络,一个VPC网络类型的network对象对应于华为云虚拟私有云服务中的一个子网。 CCI的容器网络依赖于华为云底层VPC网络,因此在创建network对象前,需要先调用虚拟私有云的接口创建或者查询已有子网信息。 须知: 此处VPC和子网的网段不能为10.247.0.0/16,10.247.0.0/16是云容器实例预留给Service的网段。如果您使用此网段,后续可能会造成IP冲突,导致负载无法创建或服务不可用;如果您不需要通过Service访问,而是直接访问Pod,则可以使用此网段。 具体如何创建一个Network对象,可以参考Namespace和Network
  • 响应示例 状态码: 201 Created { "metadata" : { "annotations" : { "namespace.kubernetes.io/flavor" : "gpu-accelerated", "pv.kubernetes.io/enable-dynamic-provisioning" : "true", "tenant.kubernetes.io/domain-id" : "aadb43c0b14c4cafbccfff483d075987", "tenant.kubernetes.io/domain-name" : "cci", "tenant.kubernetes.io/project-id" : "51bf52609f2a49c68bfda3398817b376", "tenant.kubernetes.io/project-name" : "southchina" }, "creationTimestamp" : "2018-09-03T11:20:48Z", "labels" : { "sys_enterprise_project_id" : "0503dda897000fed2f78c00909158a4d" }, "name" : "namespace-test", "resourceVersion" : "5016746", "selfLink" : "/api/v1/namespaces/namespace-test", "uid" : "68a68c5a-af6b-11e8-8f17-c81fbe371a17" }, "spec" : { "finalizers" : [ "kubernetes" ] }, "status" : { "phase" : "Active" } }
  • 功能介绍 创建一个Namespace。 当前云容器实例提供“通用计算型”和“GPU加速型”两种类型的资源,创建命名空间时需要选择资源类型,后续创建的负载中容器就运行在此类型的集群上。调用接口时必须指定metadata.annotations中namespace.kubernetes.io/flavor字段为如下值。 general-computing:通用计算型,基本水平的计算、存储和网络资源,适用于通用工作负载场景。 gpu-accelerated:GPU加速型,突出的图形计算能力,适用于AI等高性能场景。 Namespace下必须要创建一个Network,用于定义kubernetes中一个namespace内的网络与华为云虚拟私有云服务的子网和vpc的映射关系,具体请参见Namespace和Network。
  • 状态码 状态码 描述 200 OK 201 Created 202 Accepted 400 BadRequest 401 Unauthorized 403 Forbidden 404 NotFound 405 MethodNotAllowed 406 NotAcceptable 409 AlreadyExists 415 UnsupportedMediaType 422 Invalid 429 TooManyRequests 500 InternalError 503 ServiceUnavailable 504 ServerTimeout
  • 请求示例 创建GPU加速型命名空间。 { "apiVersion" : "v1", "kind" : "Namespace", "metadata" : { "annotations" : { "namespace.kubernetes.io/flavor" : "gpu-accelerated" }, "labels" : { "sys_enterprise_project_id" : "0" }, "name" : "namespace-test" } }
  • URI POST /api/v1/namespaces 表1 Query参数 参数 是否必选 参数类型 描述 dryRun 否 String When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed fieldManager 否 String fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. pretty 否 String If 'true', then the output is pretty printed.
  • URI POST /apis/apps/v1/namespaces/{namespace}/deployments 表1 路径参数 参数 是否必选 参数类型 描述 namespace 是 String object name and auth scope, such as for teams and projects 表2 Query参数 参数 是否必选 参数类型 描述 dryRun 否 String When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed fieldManager 否 String fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. pretty 否 String If 'true', then the output is pretty printed.
  • 状态码 状态码 描述 200 OK 201 Created 202 Accepted 400 BadRequest 401 Unauthorized 403 Forbidden 404 NotFound 405 MethodNotAllowed 406 NotAcceptable 409 AlreadyExists 415 UnsupportedMediaType 422 Invalid 429 TooManyRequests 500 InternalError 503 ServiceUnavailable 504 ServerTimeout
  • 请求示例 创建一个名为"deployment-test"的普通Deployment,使用redis镜像创建一个Pod,每个Pod占用500m core CPU、1024Mi内存。 { "apiVersion" : "apps/v1", "kind" : "Deployment", "metadata" : { "name" : "deployment-test" }, "spec" : { "replicas" : 1, "selector" : { "matchLabels" : { "app" : "redis" } }, "template" : { "metadata" : { "labels" : { "app" : "redis" } }, "spec" : { "containers" : [ { "image" : "redis", "name" : "container-0", "resources" : { "limits" : { "cpu" : "500m", "memory" : "1024Mi" }, "requests" : { "cpu" : "500m", "memory" : "1024Mi" } } } ], "imagePullSecrets" : [ { "name" : "imagepull-secret" } ], "priority" : 0 } } } } 创建使用GPU的Deployment,NVIDIA GPU的驱动版本为418.126。 { "apiVersion" : "apps/v1", "kind" : "Deployment", "metadata" : { "name" : "test-app", "namespace" : "test-namespace" }, "spec" : { "replicas" : 2, "selector" : { "matchLabels" : { "app" : "test-app" } }, "template" : { "metadata" : { "annotations" : { "cri.cci.io/gpu-driver" : "gpu-418.126" }, "labels" : { "app" : "test-app" } }, "spec" : { "containers" : [ { "image" : "library/nginx:stable-alpine-perl", "lifecycle" : { }, "name" : "container-0", "resources" : { "limits" : { "cpu" : "4", "memory" : "32Gi", "nvidia.com/gpu-tesla-v100-16GB" : "1" }, "requests" : { "cpu" : "4", "memory" : "32Gi", "nvidia.com/gpu-tesla-v100-16GB" : "1" } } } ], "imagePullSecrets" : [ { "name" : "imagepull-secret" } ], "restartPolicy" : "Always" } } } }
  • 响应示例 状态码: 200 OK { "apiVersion" : "apps/v1", "kind" : "Deployment", "metadata" : { "creationTimestamp" : "2018-09-06T03:39:32Z", "generation" : 1, "labels" : { "app" : "redis" }, "name" : "deployment-test", "namespace" : "namespace-test", "resourceVersion" : "5630832", "selfLink" : "/apis/apps/v1/namespaces/namespace-test/deployments/deployment-test", "uid" : "777dce52-b186-11e8-8cb0-c81fbe371a17" }, "spec" : { "progressDeadlineSeconds" : 600, "replicas" : 1, "revisionHistoryLimit" : 10, "selector" : { "matchLabels" : { "app" : "redis" } }, "strategy" : { "rollingUpdate" : { "maxSurge" : "25%", "maxUnavailable" : "25%" }, "type" : "RollingUpdate" }, "template" : { "metadata" : { "annotations" : { "cri.cci.io/container-type" : "secure-container" }, "creationTimestamp" : null, "labels" : { "app" : "redis" } }, "spec" : { "containers" : [ { "image" : "redis", "imagePullPolicy" : "IfNotPresent", "name" : "container-0", "resources" : { "limits" : { "cpu" : "500m", "memory" : "1Gi" }, "requests" : { "cpu" : "500m", "memory" : "1Gi" } }, "terminationMessagePath" : "/dev/termination-log", "terminationMessagePolicy" : "File" } ], "dnsPolicy" : "ClusterFirst", "imagePullSecrets" : [ { "name" : "imagepull-secret" } ], "restartPolicy" : "Always", "schedulerName" : "default-scheduler", "securityContext" : { } } } }, "status" : { } }
  • 状态码 状态码 描述 200 OK 202 Accepted 400 BadRequest 401 Unauthorized 403 Forbidden 404 NotFound 405 MethodNotAllowed 406 NotAcceptable 409 Conflict 415 UnsupportedMediaType 422 Invalid 429 TooManyRequests 500 InternalError 503 ServiceUnavailable 504 ServerTimeout
  • 响应示例 状态码: 200 OK { "apiVersion" : "v1", "code" : 200, "details" : { "group" : "extensions", "kind" : "deployments", "name" : "deploy-12130306", "uid" : "27072a31-dfb3-11e7-9c19-fa163e2d897b" }, "kind" : "Status", "metadata" : { }, "status" : "Success" }
  • 响应参数 状态码: 200 表6 响应Body参数 参数 参数类型 描述 apiVersion String APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources code Integer Suggested HTTP return code for this status, 0 if not set. details io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails object Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type. kind String Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds message String A human-readable description of the status of this operation. metadata io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta object Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds reason String A machine-readable description of why this operation is in the "Failure" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it. status String Status of the operation. One of: "Success" or "Failure". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 表7 io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails 参数 参数类型 描述 causes Array of io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause objects The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes. group String The group attribute of the resource associated with the status StatusReason. kind String The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds name String The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described). retryAfterSeconds Integer If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action for those errors this field may indicate how long to wait before taking the alternate action. uid String UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids 表8 io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause 参数 参数类型 描述 field String The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional. Examples: "name" - the field "name" on the current resource "items[0].name" - the field "name" on the first array entry in "items" message String A human-readable description of the cause of the error. This field may be presented as-is to a reader. reason String A machine-readable description of the cause of the error. If this value is empty there is no information available. 表9 io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta 参数 参数类型 描述 continue String continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message. remainingItemCount Long remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is estimating the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact. resourceVersion String String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency selfLink String selfLink is a URL representing this object. Populated by the system. Read-only. DEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release. 状态码: 202 表10 响应Body参数 参数 参数类型 描述 apiVersion String APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources code Integer Suggested HTTP return code for this status, 0 if not set. details io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails object Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type. kind String Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds message String A human-readable description of the status of this operation. metadata io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta object Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds reason String A machine-readable description of why this operation is in the "Failure" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it. status String Status of the operation. One of: "Success" or "Failure". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 表11 io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails 参数 参数类型 描述 causes Array of io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause objects The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes. group String The group attribute of the resource associated with the status StatusReason. kind String The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds name String The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described). retryAfterSeconds Integer If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action for those errors this field may indicate how long to wait before taking the alternate action. uid String UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids 表12 io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause 参数 参数类型 描述 field String The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional. Examples: "name" - the field "name" on the current resource "items[0].name" - the field "name" on the first array entry in "items" message String A human-readable description of the cause of the error. This field may be presented as-is to a reader. reason String A machine-readable description of the cause of the error. If this value is empty there is no information available. 表13 io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta 参数 参数类型 描述 continue String continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message. remainingItemCount Long remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is estimating the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact. resourceVersion String String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency selfLink String selfLink is a URL representing this object. Populated by the system. Read-only. DEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 Content-Type 是 String 消息体的类型(格式),默认取值为“application/json” 缺省值:application/json 表4 请求Body参数 参数 是否必选 参数类型 描述 apiVersion 否 String APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources dryRun 否 Array of strings When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed gracePeriodSeconds 否 Long The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. kind 否 String Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds orphanDependents 否 Boolean Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. preconditions 否 io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions object Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. propagationPolicy 否 String Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. 表5 io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions 参数 是否必选 参数类型 描述 resourceVersion 否 String Specifies the target ResourceVersion uid 否 String Specifies the target UID.
  • URI DELETE /apis/apps/v1/namespaces/{namespace}/deployments/{name} 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the Deployment namespace 是 String object name and auth scope, such as for teams and projects 表2 Query参数 参数 是否必选 参数类型 描述 dryRun 否 String When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed gracePeriodSeconds 否 Integer The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. orphanDependents 否 Boolean Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. propagationPolicy 否 String Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. pretty 否 String If 'true', then the output is pretty printed.
  • 已开通旧版本服务,能否转换为新版本计费? 本章节仅供老用户参考,新用户请参考计费说明选择计费模式。 当前暂不支持已开通历史计费模式的用户一键切换成新计费模式,需要将历史计费模式退订,再购买新套餐。 已开通历史包年/包月计费模式的用户,请登录软件开发生产线控制台,单击退订,即可进入退订页面完成操作。 已开通历史按需计费模式的用户,请参考退订,关闭按需计费。 购买新套餐的操作方法请参考购买CodeArts。 未开通/购买套餐,但单独开通过需求管理服务的用户,仍延续旧版需求管理按需计费规则。 旧版套餐计费方式详情请参考旧版计费方式说明,旧版需求管理服务开通方式请参考开通按需。 开通/购买套餐需要您拥有租户账号,或拥有“Tenant Administrator”权限的IAM用户账号,配置权限策略方法请参考创建用户组并授权。 父主题: 计费
  • URI GET /v4/projects/domain/not-added 表1 Query参数 参数 是否必选 参数类型 描述 offset 否 Integer 分页索引,偏移量,offset是limit的整数倍,limit=10,offset=0,10,20... 最小值:0 缺省值:0 limit 否 Integer 每页显示的数量,每页最多显示100条 最小值:1 最大值:100 缺省值:10
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 projects Array of projects objects 项目信息列表 total Integer 总数 最小值:0 最大值:10000 表4 projects 参数 参数类型 描述 project_num_id Integer 项目数字id project_id String 项目id 最小长度:32 最大长度:32 project_name String 项目名 最小长度:1 最大长度:128 description String 项目描述 created_time Long 项目创建时间 最小长度:0 最大长度:13 updated_time Long 项目更新时间 最小长度:0 最大长度:13 project_type String 项目类型 creator creator object 创建者信息 表5 creator 参数 参数类型 描述 user_num_id Integer 创建人numId user_id String 创建人id 最小长度:1 最大长度:32 user_name String 创建人姓名 domain_id String 创建人租户id 最小长度:1 最大长度:32 domain_name String 创建人租户名称 nick_name String 创建人租户昵称 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 401 表7 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • 响应示例 状态码: 200 OK { "projects" : [ { "project_num_id" : 3056544, "project_id" : "e2da96a5d2c845e284f0ad47f8ca8cb1", "project_name" : "dsadasdsasss", "description" : "这是一个demo", "created_time" : "1571296951000", "updated_time" : "1571296951000", "project_type" : "scrum", "creator" : { "user_num_id" : 4097, "user_id" : "c4bd39f0573a436589714bedbcca8536", "user_name" : "modile_user", "domain_id" : "2489d8cbba804db8bcd35384685ff3ac", "domain_name" : "modile_user", "nick_name" : "Tom.M.Riddle" } } ], "total" : 1 }
  • 响应示例 状态码: 200 OK { "projects" : [ { "project_num_id" : 3183801, "project_id" : "41bd3eab86544863b8fc92ffcd35e3c8", "project_name" : "aaa", "description" : "demo", "created_time" : 1576114296000, "updated_time" : 1576114296000, "project_type" : "xboard", "creator" : { "user_num_id" : 4097, "user_id" : "c4bd39f0573a436589714bedbcca8536", "user_name" : "modile_user", "domain_id" : "2489d8cbba804db8bcd35384685ff3ac", "domain_name" : "modile_user", "nick_name" : "Tom.M.Riddle" } } ], "total" : 10 }
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 projects Array of projects objects 项目信息列表 total Integer 项目总数 最小值:0 最大值:10000 表4 projects 参数 参数类型 描述 project_num_id Integer 项目numId project_id String 项目uuid project_name String 项目名称 description String 项目描述 created_time Long 项目创建时间 updated_time Long 项目更新时间 project_type String 项目类型 creator creator object 创建者信息 表5 creator 参数 参数类型 描述 user_num_id Integer 创建人numId user_id String 创建人id user_name String 创建人姓名 domain_id String 创建人租户id domain_name String 创建人租户名称 nick_name String 创建人租户昵称 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 401 表7 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码 状态码: 403 表8 响应Body参数 参数 参数类型 描述 error_msg String 错误描述 error_code String 错误码
  • URI GET /v4/projects 表1 Query参数 参数 是否必选 参数类型 描述 offset 是 Integer 偏移量 从0开始 最小值:0 最大值:10000 缺省值:0 limit 是 Integer 条数 最小1条,最大1000 最小值:1 最大值:1000 缺省值:10 search 否 String 模糊查询项目名称或描述,不支持通配符等高级查询 project_type 否 String 项目类型 scrum|xboard sort 否 String 排序条件 默认创建时间降序(name|created_on)(asc|desc) archive 否 String 是否归档 true已归档|false未归档 query_type 否 String 默认返回当前用户参与的项目列表,domain_projects租户下的所有项目列表,absent返回当前用户未参与的租户项目列表
  • 请求示例 GET https://{endpoint}/v4/projects?limit=10&offset=0&project_type=scrum&sort=&search=aa&archive=true&query_type=domain_projects Get https://{endpoint}/v4/projects?limit=10&offset=0&project_type=scrum&sort=&search=aa&archive=true&query_type=domain_projects
  • 文档修订记录 文档修订记录累积了每次文档更新的说明。最新版本的文档包含以前所有文档版本的更新内容。 修订记录 发布日期 第二十四次正式发布。本次变更说明如下: 增加了添加指定工作项工时。 增加了查询项目下的工时类型。 增加了获取指定工作项停留时间。 增加了高级查询我的待办工作项。 增加了查询项目模板。 2023-06-08 第二十三次正式发布。本次变更说明如下: issueUser对象中增了两个字段:user_id和user_num_id。 2022-12-06 第二十二次正式发布。本次变更说明如下: 增加了下载工作项附件。 增加了删除附件。 增加了查询当前工作项已经关联的代码提交记录 / 分支创建记录。 2022-11-04 第二十一次正式发布。本次变更说明如下: 增加响应示例和请求示例。 2022-10-28 第二十次正式发布。本次变更说明如下: 增加了下载图片。 增加了上传工作项附件。 增加了Scrum项目的领域。 2022-09-16 第十九次正式发布。本次变更说明如下: 修改了API概览。 修改了终端节点。 NewCustomField中增加了字段“field_name”。 2022-08-23 第十八次正式发布。本次变更说明如下: 修改了API概览。 增加了Scrum项目的模块。 2022-06-30 第十七次正式发布。本次变更说明如下: 增加了查询项目的工作项。 增加了查询项目下所有工作项的历史记录。 增加了查询Scrum项目的工作项流转配置。 增加了查询当前工作项已经关联的工作项。 增加了查询当前工作项已经关联的关联Wiki。 增加了查询当前工作项已经关联的代码提交记录 / 分支创建记录。 增加了查询关联用例。 增加了查询Scrum工作项自定义字段。 增加了查询看板项目下工作项的状态历史记录。 增加了查询看板项目下的工作项。 增加了查询看板项目的工作项流转配置。 修改了创建工作项。 2022-06-06 第十六次正式发布。本次变更说明如下: 增加了查看迭代历史记录。 增加了更新子用户昵称。 修改了高级查询工作项。 修改了获取指定项目的迭代列表。 2022-02-28 第十五次正式发布。本次变更说明如下: 修改了高级查询工作项。 修改查询缺陷密度。 2021-11-26 第十四次正式发布。本次变更说明如下: 增加了细粒度权限用户创建工作项。 修改了错误码。 2021-11-10 第十三次正式发布。本次变更说明如下: 修改了API字段信息。 迭代详情和迭代列表添加了返回字段status。 获取工作项的历史记录添加了id和name。 2021-09-28 第十二次正式发布。本次变更说明如下: 修改了错误码。 2021-06-11 第十一次正式发布。本次变更说明如下: 修改了错误码。 2021-05-12 第十次正式发布。本次变更说明如下: 修改了错误码。 2021-05-08 第九次正式发布。本次变更说明如下: 修改了接口字段信息。 2021-04-22 第八次正式发布。本次变更说明如下: 删除约束与限制。 2021-03-26 第七次正式发布。本次变更说明如下: 修改API概览。 2021-03-10 第六次正式发布。本次变更说明如下: 修改应用示例。 2021-02-05 第五次正式发布。本次变更说明如下: 增加应用示例。 2020-08-31 第四次正式发布。本次变更说明如下: 修改“4.1 API”。 2020-08-18 第三次正式发布。本次变更说明如下: 修改基本概念。 修改构造请求。 修改认证鉴权。 2020-08-06 第二次正式发布。本次变更说明如下: 修改终端节点。 2020-07-01 第一次正式发布。 2020-03-30
  • 响应示例 状态码: 200 OK { "issue_list" : [ { "id" : 7220820, "subject" : "aaa", "project" : { "name" : "Scrum-ljx-0320", "id" : 30387805, "identifier" : "", "type" : "scrum" }, "done_ratio" : 0, "expected_work_hours" : 0.0, "actual_work_hours" : 0.0, "tracker" : { "id" : 7, "name" : "Story" }, "order" : { "id" : 1, "name" : "1.0" }, "severity" : { "id" : 12, "name" : "一般" }, "priority" : { "id" : 2, "name" : "中" }, "domain" : { }, "position" : 7220820.0, "module" : { }, "assigned_to" : { "id" : 4091, "name" : "" }, "author" : { "id" : 4091, "name" : "" }, "developer" : { }, "closeder" : { }, "status" : { "id" : 1, "name" : "新建" }, "is_watcher" : false, "closed_flag" : 0, "deleted" : false, "created_on" : "1681783846000", "updated_on" : "1681783846000", "due_date" : "1684252800000" } ], "total" : 1 }
共100000条