Updating to the 2023-05-30
version (file shares, mount targets)
As described in the Beta VPC API reference versioning policy, to more quickly respond to feedback as a feature progresses through its beta phase, support for older
versions of the beta API is limited to 45 days. Therefore, beta API requests must specify a version
query parameter date value within the last 45 days.
Before you adopt the beta release version 2023-05-30
or later, be aware of the following changes, which might require you to update your client:
- In the Shares methods, the
targets
property was changed tomount_targets
. - In the share mount targets methods, the
resource_type
property value was changed toshare_mount_target
. - When creating a file share, you must specify the
mount_targets
property instead of thetargets
property - When making share mount targets method requests, you must use the method URL
/shares/{id}/mount_targets
instead of/shares/{id}/targets
.
All requests that use the following methods enforce the existing requirement that you provide the maturity=beta
query parameter:
- Create a file share
- Create a mount target for a file share
- List all file shares
- Retrieve a file share
- List all mount targets for a file share
- Retrieve a share mount target
- Retrieve the source file share for a replica share
- Update a file share
- Update a share mount target
- Delete a file share
- Delete a share mount target
Action needed
Before you specify version
query parameter of 2023-05-30
or later, follow these actions to avoid regressions in client functionality.
Client migration
Before you migrate a client to API version 2023-05-30
or later, review your code for use of the targets
property. Change all instances of targets
to mount_targets
in the manner appropriate
for your programming language. Changes are required in all relevant request paths, and request and response JSON field name formats. For more information, see the Beta API change log.
Examples
These examples compare differences between before and after the 2023-05-30
versioned change. All requests that use a version
query parameter of 2023-05-30
or later must use /shares/{share_id}/mount_targets
(instead of /shares/{share_id}/targets
) in the request URL.
Listing a file share and mount targets
The following examples compare how to make a request to list a file share and mount targets before and after the 2023-05-30
versioned change. The path of the API request is different before and after the change.
This request lists a file share and mount targets, specifying API version 2023-05-29
or earlier. The path of the API request includes /targets
.
curl -X GET \
"$vpc_api_endpoint/v1/shares/{share_id}/targets?version=2023-05-29&generation=2&maturity=beta"\
-H "Authorization: Bearer $iam_token"\
-H 'Content-Type: application/json'
This request lists a file share and mount targets, specifying API version 2023-05-30
or later. The path of the API request includes /mount_targets
.
curl -X GET \
"$vpc_api_endpoint/v1/shares/{share_id}/mount_targets?version=2023-05-30&generation=2&maturity=beta"\
-H "Authorization: Bearer $iam_token"\
-H 'Content-Type: application/json'
Creating a file share and mount target
The following examples compare how to make a request to create a file share and mount target before and after the 2023-05-30
versioned change. The path of the API request is the same before and after the property change. However,
the data section changes with the new mount_targets
property.
This request creates a file share and target, specifying API version 2023-05-29
or earlier. The targets
property is specified in the example.
curl -X POST \
"$vpc_api_endpoint/v1/shares?version=2023-05-29&generation=2&maturity=beta"\
-H "Authorization: Bearer $iam_token"\
-H 'Content-Type: application/json' \
-d '{
"size": 100,
"targets": [
{
"name": "target-1",
"vpc": {
"id": "a1fb6c4f-6a63-4d34-8bf6-55fab89e932a"
}
}
],
"name": "share-name1",
"profile": {
"name": "tier-5iops"
},
"user_tags": [],
"zone": {
"name": "us-south-1"
}
}'
This request creates a file share and mount target, specifying API version 2023-05-30
or later. The mount_targets
property is specified in the example.
curl -X POST \
"$vpc_api_endpoint/v1/shares?version=2023-05-30&generation=2&maturity=beta"\
-H "Authorization: Bearer $iam_token"\
-H 'Content-Type: application/json' \
-d '{
"size": 300,
"mount_targets": [
{
"name": "mount-target-2",
"vpc": {
"id": "d716af94-b1be-4705-9f70-a6771d622f7d"
}
}
],
"name": "share-name1",
"profile": {
"name": "tier-5iops"
},
"user_tags": [],
"zone": {
"name": "us-south-1"
}
}'
Creating a mount target for an existing share
The following examples compare how to create a mount target for an existing file share before and after the 2023-05-30
versioned change. The path of the API request is different before and after the change.
This request creates a target for an existing file share, specifying API version 2023-05-29
or earlier. The path of the API includes /targets
.
curl -X POST \
"$vpc_api_endpoint/v1/shares/$share_id/targets?version=2023-05-29&generation=2&maturity=beta"\
-H "Authorization: Bearer $iam_token"\
-H 'Content-Type: application/json'\
-d '{
"name": "target-3",
"vpc": {
"id": "6e01bc24-4a6e-4a0c-a1bd-4caa0c8159e7"
}
}'
This request creates a mount target for an existing file share, specifying API version 2023-05-30
or later. The path of the API includes /mount_targets
.
curl -X POST \
"$vpc_api_endpoint/v1/shares/$share_id/mount_targets?version=2023-05-30&generation=2&maturity=beta"\
-H "Authorization: Bearer $iam_token"\
-H 'Content-Type: application/json'\
-d '{
"name": "mount-target-4",
"vpc": {
"id": "549192f1-d238-42bd-8657-b6034a08f04e"
}
}'
Updating a file share mount target
The following examples compare how to make a request to update a file share mount target before and after the 2023-05-30
versioned change. The path of the API request is different before and after the change.
This request updates a mount target, specifying API version 2023-05-29
or earlier. The path of the API includes /targets
.
curl -X PATCH \
"$vpc_api_endpoint/v1/shares/$share_id/targets/$id?version=2023-05-29&generation=2&maturity=beta"\
-H "Authorization: Bearer $iam_token"\
-H 'Content-Type: application/json' \
-d '{
"name": "target-1-updated"
}'
This request updates a file share mount target, specifying API version 2023-05-30
or later. The path of the API includes /mount_targets
.
curl -X PATCH \
"$vpc_api_endpoint/v1/shares/$share_id/mount_targets/$id?version=2023-05-30&generation=2&maturity=beta"\
-H "Authorization: Bearer $iam_token"\
-H 'Content-Type: application/json' \
-d '{
"name": "target-2-updated"
}'
Deleting a file share mount target
The following examples compare how to make a request to delete a file share mount target before and after the 2023-05-30
versioned change. The path of the API request is different before and after the change.
This request deletes a mount target, specifying API version 2023-05-29
or earlier. The path of the API includes /targets
.
curl -X DELETE \
"$vpc_api_endpoint/v1/shares/$share_id/targets/$id?version=2023-05-29&generation=2&maturity=beta"\
-H "Authorization: Bearer $iam_token"\
-H 'Content-Type: application/json'
This request deletes a file share mount target, specifying API version 2023-05-30
or later. The path of the API includes /mount_targets
.
curl -X DELETE \
"$vpc_api_endpoint/v1/shares/$share_id/mount_targets/$id?version=2023-05-30&generation=2&maturity=beta"\
-H "Authorization: Bearer $iam_token"\
-H 'Content-Type: application/json'
Changed methods
Table 1 lists the methods in which the targets
property was changed to the mount_targets
property in hrefs
, request bodies, and response bodies.
Method | Original request path | New request path | Changed request payload | Changed response payload |
---|---|---|---|---|
GET |
/shares |
/shares |
No change | mount_targets |
/shares/{id} |
/shares/{id} |
No change | mount_targets |
|
/shares/{id}/targets |
/shares/{id}/mount_targets |
No change | mount_targets |
|
/shares/{share_id}/source |
/shares/{share_id}/source |
No change | mount_targets |
|
POST |
/shares |
/shares |
mount_targets |
mount_targets |
/shares/{id}/targets |
/shares/{id}/mount_targets |
No change | No change | |
/shares/{id}/failover |
/shares/{id}/failover |
No change | mount_targets |
|
PATCH |
/shares/{id} |
/shares/{id} |
No change | mount_targets |
/shares/{share_id}/targets/{id} |
/shares/{share_id}/mount_targets/{id} |
No change | No change | |
DELETE |
/shares/{id} |
/shares/{id}/ |
No change | mount_targets |
/shares/{id}/targets/{id} |
/shares/{id}/mount_targets/{id} |
No change | No change |