Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for
license information.
Code generated by Microsoft (R) AutoRest Code Generator.
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.management.compute.implementation;
import retrofit2.Retrofit;
import com.google.common.reflect.TypeToken;
import com.microsoft.azure.CloudException;
import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.ServiceResponse;
import java.io.IOException;
import java.util.List;
import okhttp3.ResponseBody;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.Response;
import rx.functions.Func1;
import rx.Observable;
An instance of this class provides access to all the operations defined
in VirtualMachineImagesEdgeZones.
/**
* An instance of this class provides access to all the operations defined
* in VirtualMachineImagesEdgeZones.
*/
public class VirtualMachineImagesEdgeZonesInner {
The Retrofit service to perform REST calls. /** The Retrofit service to perform REST calls. */
private VirtualMachineImagesEdgeZonesService service;
The service client containing this operation class. /** The service client containing this operation class. */
private ComputeManagementClientImpl client;
Initializes an instance of VirtualMachineImagesEdgeZonesInner.
Params: - retrofit – the Retrofit instance built from a Retrofit Builder.
- client – the instance of the service client containing this operation class.
/**
* Initializes an instance of VirtualMachineImagesEdgeZonesInner.
*
* @param retrofit the Retrofit instance built from a Retrofit Builder.
* @param client the instance of the service client containing this operation class.
*/
public VirtualMachineImagesEdgeZonesInner(Retrofit retrofit, ComputeManagementClientImpl client) {
this.service = retrofit.create(VirtualMachineImagesEdgeZonesService.class);
this.client = client;
}
The interface defining all the services for VirtualMachineImagesEdgeZones to be
used by Retrofit to perform actually REST calls.
/**
* The interface defining all the services for VirtualMachineImagesEdgeZones to be
* used by Retrofit to perform actually REST calls.
*/
interface VirtualMachineImagesEdgeZonesService {
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachineImagesEdgeZones get" })
@GET("subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}")
Observable<Response<ResponseBody>> get(@Path("location") String location, @Path("edgeZone") String edgeZone, @Path("publisherName") String publisherName, @Path("offer") String offer, @Path("skus") String skus, @Path("version") String version, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachineImagesEdgeZones list" })
@GET("subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions")
Observable<Response<ResponseBody>> list(@Path("location") String location, @Path("edgeZone") String edgeZone, @Path("publisherName") String publisherName, @Path("offer") String offer, @Path("skus") String skus, @Path("subscriptionId") String subscriptionId, @Query("$expand") String expand, @Query("$top") Integer top, @Query("$orderby") String orderby, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachineImagesEdgeZones listOffers" })
@GET("subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers")
Observable<Response<ResponseBody>> listOffers(@Path("location") String location, @Path("edgeZone") String edgeZone, @Path("publisherName") String publisherName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachineImagesEdgeZones listPublishers" })
@GET("subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers")
Observable<Response<ResponseBody>> listPublishers(@Path("location") String location, @Path("edgeZone") String edgeZone, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.compute.VirtualMachineImagesEdgeZones listSkus" })
@GET("subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus")
Observable<Response<ResponseBody>> listSkus(@Path("location") String location, @Path("edgeZone") String edgeZone, @Path("publisherName") String publisherName, @Path("offer") String offer, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
}
Gets a virtual machine image in an edge zone.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
- offer – A valid image publisher offer.
- skus – A valid image SKU.
- version – A valid image SKU version.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the VirtualMachineImageInner object if successful.
/**
* Gets a virtual machine image in an edge zone.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @param offer A valid image publisher offer.
* @param skus A valid image SKU.
* @param version A valid image SKU version.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the VirtualMachineImageInner object if successful.
*/
public VirtualMachineImageInner get(String location, String edgeZone, String publisherName, String offer, String skus, String version) {
return getWithServiceResponseAsync(location, edgeZone, publisherName, offer, skus, version).toBlocking().single().body();
}
Gets a virtual machine image in an edge zone.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
- offer – A valid image publisher offer.
- skus – A valid image SKU.
- version – A valid image SKU version.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets a virtual machine image in an edge zone.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @param offer A valid image publisher offer.
* @param skus A valid image SKU.
* @param version A valid image SKU version.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<VirtualMachineImageInner> getAsync(String location, String edgeZone, String publisherName, String offer, String skus, String version, final ServiceCallback<VirtualMachineImageInner> serviceCallback) {
return ServiceFuture.fromResponse(getWithServiceResponseAsync(location, edgeZone, publisherName, offer, skus, version), serviceCallback);
}
Gets a virtual machine image in an edge zone.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
- offer – A valid image publisher offer.
- skus – A valid image SKU.
- version – A valid image SKU version.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the VirtualMachineImageInner object
/**
* Gets a virtual machine image in an edge zone.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @param offer A valid image publisher offer.
* @param skus A valid image SKU.
* @param version A valid image SKU version.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the VirtualMachineImageInner object
*/
public Observable<VirtualMachineImageInner> getAsync(String location, String edgeZone, String publisherName, String offer, String skus, String version) {
return getWithServiceResponseAsync(location, edgeZone, publisherName, offer, skus, version).map(new Func1<ServiceResponse<VirtualMachineImageInner>, VirtualMachineImageInner>() {
@Override
public VirtualMachineImageInner call(ServiceResponse<VirtualMachineImageInner> response) {
return response.body();
}
});
}
Gets a virtual machine image in an edge zone.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
- offer – A valid image publisher offer.
- skus – A valid image SKU.
- version – A valid image SKU version.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the VirtualMachineImageInner object
/**
* Gets a virtual machine image in an edge zone.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @param offer A valid image publisher offer.
* @param skus A valid image SKU.
* @param version A valid image SKU version.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the VirtualMachineImageInner object
*/
public Observable<ServiceResponse<VirtualMachineImageInner>> getWithServiceResponseAsync(String location, String edgeZone, String publisherName, String offer, String skus, String version) {
if (location == null) {
throw new IllegalArgumentException("Parameter location is required and cannot be null.");
}
if (edgeZone == null) {
throw new IllegalArgumentException("Parameter edgeZone is required and cannot be null.");
}
if (publisherName == null) {
throw new IllegalArgumentException("Parameter publisherName is required and cannot be null.");
}
if (offer == null) {
throw new IllegalArgumentException("Parameter offer is required and cannot be null.");
}
if (skus == null) {
throw new IllegalArgumentException("Parameter skus is required and cannot be null.");
}
if (version == null) {
throw new IllegalArgumentException("Parameter version is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2020-12-01";
return service.get(location, edgeZone, publisherName, offer, skus, version, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<VirtualMachineImageInner>>>() {
@Override
public Observable<ServiceResponse<VirtualMachineImageInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<VirtualMachineImageInner> clientResponse = getDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<VirtualMachineImageInner> getDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<VirtualMachineImageInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<VirtualMachineImageInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
- offer – A valid image publisher offer.
- skus – A valid image SKU.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the List<VirtualMachineImageResourceInner> object if successful.
/**
* Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @param offer A valid image publisher offer.
* @param skus A valid image SKU.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the List<VirtualMachineImageResourceInner> object if successful.
*/
public List<VirtualMachineImageResourceInner> list(String location, String edgeZone, String publisherName, String offer, String skus) {
return listWithServiceResponseAsync(location, edgeZone, publisherName, offer, skus).toBlocking().single().body();
}
Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
- offer – A valid image publisher offer.
- skus – A valid image SKU.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @param offer A valid image publisher offer.
* @param skus A valid image SKU.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<List<VirtualMachineImageResourceInner>> listAsync(String location, String edgeZone, String publisherName, String offer, String skus, final ServiceCallback<List<VirtualMachineImageResourceInner>> serviceCallback) {
return ServiceFuture.fromResponse(listWithServiceResponseAsync(location, edgeZone, publisherName, offer, skus), serviceCallback);
}
Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
- offer – A valid image publisher offer.
- skus – A valid image SKU.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the List<VirtualMachineImageResourceInner> object
/**
* Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @param offer A valid image publisher offer.
* @param skus A valid image SKU.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List<VirtualMachineImageResourceInner> object
*/
public Observable<List<VirtualMachineImageResourceInner>> listAsync(String location, String edgeZone, String publisherName, String offer, String skus) {
return listWithServiceResponseAsync(location, edgeZone, publisherName, offer, skus).map(new Func1<ServiceResponse<List<VirtualMachineImageResourceInner>>, List<VirtualMachineImageResourceInner>>() {
@Override
public List<VirtualMachineImageResourceInner> call(ServiceResponse<List<VirtualMachineImageResourceInner>> response) {
return response.body();
}
});
}
Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
- offer – A valid image publisher offer.
- skus – A valid image SKU.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the List<VirtualMachineImageResourceInner> object
/**
* Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @param offer A valid image publisher offer.
* @param skus A valid image SKU.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List<VirtualMachineImageResourceInner> object
*/
public Observable<ServiceResponse<List<VirtualMachineImageResourceInner>>> listWithServiceResponseAsync(String location, String edgeZone, String publisherName, String offer, String skus) {
if (location == null) {
throw new IllegalArgumentException("Parameter location is required and cannot be null.");
}
if (edgeZone == null) {
throw new IllegalArgumentException("Parameter edgeZone is required and cannot be null.");
}
if (publisherName == null) {
throw new IllegalArgumentException("Parameter publisherName is required and cannot be null.");
}
if (offer == null) {
throw new IllegalArgumentException("Parameter offer is required and cannot be null.");
}
if (skus == null) {
throw new IllegalArgumentException("Parameter skus is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2020-12-01";
final String expand = null;
final Integer top = null;
final String orderby = null;
return service.list(location, edgeZone, publisherName, offer, skus, this.client.subscriptionId(), expand, top, orderby, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<VirtualMachineImageResourceInner>>>>() {
@Override
public Observable<ServiceResponse<List<VirtualMachineImageResourceInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<List<VirtualMachineImageResourceInner>> clientResponse = listDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
- offer – A valid image publisher offer.
- skus – A valid image SKU.
- expand – The expand expression to apply on the operation.
- top – An integer value specifying the number of images to return that matches supplied values.
- orderby – Specifies the order of the results returned. Formatted as an OData query.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the List<VirtualMachineImageResourceInner> object if successful.
/**
* Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @param offer A valid image publisher offer.
* @param skus A valid image SKU.
* @param expand The expand expression to apply on the operation.
* @param top An integer value specifying the number of images to return that matches supplied values.
* @param orderby Specifies the order of the results returned. Formatted as an OData query.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the List<VirtualMachineImageResourceInner> object if successful.
*/
public List<VirtualMachineImageResourceInner> list(String location, String edgeZone, String publisherName, String offer, String skus, String expand, Integer top, String orderby) {
return listWithServiceResponseAsync(location, edgeZone, publisherName, offer, skus, expand, top, orderby).toBlocking().single().body();
}
Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
- offer – A valid image publisher offer.
- skus – A valid image SKU.
- expand – The expand expression to apply on the operation.
- top – An integer value specifying the number of images to return that matches supplied values.
- orderby – Specifies the order of the results returned. Formatted as an OData query.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @param offer A valid image publisher offer.
* @param skus A valid image SKU.
* @param expand The expand expression to apply on the operation.
* @param top An integer value specifying the number of images to return that matches supplied values.
* @param orderby Specifies the order of the results returned. Formatted as an OData query.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<List<VirtualMachineImageResourceInner>> listAsync(String location, String edgeZone, String publisherName, String offer, String skus, String expand, Integer top, String orderby, final ServiceCallback<List<VirtualMachineImageResourceInner>> serviceCallback) {
return ServiceFuture.fromResponse(listWithServiceResponseAsync(location, edgeZone, publisherName, offer, skus, expand, top, orderby), serviceCallback);
}
Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
- offer – A valid image publisher offer.
- skus – A valid image SKU.
- expand – The expand expression to apply on the operation.
- top – An integer value specifying the number of images to return that matches supplied values.
- orderby – Specifies the order of the results returned. Formatted as an OData query.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the List<VirtualMachineImageResourceInner> object
/**
* Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @param offer A valid image publisher offer.
* @param skus A valid image SKU.
* @param expand The expand expression to apply on the operation.
* @param top An integer value specifying the number of images to return that matches supplied values.
* @param orderby Specifies the order of the results returned. Formatted as an OData query.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List<VirtualMachineImageResourceInner> object
*/
public Observable<List<VirtualMachineImageResourceInner>> listAsync(String location, String edgeZone, String publisherName, String offer, String skus, String expand, Integer top, String orderby) {
return listWithServiceResponseAsync(location, edgeZone, publisherName, offer, skus, expand, top, orderby).map(new Func1<ServiceResponse<List<VirtualMachineImageResourceInner>>, List<VirtualMachineImageResourceInner>>() {
@Override
public List<VirtualMachineImageResourceInner> call(ServiceResponse<List<VirtualMachineImageResourceInner>> response) {
return response.body();
}
});
}
Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
- offer – A valid image publisher offer.
- skus – A valid image SKU.
- expand – The expand expression to apply on the operation.
- top – An integer value specifying the number of images to return that matches supplied values.
- orderby – Specifies the order of the results returned. Formatted as an OData query.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the List<VirtualMachineImageResourceInner> object
/**
* Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @param offer A valid image publisher offer.
* @param skus A valid image SKU.
* @param expand The expand expression to apply on the operation.
* @param top An integer value specifying the number of images to return that matches supplied values.
* @param orderby Specifies the order of the results returned. Formatted as an OData query.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List<VirtualMachineImageResourceInner> object
*/
public Observable<ServiceResponse<List<VirtualMachineImageResourceInner>>> listWithServiceResponseAsync(String location, String edgeZone, String publisherName, String offer, String skus, String expand, Integer top, String orderby) {
if (location == null) {
throw new IllegalArgumentException("Parameter location is required and cannot be null.");
}
if (edgeZone == null) {
throw new IllegalArgumentException("Parameter edgeZone is required and cannot be null.");
}
if (publisherName == null) {
throw new IllegalArgumentException("Parameter publisherName is required and cannot be null.");
}
if (offer == null) {
throw new IllegalArgumentException("Parameter offer is required and cannot be null.");
}
if (skus == null) {
throw new IllegalArgumentException("Parameter skus is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2020-12-01";
return service.list(location, edgeZone, publisherName, offer, skus, this.client.subscriptionId(), expand, top, orderby, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<VirtualMachineImageResourceInner>>>>() {
@Override
public Observable<ServiceResponse<List<VirtualMachineImageResourceInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<List<VirtualMachineImageResourceInner>> clientResponse = listDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<List<VirtualMachineImageResourceInner>> listDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<List<VirtualMachineImageResourceInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<List<VirtualMachineImageResourceInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets a list of virtual machine image offers for the specified location, edge zone and publisher.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the List<VirtualMachineImageResourceInner> object if successful.
/**
* Gets a list of virtual machine image offers for the specified location, edge zone and publisher.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the List<VirtualMachineImageResourceInner> object if successful.
*/
public List<VirtualMachineImageResourceInner> listOffers(String location, String edgeZone, String publisherName) {
return listOffersWithServiceResponseAsync(location, edgeZone, publisherName).toBlocking().single().body();
}
Gets a list of virtual machine image offers for the specified location, edge zone and publisher.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets a list of virtual machine image offers for the specified location, edge zone and publisher.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<List<VirtualMachineImageResourceInner>> listOffersAsync(String location, String edgeZone, String publisherName, final ServiceCallback<List<VirtualMachineImageResourceInner>> serviceCallback) {
return ServiceFuture.fromResponse(listOffersWithServiceResponseAsync(location, edgeZone, publisherName), serviceCallback);
}
Gets a list of virtual machine image offers for the specified location, edge zone and publisher.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the List<VirtualMachineImageResourceInner> object
/**
* Gets a list of virtual machine image offers for the specified location, edge zone and publisher.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List<VirtualMachineImageResourceInner> object
*/
public Observable<List<VirtualMachineImageResourceInner>> listOffersAsync(String location, String edgeZone, String publisherName) {
return listOffersWithServiceResponseAsync(location, edgeZone, publisherName).map(new Func1<ServiceResponse<List<VirtualMachineImageResourceInner>>, List<VirtualMachineImageResourceInner>>() {
@Override
public List<VirtualMachineImageResourceInner> call(ServiceResponse<List<VirtualMachineImageResourceInner>> response) {
return response.body();
}
});
}
Gets a list of virtual machine image offers for the specified location, edge zone and publisher.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the List<VirtualMachineImageResourceInner> object
/**
* Gets a list of virtual machine image offers for the specified location, edge zone and publisher.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List<VirtualMachineImageResourceInner> object
*/
public Observable<ServiceResponse<List<VirtualMachineImageResourceInner>>> listOffersWithServiceResponseAsync(String location, String edgeZone, String publisherName) {
if (location == null) {
throw new IllegalArgumentException("Parameter location is required and cannot be null.");
}
if (edgeZone == null) {
throw new IllegalArgumentException("Parameter edgeZone is required and cannot be null.");
}
if (publisherName == null) {
throw new IllegalArgumentException("Parameter publisherName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2020-12-01";
return service.listOffers(location, edgeZone, publisherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<VirtualMachineImageResourceInner>>>>() {
@Override
public Observable<ServiceResponse<List<VirtualMachineImageResourceInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<List<VirtualMachineImageResourceInner>> clientResponse = listOffersDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<List<VirtualMachineImageResourceInner>> listOffersDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<List<VirtualMachineImageResourceInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<List<VirtualMachineImageResourceInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets a list of virtual machine image publishers for the specified Azure location and edge zone.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the List<VirtualMachineImageResourceInner> object if successful.
/**
* Gets a list of virtual machine image publishers for the specified Azure location and edge zone.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the List<VirtualMachineImageResourceInner> object if successful.
*/
public List<VirtualMachineImageResourceInner> listPublishers(String location, String edgeZone) {
return listPublishersWithServiceResponseAsync(location, edgeZone).toBlocking().single().body();
}
Gets a list of virtual machine image publishers for the specified Azure location and edge zone.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets a list of virtual machine image publishers for the specified Azure location and edge zone.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<List<VirtualMachineImageResourceInner>> listPublishersAsync(String location, String edgeZone, final ServiceCallback<List<VirtualMachineImageResourceInner>> serviceCallback) {
return ServiceFuture.fromResponse(listPublishersWithServiceResponseAsync(location, edgeZone), serviceCallback);
}
Gets a list of virtual machine image publishers for the specified Azure location and edge zone.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the List<VirtualMachineImageResourceInner> object
/**
* Gets a list of virtual machine image publishers for the specified Azure location and edge zone.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List<VirtualMachineImageResourceInner> object
*/
public Observable<List<VirtualMachineImageResourceInner>> listPublishersAsync(String location, String edgeZone) {
return listPublishersWithServiceResponseAsync(location, edgeZone).map(new Func1<ServiceResponse<List<VirtualMachineImageResourceInner>>, List<VirtualMachineImageResourceInner>>() {
@Override
public List<VirtualMachineImageResourceInner> call(ServiceResponse<List<VirtualMachineImageResourceInner>> response) {
return response.body();
}
});
}
Gets a list of virtual machine image publishers for the specified Azure location and edge zone.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the List<VirtualMachineImageResourceInner> object
/**
* Gets a list of virtual machine image publishers for the specified Azure location and edge zone.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List<VirtualMachineImageResourceInner> object
*/
public Observable<ServiceResponse<List<VirtualMachineImageResourceInner>>> listPublishersWithServiceResponseAsync(String location, String edgeZone) {
if (location == null) {
throw new IllegalArgumentException("Parameter location is required and cannot be null.");
}
if (edgeZone == null) {
throw new IllegalArgumentException("Parameter edgeZone is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2020-12-01";
return service.listPublishers(location, edgeZone, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<VirtualMachineImageResourceInner>>>>() {
@Override
public Observable<ServiceResponse<List<VirtualMachineImageResourceInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<List<VirtualMachineImageResourceInner>> clientResponse = listPublishersDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<List<VirtualMachineImageResourceInner>> listPublishersDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<List<VirtualMachineImageResourceInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<List<VirtualMachineImageResourceInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
- offer – A valid image publisher offer.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
- CloudException – thrown if the request is rejected by server
- RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns: the List<VirtualMachineImageResourceInner> object if successful.
/**
* Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @param offer A valid image publisher offer.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the List<VirtualMachineImageResourceInner> object if successful.
*/
public List<VirtualMachineImageResourceInner> listSkus(String location, String edgeZone, String publisherName, String offer) {
return listSkusWithServiceResponseAsync(location, edgeZone, publisherName, offer).toBlocking().single().body();
}
Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
- offer – A valid image publisher offer.
- serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the ServiceFuture
object
/**
* Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @param offer A valid image publisher offer.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<List<VirtualMachineImageResourceInner>> listSkusAsync(String location, String edgeZone, String publisherName, String offer, final ServiceCallback<List<VirtualMachineImageResourceInner>> serviceCallback) {
return ServiceFuture.fromResponse(listSkusWithServiceResponseAsync(location, edgeZone, publisherName, offer), serviceCallback);
}
Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
- offer – A valid image publisher offer.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the List<VirtualMachineImageResourceInner> object
/**
* Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @param offer A valid image publisher offer.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List<VirtualMachineImageResourceInner> object
*/
public Observable<List<VirtualMachineImageResourceInner>> listSkusAsync(String location, String edgeZone, String publisherName, String offer) {
return listSkusWithServiceResponseAsync(location, edgeZone, publisherName, offer).map(new Func1<ServiceResponse<List<VirtualMachineImageResourceInner>>, List<VirtualMachineImageResourceInner>>() {
@Override
public List<VirtualMachineImageResourceInner> call(ServiceResponse<List<VirtualMachineImageResourceInner>> response) {
return response.body();
}
});
}
Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer.
Params: - location – The name of a supported Azure region.
- edgeZone – The name of the edge zone.
- publisherName – A valid image publisher.
- offer – A valid image publisher offer.
Throws: - IllegalArgumentException – thrown if parameters fail the validation
Returns: the observable to the List<VirtualMachineImageResourceInner> object
/**
* Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer.
*
* @param location The name of a supported Azure region.
* @param edgeZone The name of the edge zone.
* @param publisherName A valid image publisher.
* @param offer A valid image publisher offer.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List<VirtualMachineImageResourceInner> object
*/
public Observable<ServiceResponse<List<VirtualMachineImageResourceInner>>> listSkusWithServiceResponseAsync(String location, String edgeZone, String publisherName, String offer) {
if (location == null) {
throw new IllegalArgumentException("Parameter location is required and cannot be null.");
}
if (edgeZone == null) {
throw new IllegalArgumentException("Parameter edgeZone is required and cannot be null.");
}
if (publisherName == null) {
throw new IllegalArgumentException("Parameter publisherName is required and cannot be null.");
}
if (offer == null) {
throw new IllegalArgumentException("Parameter offer is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2020-12-01";
return service.listSkus(location, edgeZone, publisherName, offer, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<VirtualMachineImageResourceInner>>>>() {
@Override
public Observable<ServiceResponse<List<VirtualMachineImageResourceInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<List<VirtualMachineImageResourceInner>> clientResponse = listSkusDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<List<VirtualMachineImageResourceInner>> listSkusDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<List<VirtualMachineImageResourceInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<List<VirtualMachineImageResourceInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
}