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.

HTTP
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

Shell
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.

Shell
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.

Shell
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

connector_id

string

Yes

The connector ID to update.

name

string

No

New connector name.

source_type

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.

config.s3

object

Yes

Connection information for standard S3.

config.s3.endpoint

string

Yes

S3 service endpoint.

config.s3.access_key_id

string

Yes

Access key ID.

config.s3.access_key_secret

string

Yes

Access key.

config.s3.bucket_name

string

Yes

Bucket name or path prefix.

config.s3.region

string

Yes

area.

usage_type

integer (integer array)

Yes

New connector uses. [1] only imports, [2] only exports, and [1, 2] supports both. Integers 1, 2, 3 are also accepted. Do not pass this field when the purpose is not modified, nor do you pass 0 or []. Optional uses depend on the data source, see Data source type description.

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

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": null
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data

null

This interface does not return an updated connector object.

Error response

JSON
{
  "code": "ErrParamInvalid",
  "msg": "invalid connector parameters"
}

Field

Type

Description

code

string

error code. Always check this field. Only OK indicates that the update is complete.

msg

string

Readable error message.

Common HTTP errors

HTTP status

Error code

Common cause

Recommended action

400

ErrParamInvalid, ErrWorkspaceRequired

Invalid request field, workspace, or operation precondition.

Fix the request parameters and submit again.

401

Unauthorized, ErrServiceUnavailable, ErrIAMExplicitRoleInvalid

Missing or invalid authentication credentials.

Check the credential type, expiration, and authentication header.

403

ErrForbidden

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

ErrNotFound

The target object or required reference was not found.

Verify the object identifier, workspace, and current status.

409

ErrAlreadyExists, ErrConnectorInUse

Conflict in resource state, request payload, or concurrent modification.

Re-read the current state and version, then handle according to the latest result.

500

ErrServer

Internal processing failed; write operations may have been partially applied.

Retain request and trace details, and verify the current state before retrying.

503

ErrServiceUnavailable

A business, runtime, or authorization dependency is temporarily unavailable.

After the dependency recovers, check existing results first instead of blindly repeating writes.

Last updated on