Update a connector¶
Update a saved connector’s name, purpose, data source type, or configuration. Only pass in the fields that need to be modified, and keep other fields with their original values.
PUT $CLOUDSIGMA_API_BASE/connectors/{connector_id}
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First Query connector details to confirm the connector to be modified. Prepare personal access token, target workspace ID and connector ID that can access the target workspace.
Request body¶
Replace $CLOUDSIGMA_API_KEY, $WORKSPACE_ID, $CONNECTOR_ID and the fields to be updated with actual values.
Modify name
curl -X PUT "$CLOUDSIGMA_API_BASE/connectors/$CONNECTOR_ID" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d "{
\"name\": \"$NEW_CONNECTOR_NAME\"
}"
Modify data source type or connection information
Replace $CONNECTOR_ID and the connection information for the new data source with actual values.
curl -X PUT "$CLOUDSIGMA_API_BASE/connectors/$CONNECTOR_ID" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg S3_ACCESS_KEY_ID "$S3_ACCESS_KEY_ID" --arg S3_ACCESS_KEY_SECRET "$S3_ACCESS_KEY_SECRET" '
{
"source_type": 5,
"config": {
"s3": {
"endpoint": "https://s3.example.com",
"access_key_id": $S3_ACCESS_KEY_ID,
"access_key_secret": $S3_ACCESS_KEY_SECRET,
"bucket_name": "orders/import",
"region": "us-east-1"
}
}
}
')"
Modify use
For the complete correspondence between types and fields and authentication branches, see Fill in the connection information according to the data source. Please note when modifying:
When modifying the type, verify it based on the final type, usage, and configuration combination.
As long as config is passed in, the saved connection configuration will be replaced in its entirety. Even if you only change one or two fields, you must also submit the fields that need to be retained (you can first query connector details to get the current value]).
Replace $CONNECTOR_ID and Purpose with actual values.
curl -X PUT "$CLOUDSIGMA_API_BASE/connectors/$CONNECTOR_ID" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"usage_type": [1, 2]
}'
Modify name
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The connector ID to update. |
|
string |
No |
New connector name. |
|
integer |
No |
Source type can be modified. Verification is based on the final type, usage and configuration combination. It is not required to pass config at the same time. |
|
object |
Yes |
Connection information for standard S3. |
|
string |
Yes |
S3 service endpoint. |
|
string |
Yes |
Access key ID. |
|
string |
Yes |
Access key. |
|
string |
Yes |
Bucket name or path prefix. |
|
string |
Yes |
area. |
|
integer (integer array) |
Yes |
New connector uses. |
The example uses jq to construct the JSON request body. Install jq first and set the required environment variables. Do not JSON encode the variable values again.
Keep the original value when omitting a field or filling in null. Provide at least one non-empty update at a time. config will replace the original configuration as a whole, and nested fields will not be merged.
When only modifying the data source type, config can be omitted. The service is revalidated with the updated type, purpose, and configuration. This interface does not check whether the version has changed.
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": null
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
null |
This interface does not return an updated connector object. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "invalid connector parameters"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. Always check this field. Only |
|
string |
Readable error message. |
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
400 |
|
Invalid request field, workspace, or operation precondition. |
Fix the request parameters and submit again. |
401 |
|
Missing or invalid authentication credentials. |
Check the credential type, expiration, and authentication header. |
403 |
|
The current identity or active role does not have permission for this operation. |
Use an authorized identity or contact an administrator to grant access. |
404 |
|
The target object or required reference was not found. |
Verify the object identifier, workspace, and current status. |
409 |
|
Conflict in resource state, request payload, or concurrent modification. |
Re-read the current state and version, then handle according to the latest result. |
500 |
|
Internal processing failed; write operations may have been partially applied. |
Retain request and trace details, and verify the current state before retrying. |
503 |
|
A business, runtime, or authorization dependency is temporarily unavailable. |
After the dependency recovers, check existing results first instead of blindly repeating writes. |