Updating a Federated Workload
Function
This API is used to update a federated workload.
URI
PUT /v1/clustergroups/{clustergroupid}/unitedworkload
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
clustergroupid |
Yes |
String |
Fleet ID |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
No |
String |
Identity authentication information. Requests for calling an API can be authenticated using either a token or AK/SK. If token-based authentication is used, this parameter is mandatory and must be set to a user token. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
kind |
No |
String |
Resource type. Options: |
|
apiVersion |
No |
String |
API version |
|
metadata |
No |
ObjectMeta object |
Workload metadata |
|
template |
No |
Object |
Application template to be deployed |
|
propagationPolicy |
No |
PropagationPolicy object |
Policy for propagating resources across clusters |
|
overridePolicy |
No |
OverridePolicy object |
Resource override policy |
|
resourceBinding |
No |
ResourceBinding object |
Binding between resources and propagation policies |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
kind |
No |
String |
API type. The value is fixed at PropagationPolicy. |
|
apiVersion |
No |
String |
API version |
|
metadata |
No |
ObjectMeta object |
Basic information |
|
spec |
No |
PropagationSpec object |
Propagation policy description |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
resourceSelectors |
No |
Array of ResourceSelector objects |
Resource selector, which is used to select resources to be propagated. |
|
propagateDeps |
No |
Boolean |
Whether to automatically propagate the referent. |
|
placement |
No |
Placement object |
Rule for defining the clusters that resources are propagated to |
|
priority |
No |
Integer |
Policy priority. The default value is 0. |
|
schedulerName |
No |
String |
Scheduler name. The default value is default-scheduler. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
kind |
No |
String |
API type. The value is fixed at OverridePolicy. |
|
apiVersion |
No |
String |
API version |
|
spec |
No |
OverrideSpec object |
Override policy description |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
resourceSelectors |
No |
Array of ResourceSelector objects |
Resource selector, which restricts the resource types that the override policy is applied to |
|
overriders |
No |
Object |
Override rule that will be applied to resources |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
apiVersion |
No |
String |
API version of the target resource |
|
kind |
No |
String |
Type of the target resource |
|
namespace |
No |
String |
Name of the target resource |
|
name |
No |
String |
Namespace of the target resource |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
kind |
No |
String |
API type. The value is fixed at ResourceBinding. |
|
apiVersion |
No |
String |
API version |
|
metadata |
No |
ObjectMeta object |
Resource metadata |
|
spec |
No |
ResourceBindingSpec object |
Desired resource binding behavior |
|
status |
No |
ResourceBindingStatus object |
Current status of the resource binding |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
uid |
No |
String |
Resource ID |
|
name |
No |
String |
Resource name |
|
generateName |
No |
String |
If no name is provided, the server uses the prefix to generate a unique name. |
|
namespace |
No |
String |
Namespace |
|
labels |
No |
Map<String,String> |
Label |
|
annotations |
No |
Map<String,String> |
Annotation |
|
creationTimestamp |
No |
String |
Creation time |
|
updateTimestamp |
No |
String |
Update time |
|
resourceVersion |
No |
String |
Internal version of a resource |
|
generation |
No |
String |
Generation of the desired resource state |
|
managedFields |
No |
Array of ManagedFieldsEntry objects |
Fields managed by workflows |
|
ownerReferences |
No |
Array of OwnerReference objects |
Ownership, dependencies, and garbage collection mechanism of objects. It supports resource management by the controller. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
manager |
No |
String |
Manager name |
|
operation |
No |
String |
Operation type that causes this entry being created. The value can only be Apply or Update. |
|
apiVersion |
No |
String |
Resource API version used by a manager for defining fields |
|
time |
No |
String |
Timestamp when this entry was created or last updated |
|
fieldsType |
No |
String |
Field structure format. The value is fixed at "FieldsV1". |
|
fieldsV1 |
No |
Object |
Information about the managed fields |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
apiVersion |
No |
String |
API version of the referent |
|
kind |
No |
String |
Type of the referent |
|
name |
No |
String |
Name of the referent |
|
uid |
No |
String |
UID of the referent |
|
controller |
No |
Boolean |
If the value is true, this reference points to the controller that manages the resource. |
|
blockOwnerDeletion |
No |
Boolean |
If the value is true and the owner has a finalizer named foregroundDeletion, the owner cannot be deleted until this reference is removed. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
resource |
No |
Object |
Kubernetes resource reference to be propagated |
|
propagateDeps |
No |
Boolean |
Whether to automatically propagate related resources |
|
replicaRequirements |
No |
Object |
Requirements for each replica |
|
replicas |
No |
Integer |
The number of replicas to be created |
|
placement |
No |
Placement object |
Cluster selection rule |
|
clusters |
No |
Array of TargetCluster objects |
Target member cluster list |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
clusterAffinity |
No |
ClusterAffinity object |
Cluster affinity rule |
|
clusterTolerations |
No |
Array of Toleration objects |
Cluster tolerance rule |
|
replicaScheduling |
No |
Object |
The way how to allocate replicas across member clusters |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
clusterNames |
No |
Array of strings |
List of cluster names to be selected |
|
exclude |
No |
Array of strings |
List of cluster names to be excluded |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
No |
String |
Key name of the taint to be tolerated |
|
operator |
No |
String |
Relationship between the key and value. The value can be Exists or Equal. The default value is Equal. |
|
value |
No |
String |
Taint value to be matched. When Operator is set to Exists, Value must be empty. |
|
effect |
No |
String |
Taint effect to be matched. The value can be NoSchedule, PreferNoSchedule, or NoExecute. If the value is empty, all effects are matched. |
|
tolerationSeconds |
No |
Integer |
Duration during which a pod can tolerate a taint. This parameter is valid only for NoExecute. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
No |
String |
Name of the target cluster |
|
replicas |
No |
String |
The number of replicas created in a cluster |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
schedulerObservedGeneration |
No |
Integer |
Generation of the resource observed by the scheduler |
|
conditions |
No |
Array of ConditionStatus objects |
Resource status conditions |
Response Parameters
Status code: 200
Federated workload updated
None
Example Requests
Updating a federated workload
PUT https://ucs.myhuaweicloud.com/v1/clustergroups/{clustergroupid}/unitedworkload
{
"kind" : "Deployment",
"metadata" : {
"name" : "test",
"namespace" : "default"
},
"template" : {
"apiVersion" : "apps/v1",
"kind" : "Deployment",
"metadata" : {
"labels" : {
"version" : "v1"
},
"name" : "test",
"namespace" : "default"
},
"spec" : {
"selector" : {
"matchLabels" : {
"app" : "test",
"version" : "v1"
}
},
"template" : {
"metadata" : {
"labels" : {
"app" : "test",
"version" : "v1"
}
},
"spec" : {
"containers" : [ {
"name" : "nginx",
"image" : "xxxxxx",
"imagePullPolicy" : "IfNotPresent"
} ],
"terminationGracePeriodSeconds" : 30,
"tolerations" : [ {
"key" : "node.kubernetes.io/not-ready",
"operator" : "Exists",
"effect" : "NoExecute",
"tolerationSeconds" : 300
}, {
"key" : "node.kubernetes.io/unreachable",
"operator" : "Exists",
"effect" : "NoExecute",
"tolerationSeconds" : 300
} ],
"volumes" : [ ],
"initContainers" : [ ]
}
},
"serviceName" : "headless-kd3s6e",
"replicas" : 2,
"revisionHistoryLimit" : 10,
"progressDeadlineSeconds" : 600
}
},
"propagationPolicy" : {
"spec" : {
"placement" : {
"clusterAffinity" : {
"clusterNames" : [ ]
},
"replicaScheduling" : {
"replicaSchedulingType" : "Divided",
"replicaDivisionPreference" : "Weighted",
"weightPreference" : {
"dynamicWeight" : "AvailableReplicas"
}
}
},
"propagateDeps" : true
}
},
"overridePolicy" : { }
}
Example Responses
None
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Federated workload updated |
|
400 |
Client request error. The server could not execute the request. |
|
403 |
The server refused the request. |
|
404 |
Resources not found |
|
500 |
Internal server error |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot