Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Release History

## 1.1.0-beta.3 (Unreleased)
## 1.0.0-beta.1 (2022-03-07)

- Azure Resource Manager MediaServices client library for Java. This package contains Microsoft Azure SDK for MediaServices Management SDK. This Swagger was generated by the API Framework. Package tag package-2021-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

## 1.1.0-beta.2 (2021-07-16)

Expand Down
60 changes: 58 additions & 2 deletions sdk/mediaservices/azure-resourcemanager-mediaservices/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Azure Resource Manager MediaServices client library for Java.

This package contains Microsoft Azure SDK for MediaServices Management SDK. This Swagger was generated by the API Framework. Package tag package-2021-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
This package contains Microsoft Azure SDK for MediaServices Management SDK. This Swagger was generated by the API Framework. Package tag package-2021-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

## We'd love to hear your feedback

Expand Down Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-mediaservices</artifactId>
<version>1.1.0-beta.2</version>
<version>1.1.0-beta.3</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down Expand Up @@ -74,6 +74,62 @@ See [API design][design] for general introduction on design and key concepts on

## Examples

```java
// storage account
StorageAccount storageAccount = storageManager.storageAccounts().define(STORAGE_ACCOUNT)
.withRegion(REGION)
.withExistingResourceGroup(resourceGroup)
.create();

// media service account
MediaService account = manager.mediaservices().define(ACCOUNT)
.withRegion(Region.US_WEST3)
.withExistingResourceGroup(resourceGroup)
.withStorageAccounts(Collections.singletonList(
new com.azure.resourcemanager.mediaservices.models.StorageAccount()
.withId(storageAccount.id())
.withType(StorageAccountType.PRIMARY)))
.create();

// transform
Transform transform = manager.transforms()
.define("transform1")
.withExistingMediaService(resourceGroup, ACCOUNT)
.withOutputs(Collections.singletonList(new TransformOutput()
.withPreset(new BuiltInStandardEncoderPreset()
.withPresetName(EncoderNamedPreset.CONTENT_AWARE_ENCODING))))
.create();

// output asset
Asset asset = manager.assets()
.define("output1")
.withExistingMediaService(resourceGroup, ACCOUNT)
.create();

// input uri
String jobHttpBaseUri = "https://nimbuscdn-nimbuspm.streaming.mediaservices.windows.net/2b533311-b215-4409-80af-529c3e853622/";
String jobFile = "Ignite-short.mp4";

// job
Job job = manager.jobs().define("job1")
.withExistingTransform(resourceGroup, ACCOUNT, "transform1")
.withInput(new JobInputHttp()
.withFiles(Collections.singletonList(jobFile))
.withBaseUri(jobHttpBaseUri)
.withLabel("input1"))
.withOutputs(Collections.singletonList(new JobOutputAsset().withAssetName("output1")))
.create();

// wait for job completion
JobState jobState = job.state();
while (!(jobState == JobState.CANCELED || jobState == JobState.ERROR || jobState == JobState.FINISHED)) {
sleepIfRunningAgainstService(10 * 1000); // wait 10 seconds
jobState = job.refresh().state();
}

// refresh output asset after job finished
asset.refresh();
```
[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/mediaservices/azure-resourcemanager-mediaservices/SAMPLE.md)


