Skip to content

Commit

Permalink
Stg93 Snapshot management support via REST for NFS shares (Cleaned) (A…
Browse files Browse the repository at this point in the history
…zure#38845)

* swagger and hookup

* everything

* style

* removing preprod from test environment suffix

* adding better descriptions

* renaming

* re-recording
  • Loading branch information
ibrandes committed Apr 16, 2024
1 parent 02c23b5 commit f16c07a
Show file tree
Hide file tree
Showing 14 changed files with 403 additions and 164 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@ Mono<Response<ShareInfo>> createWithResponse(ShareCreateOptions options, Context
enabledProtocol = "".equals(enabledProtocol) ? null : enabledProtocol;
return azureFileStorageClient.getShares()
.createWithResponseAsync(shareName, null, options.getMetadata(), options.getQuotaInGb(),
options.getAccessTier(), enabledProtocol, options.getRootSquash(), context)
options.getAccessTier(), enabledProtocol, options.getRootSquash(),
options.isSnapshotVirtualDirectoryAccessEnabled(), context)
.map(this::mapToShareInfoResponse);
}

Expand Down Expand Up @@ -943,7 +944,8 @@ Mono<Response<ShareInfo>> setPropertiesWithResponse(ShareSetPropertiesOptions op
? new ShareRequestConditions() : options.getRequestConditions();
context = context == null ? Context.NONE : context;
return azureFileStorageClient.getShares().setPropertiesWithResponseAsync(shareName, null,
options.getQuotaInGb(), options.getAccessTier(), requestConditions.getLeaseId(), options.getRootSquash(), context)
options.getQuotaInGb(), options.getAccessTier(), requestConditions.getLeaseId(), options.getRootSquash(),
options.isSnapshotVirtualDirectoryAccessEnabled(), context)
.map(this::mapToShareInfoResponse);
}

Expand Down Expand Up @@ -2318,7 +2320,8 @@ private Response<ShareProperties> mapGetPropertiesResponse(
.setAccessTierChangeTime(headers.getXMsAccessTierChangeTime())
.setAccessTierTransitionState(headers.getXMsAccessTierTransitionState())
.setProtocols(ModelHelper.parseShareProtocols(headers.getXMsEnabledProtocols()))
.setRootSquash(headers.getXMsRootSquash());
.setRootSquash(headers.getXMsRootSquash())
.setEnableSnapshotVirtualDirectoryAccess(headers.isXMsEnableSnapshotVirtualDirectoryAccess());

return new SimpleResponse<>(response, shareProperties);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import com.azure.storage.file.share.implementation.models.ShareItemInternal;
import com.azure.storage.file.share.models.ShareServiceProperties;
import com.azure.storage.file.share.models.ShareStorageException;
import com.azure.storage.file.share.models.ShareTokenIntent;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -74,7 +73,6 @@ Mono<ResponseBase<ServicesSetPropertiesHeaders, Void>> setProperties(
@QueryParam("comp") String comp,
@QueryParam("timeout") Integer timeout,
@HeaderParam("x-ms-version") String version,
@HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent,
@BodyParam("application/xml") ShareServiceProperties shareServiceProperties,
@HeaderParam("Accept") String accept,
Context context);
Expand All @@ -88,7 +86,6 @@ Mono<Response<Void>> setPropertiesNoCustomHeaders(
@QueryParam("comp") String comp,
@QueryParam("timeout") Integer timeout,
@HeaderParam("x-ms-version") String version,
@HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent,
@BodyParam("application/xml") ShareServiceProperties shareServiceProperties,
@HeaderParam("Accept") String accept,
Context context);
Expand All @@ -102,7 +99,6 @@ Mono<ResponseBase<ServicesGetPropertiesHeaders, ShareServiceProperties>> getProp
@QueryParam("comp") String comp,
@QueryParam("timeout") Integer timeout,
@HeaderParam("x-ms-version") String version,
@HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent,
@HeaderParam("Accept") String accept,
Context context);

