# Update an external location

Launch stage: GA

`PATCH /api/2.1/unity-catalog/external-locations/{name_arg}`

Updates an external location in the metastore. The caller must be the owner of the external location, or be a metastore admin.
 In the second case, the admin can only update the name of the external location.

API scopes: unity-catalog

## Path parameters

- `name_arg` (string, required)
  Name of the external location.

## Request body

- `new_name` (string, optional)
  New name for the external location.
- `force` (boolean, optional)
  Force update even if changing url invalidates dependent external tables or mounts.
- `skip_validation` (boolean, optional)
  Skips validation of the storage credential associated with the external location.
- `name` (string, required)
  Name of the external location.
- `url` (string, required)
  URL of the cloud storage path that the external location points to, including the scheme
   (for example `s3://`, `abfss://`, or `gs://`).
- `credential_name` (string, required)
  Name of the storage credential used with this location.
- `read_only` (boolean, optional)
  Indicates whether the external location is read-only.
- `comment` (string, optional)
  User-provided free-form text description.
- `enable_file_events` (boolean, optional)
  Whether to enable file events on this external location. Defaults to `true`. Set to `false` to disable file events.
   The actual applied value may differ due to server-side defaults; check `effective_enable_file_events` for the effective state.
- `file_event_queue` (object, optional)
  File event queue settings. When `enable_file_events` is `true`, exactly one of the queue options
   must be set. Must be omitted when `enable_file_events` is `false`.
  Example: `{"provided_sqs":{"queue_url":"https://sqs.us-west-1.amazonaws.com/123456789012/test-queue"}}` : Using a provided queue
  Example: `{"managed_sqs":{}}` : Using automatic queue creation
  - `provided_aqs` (object, optional)
    - `queue_url` (string, optional)
      The AQS queue URL in the format `https://{storage account}.queue.core.windows.net/{queue name}`.
       Only required for provided_aqs.
    - `subscription_id` (string, optional)
      Optional subscription id for the queue, event grid subscription, and external location storage
       account.
       Required for locations with a service principal storage credential
    - `resource_group` (string, optional)
      Optional resource group for the queue, event grid subscription, and external location storage
       account.
       Only required for locations with a service principal storage credential
  - `provided_sqs` (object, optional)
    - `queue_url` (string, optional)
      The SQS queue URL in the format `https://sqs.{region}.amazonaws.com/{account id}/{queue name}`.
       Only required for provided_sqs.
  - `provided_pubsub` (object, optional)
    - `subscription_name` (string, optional)
      The Pub/Sub subscription name in the format `projects/{project}/subscriptions/{subscription name}`.
       Only required for provided_pubsub.
  - `managed_aqs` (object, optional)
    - `queue_url` (string, optional)
      The AQS queue URL in the format `https://{storage account}.queue.core.windows.net/{queue name}`.
       Only required for provided_aqs.
    - `subscription_id` (string, optional)
      Optional subscription id for the queue, event grid subscription, and external location storage
       account.
       Required for locations with a service principal storage credential
    - `resource_group` (string, optional)
      Optional resource group for the queue, event grid subscription, and external location storage
       account.
       Only required for locations with a service principal storage credential
  - `managed_sqs` (object, optional)
    - `queue_url` (string, optional)
      The SQS queue URL in the format `https://sqs.{region}.amazonaws.com/{account id}/{queue name}`.
       Only required for provided_sqs.
  - `managed_pubsub` (object, optional)
    - `subscription_name` (string, optional)
      The Pub/Sub subscription name in the format `projects/{project}/subscriptions/{subscription name}`.
       Only required for provided_pubsub.
- `owner` (string, optional)
  The owner of the external location.
- `encryption_details` (object, optional)
  Encryption options that apply to clients connecting to cloud storage.
  - `sse_encryption_details` (object, optional)
    Server-Side Encryption properties for clients communicating with AWS s3.
    - `algorithm` (string, optional)
      Sets the value of the 'x-amz-server-side-encryption' header in S3 request.
      Possible values:
      - `AWS_SSE_S3`
      - `AWS_SSE_KMS`
    - `aws_kms_key_arn` (string, optional)
      Optional. The ARN of the SSE-KMS key used with the S3 location, when algorithm = "SSE-KMS".
       Sets the value of the 'x-amz-server-side-encryption-aws-kms-key-id' header.
- `metastore_id` (string, optional)
  Unique identifier of metastore hosting the external location.
- `credential_id` (string, optional)
  Unique ID of the location's storage credential.
- `created_at` (int64, optional)
  Time at which this external location was created, in epoch milliseconds.
- `created_by` (string, optional)
  Username of external location creator.
- `updated_at` (int64, optional)
  Time at which this external location was last modified, in epoch milliseconds.
- `updated_by` (string, optional)
  Username of user who last modified the external location.
- `browse_only` (boolean, optional)
  Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request.
- `isolation_mode` (string, optional)
  Whether the current securable is accessible from all workspaces or a specific set of
   workspaces. Cannot be set when creating an external location.
  Possible values:
  - `ISOLATION_MODE_OPEN`
  - `ISOLATION_MODE_ISOLATED`
- `fallback` (boolean, optional)
  Indicates whether fallback mode is enabled for this external location. When fallback mode is enabled, the access to the location falls back to cluster credentials if UC credentials are not sufficient.

## Returns

Returns the ExternalLocationInfo object.

## Request

### Mark as read-only

```json
{
  "read_only": true,
  "comment": "Read-only raw sales data in S3"
}
```

## Response

### AWS

```json
{
  "name": "sales_s3_location",
  "url": "s3://sales-data-bucket/raw",
  "credential_name": "sales_s3_credential",
  "read_only": true,
  "comment": "Read-only raw sales data in S3",
  "owner": "jane.doe@example.com",
  "metastore_id": "b7c1d2e3-f4a5-4b6c-8d7e-9f0a1b2c3d4e",
  "credential_id": "7e9a1f3c-2b4d-4e8f-9a0b-1c2d3e4f5a6b",
  "created_at": 1718035200000,
  "created_by": "jane.doe@example.com",
  "updated_at": 1718121600000,
  "updated_by": "jane.doe@example.com",
  "isolation_mode": "ISOLATION_MODE_OPEN",
  "fallback": false,
  "effective_enable_file_events": true,
  "effective_file_event_queue": {
    "managed_sqs": {
      "managed_resource_id": "4d2f8a1b-6c3e-4f7a-9b8d-0e1f2a3b4c5d"
    }
  }
}
```

