Update a connector

Introduced 2.12

Use this API to update a standalone connector based on the model_ID. To update a connector created within a specific model, use the Update Model API.

Before updating a standalone connector, you must undeploy all models that use the connector. For information about undeploying a model, see Undeploy Model API.

Using this API, you can update the connector fields listed in the Request fields section and add optional fields to your connector. You cannot delete fields from a connector using this API.

For information about user access for this API, see Model access control considerations.

Path and HTTP methods

  1. PUT /_plugins/_ml/connectors/<connector_id>

Request fields

The following table lists the updatable fields. For more information about all connector fields, see Blueprint configuration parameters.

FieldData typeDescription
nameStringThe name of the connector.
descriptionStringA description of the connector.
versionIntegerThe version of the connector.
protocolStringThe protocol for the connection. For AWS services, such as Amazon SageMaker and Amazon Bedrock, use aws_sigv4. For all other services, use http.
parametersJSON objectThe default connector parameters, including endpoint and model. Any parameters included in this field can be overridden by parameters specified in a predict request.
credentialJSON objectDefines any credential variables required in order to connect to your chosen endpoint. ML Commons uses AES/GCM/NoPadding symmetric encryption to encrypt your credentials. When the connection to the cluster first starts, OpenSearch creates a random 32-byte encryption key that persists in OpenSearch’s system index. Therefore, you do not need to manually set the encryption key.
actionsJSON arrayDefines which actions can run within the connector. If you’re an administrator creating a connection, add the blueprint for your desired connection.
backend_rolesJSON arrayA list of OpenSearch backend roles. For more information about setting up backend roles, see Assigning backend roles to users.
access_modeStringSets the access mode for the model, either public, restricted, or private. Default is private. For more information about access_mode, see Model groups.

Example request

  1. PUT /_plugins/_ml/connectors/u3DEbI0BfUsSoeNTti-1
  2. {
  3. "description": "The connector to public OpenAI model service for GPT 3.5"
  4. }

copy

Example response

  1. {
  2. "_index": ".plugins-ml-connector",
  3. "_id": "u3DEbI0BfUsSoeNTti-1",
  4. "_version": 2,
  5. "result": "updated",
  6. "_shards": {
  7. "total": 1,
  8. "successful": 1,
  9. "failed": 0
  10. },
  11. "_seq_no": 2,
  12. "_primary_term": 1
  13. }