Expand All @@ -115,7 +111,6 @@ Mono<Response<ShareServiceProperties>> getPropertiesNoCustomHeaders(
@QueryParam("comp") String comp,
@QueryParam("timeout") Integer timeout,
@HeaderParam("x-ms-version") String version,
@HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent,
@HeaderParam("Accept") String accept,
Context context);

Expand All @@ -131,7 +126,6 @@ Mono<ResponseBase<ServicesListSharesSegmentHeaders, ListSharesResponse>> listSha
@QueryParam("include") String include,
@QueryParam("timeout") Integer timeout,
@HeaderParam("x-ms-version") String version,
@HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent,
@HeaderParam("Accept") String accept,
Context context);

Expand All @@ -147,7 +141,6 @@ Mono<Response<ListSharesResponse>> listSharesSegmentNoCustomHeaders(
@QueryParam("include") String include,
@QueryParam("timeout") Integer timeout,
@HeaderParam("x-ms-version") String version,
@HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent,
@HeaderParam("Accept") String accept,
Context context);

Expand All @@ -158,7 +151,6 @@ Mono<ResponseBase<ServicesListSharesSegmentNextHeaders, ListSharesResponse>> lis
@PathParam(value = "nextLink", encoded = true) String nextLink,
@HostParam("url") String url,
@HeaderParam("x-ms-version") String version,
@HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent,
@HeaderParam("Accept") String accept,
Context context);

Expand All @@ -169,7 +161,6 @@ Mono<Response<ListSharesResponse>> listSharesSegmentNextNoCustomHeaders(
@PathParam(value = "nextLink", encoded = true) String nextLink,
@HostParam("url") String url,
@HeaderParam("x-ms-version") String version,
@HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent,
@HeaderParam("Accept") String accept,
Context context);
}
Expand Down Expand Up @@ -201,7 +192,6 @@ public Mono<ResponseBase<ServicesSetPropertiesHeaders, Void>> setPropertiesWithR
comp,
timeout,
this.client.getVersion(),
this.client.getFileRequestIntent(),
shareServiceProperties,
accept,
context));
Expand Down Expand Up @@ -233,7 +223,6 @@ public Mono<ResponseBase<ServicesSetPropertiesHeaders, Void>> setPropertiesWithR
comp,
timeout,
this.client.getVersion(),
this.client.getFileRequestIntent(),
shareServiceProperties,
accept,
context);
Expand Down Expand Up @@ -305,7 +294,6 @@ public Mono<Response<Void>> setPropertiesNoCustomHeadersWithResponseAsync(
comp,
timeout,
this.client.getVersion(),
this.client.getFileRequestIntent(),
shareServiceProperties,
accept,
context));
Expand Down Expand Up @@ -337,7 +325,6 @@ public Mono<Response<Void>> setPropertiesNoCustomHeadersWithResponseAsync(
comp,
timeout,
this.client.getVersion(),
this.client.getFileRequestIntent(),
shareServiceProperties,
accept,
context);
Expand Down Expand Up @@ -371,7 +358,6 @@ public Mono<ResponseBase<ServicesGetPropertiesHeaders, ShareServiceProperties>>
comp,
timeout,
this.client.getVersion(),
this.client.getFileRequestIntent(),
accept,
context));
}
Expand All @@ -398,14 +384,7 @@ public Mono<ResponseBase<ServicesGetPropertiesHeaders, ShareServiceProperties>>
final String comp = "properties";
final String accept = "application/xml";
return service.getProperties(
this.client.getUrl(),
restype,
comp,
timeout,
this.client.getVersion(),
this.client.getFileRequestIntent(),
accept,
context);
this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), accept, context);
}