Expand Down
3,597 changes: 3,476 additions & 121 deletions sdk/mediaservices/azure-resourcemanager-mediaservices/SAMPLE.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for MediaServices Management</name>
<description>This package contains Microsoft Azure SDK for MediaServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. This Swagger was generated by the API Framework. Package tag package-2021-06.</description>
<description>This package contains Microsoft Azure SDK for MediaServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. This Swagger was generated by the API Framework. Package tag package-2021-11.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand All @@ -39,7 +39,6 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<revapi.skip>true</revapi.skip>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
Expand All @@ -31,12 +32,15 @@
import com.azure.resourcemanager.mediaservices.implementation.LiveOutputsImpl;
import com.azure.resourcemanager.mediaservices.implementation.LocationsImpl;
import com.azure.resourcemanager.mediaservices.implementation.MediaservicesImpl;
import com.azure.resourcemanager.mediaservices.implementation.OperationResultsImpl;
import com.azure.resourcemanager.mediaservices.implementation.OperationStatusesImpl;
import com.azure.resourcemanager.mediaservices.implementation.OperationsImpl;
import com.azure.resourcemanager.mediaservices.implementation.PrivateEndpointConnectionsImpl;
import com.azure.resourcemanager.mediaservices.implementation.PrivateLinkResourcesImpl;
import com.azure.resourcemanager.mediaservices.implementation.StreamingEndpointsImpl;
import com.azure.resourcemanager.mediaservices.implementation.StreamingLocatorsImpl;
import com.azure.resourcemanager.mediaservices.implementation.StreamingPoliciesImpl;
import com.azure.resourcemanager.mediaservices.implementation.TracksImpl;
import com.azure.resourcemanager.mediaservices.implementation.TransformsImpl;
import com.azure.resourcemanager.mediaservices.models.AccountFilters;
import com.azure.resourcemanager.mediaservices.models.AssetFilters;
Expand All @@ -47,21 +51,27 @@
import com.azure.resourcemanager.mediaservices.models.LiveOutputs;
import com.azure.resourcemanager.mediaservices.models.Locations;
import com.azure.resourcemanager.mediaservices.models.Mediaservices;
import com.azure.resourcemanager.mediaservices.models.OperationResults;
import com.azure.resourcemanager.mediaservices.models.OperationStatuses;
import com.azure.resourcemanager.mediaservices.models.Operations;
import com.azure.resourcemanager.mediaservices.models.PrivateEndpointConnections;
import com.azure.resourcemanager.mediaservices.models.PrivateLinkResources;
import com.azure.resourcemanager.mediaservices.models.StreamingEndpoints;
import com.azure.resourcemanager.mediaservices.models.StreamingLocators;
import com.azure.resourcemanager.mediaservices.models.StreamingPolicies;
import com.azure.resourcemanager.mediaservices.models.Tracks;
import com.azure.resourcemanager.mediaservices.models.Transforms;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/** Entry point to MediaServicesManager. This Swagger was generated by the API Framework. */
public final class MediaServicesManager {
private AccountFilters accountFilters;

private Operations operations;

private Mediaservices mediaservices;
Expand All @@ -72,12 +82,16 @@ public final class MediaServicesManager {

private Locations locations;

private AccountFilters accountFilters;

private Assets assets;

private AssetFilters assetFilters;

private Tracks tracks;

private OperationStatuses operationStatuses;

private OperationResults operationResults;

private ContentKeyPolicies contentKeyPolicies;

private Transforms transforms;
Expand Down Expand Up @@ -230,7 +244,7 @@ public MediaServicesManager authenticate(TokenCredential credential, AzureProfil
.append("-")
.append("com.azure.resourcemanager.mediaservices")
.append("/")
.append("1.1.0-beta.2");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand All @@ -253,11 +267,24 @@ public MediaServicesManager authenticate(TokenCredential credential, AzureProfil
List<HttpPipelinePolicy> policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new RequestIdPolicy());
policies
.addAll(
this
.policies
.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
.collect(Collectors.toList()));
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
policies.add(new AddDatePolicy());
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
policies.addAll(this.policies);
policies
.addAll(
this
.policies
.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
.collect(Collectors.toList()));
HttpPolicyProviders.addAfterRetryPolicies(policies);
policies.add(new HttpLoggingPolicy(httpLogOptions));
HttpPipeline httpPipeline =
Expand All @@ -269,6 +296,14 @@ public MediaServicesManager authenticate(TokenCredential credential, AzureProfil
}
}

/** @return Resource collection API of AccountFilters. */
public AccountFilters accountFilters() {
if (this.accountFilters == null) {
this.accountFilters = new AccountFiltersImpl(clientObject.getAccountFilters(), this);
}
return accountFilters;
}

/** @return Resource collection API of Operations. */
public Operations operations() {
if (this.operations == null) {
Expand Down Expand Up @@ -310,14 +345,6 @@ public Locations locations() {
return locations;
}

/** @return Resource collection API of AccountFilters. */
public AccountFilters accountFilters() {
if (this.accountFilters == null) {
this.accountFilters = new AccountFiltersImpl(clientObject.getAccountFilters(), this);
}
return accountFilters;
}

/** @return Resource collection API of Assets. */
public Assets assets() {
if (this.assets == null) {
Expand All @@ -334,6 +361,30 @@ public AssetFilters assetFilters() {
return assetFilters;
}

/** @return Resource collection API of Tracks. */
public Tracks tracks() {
if (this.tracks == null) {
this.tracks = new TracksImpl(clientObject.getTracks(), this);
}
return tracks;
}

/** @return Resource collection API of OperationStatuses. */
public OperationStatuses operationStatuses() {
if (this.operationStatuses == null) {
this.operationStatuses = new OperationStatusesImpl(clientObject.getOperationStatuses(), this);
}
return operationStatuses;
}

/** @return Resource collection API of OperationResults. */
public OperationResults operationResults() {
if (this.operationResults == null) {
this.operationResults = new OperationResultsImpl(clientObject.getOperationResults(), this);
}
return operationResults;
}

/** @return Resource collection API of ContentKeyPolicies. */
public ContentKeyPolicies contentKeyPolicies() {
if (this.contentKeyPolicies == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public interface AccountFiltersClient {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a collection of AccountFilter items.
* @return a collection of AccountFilter items as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<AccountFilterInner> list(String resourceGroupName, String accountName);
Expand All @@ -35,7 +35,7 @@ public interface AccountFiltersClient {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a collection of AccountFilter items.
* @return a collection of AccountFilter items as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<AccountFilterInner> list(String resourceGroupName, String accountName, Context context);
Expand Down Expand Up @@ -64,7 +64,7 @@ public interface AccountFiltersClient {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the details of an Account Filter in the Media Services account.
* @return the details of an Account Filter in the Media Services account along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AccountFilterInner> getWithResponse(
Expand Down Expand Up @@ -97,7 +97,7 @@ AccountFilterInner createOrUpdate(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Account Filter.
* @return an Account Filter along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AccountFilterInner> createOrUpdateWithResponse(
Expand Down Expand Up @@ -130,7 +130,7 @@ Response<AccountFilterInner> createOrUpdateWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response.
* @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<Void> deleteWithResponse(String resourceGroupName, String accountName, String filterName, Context context);
Expand Down Expand Up @@ -162,7 +162,7 @@ AccountFilterInner update(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Account Filter.
* @return an Account Filter along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AccountFilterInner> updateWithResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public interface AssetFiltersClient {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a collection of AssetFilter items.
* @return a collection of AssetFilter items as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<AssetFilterInner> list(String resourceGroupName, String accountName, String assetName);
Expand All @@ -37,7 +37,7 @@ public interface AssetFiltersClient {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a collection of AssetFilter items.
* @return a collection of AssetFilter items as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<AssetFilterInner> list(
Expand Down Expand Up @@ -69,7 +69,7 @@ PagedIterable<AssetFilterInner> list(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the details of an Asset Filter associated with the specified Asset.
* @return the details of an Asset Filter associated with the specified Asset along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AssetFilterInner> getWithResponse(
Expand Down Expand Up @@ -104,7 +104,7 @@ AssetFilterInner createOrUpdate(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Asset Filter.
* @return an Asset Filter along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AssetFilterInner> createOrUpdateWithResponse(
Expand Down Expand Up @@ -140,7 +140,7 @@ Response<AssetFilterInner> createOrUpdateWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response.
* @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<Void> deleteWithResponse(
Expand Down Expand Up @@ -175,7 +175,7 @@ AssetFilterInner update(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an Asset Filter.
* @return an Asset Filter along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AssetFilterInner> updateWithResponse(
Expand Down
Loading