/**
Expand Down Expand Up @@ -472,7 +451,6 @@ public Mono<Response<ShareServiceProperties>> getPropertiesNoCustomHeadersWithRe
comp,
timeout,
this.client.getVersion(),
this.client.getFileRequestIntent(),
accept,
context));
}
Expand All @@ -499,14 +477,7 @@ public Mono<Response<ShareServiceProperties>> getPropertiesNoCustomHeadersWithRe
final String comp = "properties";
final String accept = "application/xml";
return service.getPropertiesNoCustomHeaders(
this.client.getUrl(),
restype,
comp,
timeout,
this.client.getVersion(),
this.client.getFileRequestIntent(),
accept,
context);
this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), accept, context);
}

/**
Expand Down Expand Up @@ -548,7 +519,6 @@ public Mono<PagedResponse<ShareItemInternal>> listSharesSegmentSinglePageAsync(
includeConverted,
timeout,
this.client.getVersion(),
this.client.getFileRequestIntent(),
accept,
context))
.map(
Expand Down Expand Up @@ -605,7 +575,6 @@ public Mono<PagedResponse<ShareItemInternal>> listSharesSegmentSinglePageAsync(
includeConverted,
timeout,
this.client.getVersion(),
this.client.getFileRequestIntent(),
accept,
context)
.map(
Expand Down Expand Up @@ -718,7 +687,6 @@ public Mono<PagedResponse<ShareItemInternal>> listSharesSegmentNoCustomHeadersSi
includeConverted,
timeout,
this.client.getVersion(),
this.client.getFileRequestIntent(),
accept,
context))
.map(
Expand Down Expand Up @@ -775,7 +743,6 @@ public Mono<PagedResponse<ShareItemInternal>> listSharesSegmentNoCustomHeadersSi
includeConverted,
timeout,
this.client.getVersion(),
this.client.getFileRequestIntent(),
accept,
context)
.map(
Expand Down Expand Up @@ -867,12 +834,7 @@ public Mono<PagedResponse<ShareItemInternal>> listSharesSegmentNextSinglePageAsy
return FluxUtil.withContext(
context ->
service.listSharesSegmentNext(
nextLink,
this.client.getUrl(),
this.client.getVersion(),
this.client.getFileRequestIntent(),
accept,
context))
nextLink, this.client.getUrl(), this.client.getVersion(), accept, context))
.map(
res ->
new PagedResponseBase<>(
Expand All @@ -899,13 +861,7 @@ public Mono<PagedResponse<ShareItemInternal>> listSharesSegmentNextSinglePageAsy
public Mono<PagedResponse<ShareItemInternal>> listSharesSegmentNextSinglePageAsync(
String nextLink, Context context) {
final String accept = "application/xml";
return service.listSharesSegmentNext(
nextLink,
this.client.getUrl(),
this.client.getVersion(),
this.client.getFileRequestIntent(),
accept,
context)
return service.listSharesSegmentNext(nextLink, this.client.getUrl(), this.client.getVersion(), accept, context)
.map(
res ->
new PagedResponseBase<>(
Expand Down Expand Up @@ -933,12 +889,7 @@ public Mono<PagedResponse<ShareItemInternal>> listSharesSegmentNextNoCustomHeade
return FluxUtil.withContext(
context ->
service.listSharesSegmentNextNoCustomHeaders(
nextLink,
this.client.getUrl(),
this.client.getVersion(),
this.client.getFileRequestIntent(),
accept,
context))
nextLink, this.client.getUrl(), this.client.getVersion(), accept, context))
.map(
res ->
new PagedResponseBase<>(
Expand Down Expand Up @@ -966,12 +917,7 @@ public Mono<PagedResponse<ShareItemInternal>> listSharesSegmentNextNoCustomHeade
String nextLink, Context context) {
final String accept = "application/xml";
return service.listSharesSegmentNextNoCustomHeaders(
nextLink,
this.client.getUrl(),
this.client.getVersion(),
this.client.getFileRequestIntent(),
accept,
context)
nextLink, this.client.getUrl(), this.client.getVersion(), accept, context)
.map(
res ->
new PagedResponseBase<>(
Expand Down
Loading

0 comments on commit f16c07a

Please sign in to comment.