Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMS] Removing deprecated variable 'identifier_uri' from create sp method #20249

Closed
wants to merge 26 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1c998bd
reverting changes for ASK key
hivyas Mar 16, 2020
67c7e04
reverting changes
hivyas Mar 16, 2020
44e755f
updated ams module to dec 2019 swagger
hivyas Apr 24, 2020
dc0e466
added test cases
hivyas Apr 28, 2020
eaf7f59
added ability to update offlinerental
hivyas Apr 29, 2020
0885ea9
fixed audio language bug
hivyas Apr 30, 2020
6fbab37
Merge branch 'dev' into dev
hivyas May 1, 2020
2cd98d7
fixing requirements*.txt files
hivyas May 7, 2020
3b31409
Fixed transforms test case and national bug
hivyas May 7, 2020
b398868
updated content key policy tests
hivyas May 8, 2020
12fbf09
fixed style and lint errors
hivyas May 8, 2020
20c3944
Merge remote-tracking branch 'upstream/dev' into dev
hivyas Jun 11, 2020
91528ee
made az ams sp create idempotent
hivyas Jul 20, 2020
9297770
fixed typo and updated help text
hivyas Jul 21, 2020
d0e7756
Merge remote-tracking branch 'upstream/dev' into dev
hivyas Aug 11, 2020
c46c527
Merge remote-tracking branch 'upstream/dev' into dev
hivyas Sep 22, 2020
b70c052
Merge remote-tracking branch 'upstream/dev' into dev
hivyas Oct 26, 2020
b393193
Merge remote-tracking branch 'upstream/dev' into dev
hivyas Nov 18, 2020
56ffb7e
Merge branch 'dev' of https://github.com/Azure/azure-cli into dev
hivyas Jun 9, 2021
bcd0727
Merge remote-tracking branch 'upstream/dev' into dev
hivyas Jul 28, 2021
1950fe3
Merge branch 'dev' of https://github.com/Azure/azure-cli into dev
hivyas Aug 13, 2021
87b6066
Merge branch 'dev' of https://github.com/Azure/azure-cli into dev
hivyas Sep 23, 2021
fc558d2
Merge remote-tracking branch 'upstream/main' into dev
hivyas Nov 3, 2021
7485ed0
Merge branch 'dev' of https://github.com/Azure/azure-cli into dev
hivyas Nov 3, 2021
407745b
Merge branch 'dev' of https://github.com/Azure/azure-cli into dev
hivyas Nov 9, 2021
c6ee439
removing deprecated variable
hivyas Nov 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed style and lint errors
hivyas committed May 8, 2020
commit 12fbf09fb61b99224ed07c170a6142b08e8adda9
8 changes: 7 additions & 1 deletion src/azure-cli/azure/cli/command_modules/ams/_completers.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,8 @@
get_default_streaming_policies, get_token_types,
get_rentalandlease_types, get_tokens,
get_allowed_languages_for_preset,
get_protocols, get_encoding_types)
get_protocols, get_encoding_types,
get_allowed_resolutions)

from azure.mgmt.media.models import EncoderNamedPreset

@@ -62,6 +63,11 @@ def get_allowed_languages_for_preset_completion_list():
return languages


def get_allowed_resolutions_completion_list():
resolutions = get_allowed_resolutions()
return resolutions


def get_mru_type_completion_list():
return ['S1', 'S2', 'S3']

5 changes: 4 additions & 1 deletion src/azure-cli/azure/cli/command_modules/ams/_params.py
Original file line number Diff line number Diff line change
@@ -23,7 +23,8 @@
get_fairplay_rentalandlease_completion_list,
get_token_completion_list,
get_mru_type_completion_list,
get_encoding_types_list)
get_encoding_types_list,
get_allowed_resolutions_completion_list)

from azure.cli.command_modules.ams._validators import (validate_storage_account_id,
datetime_format,
@@ -99,6 +100,8 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
c.argument('insights_to_extract', arg_group='Video Analyzer', arg_type=get_enum_type(InsightsType), help='The type of insights to be extracted. If not set then the type will be selected based on the content type. If the content is audio only then only audio insights will be extracted and if it is video only video insights will be extracted.')
c.argument('audio_language', arg_group='Audio/Video Analyzer', help='The language for the audio payload in the input using the BCP-47 format of \"language tag-region\" (e.g: en-US). If not specified, automatic language detection would be employed. This feature currently supports English, Chinese, French, German, Italian, Japanese, Spanish, Russian, and Portuguese. The automatic detection works best with audio recordings with clearly discernable speech. If automatic detection fails to find the language, transcription would fallback to English. Allowed values: {}.'
.format(", ".join(get_allowed_languages_for_preset_completion_list())))
c.argument('resolution', arg_group='Face Detector', help='Specifies the maximum resolution at which your video is analyzed. The default behavior is "SourceResolution," which will keep the input video at its original resolution when analyzed. Using StandardDefinition will resize input videos to standard definition while preserving the appropriate aspect ratio. It will only resize if the video is of higher resolution. For example, a 1920x1080 input would be scaled to 640x360 before processing. Switching to "StandardDefinition" will reduce the time it takes to process high resolution video. It may also reduce the cost of using this component (see https://azure.microsoft.com/en-us/pricing/details/media-services/#analytics for details). However, faces that end up being too small in the resized video may not be detected. Allowed values: {}.'
.format(", ".join(get_allowed_resolutions_completion_list())))
c.argument('relative_priority', arg_type=get_enum_type(Priority), help='Sets the relative priority of the transform outputs within a transform. This sets the priority that the service uses for processing TransformOutputs. The default priority is Normal.')
c.argument('on_error', arg_type=get_enum_type(OnErrorType), help="A Transform can define more than one output. This property defines what the service should do when one output fails - either continue to produce other outputs, or, stop the other outputs. The overall Job state will not reflect failures of outputs that are specified with 'ContinueJob'. The default is 'StopProcessingJob'.")
c.argument('description', help='The description of the transform.')
4 changes: 4 additions & 0 deletions src/azure-cli/azure/cli/command_modules/ams/_sdk_utils.py
Original file line number Diff line number Diff line change
@@ -46,6 +46,10 @@ def get_allowed_languages_for_preset():
'pt-BR', 'zh-CN', 'de-DE', 'ar-EG', 'ru-RU', 'hi-IN']


def get_allowed_resolutions():
return ['StandardDefinition', 'SourceResolution']


def get_media_namespace():
return 'Microsoft.Media'

Original file line number Diff line number Diff line change
@@ -24,8 +24,9 @@
ContentKeyPolicyRsaTokenKey, ContentKeyPolicyX509CertificateTokenKey,
ContentKeyPolicyTokenRestriction, ContentKeyPolicyTokenClaim,
ContentKeyPolicyWidevineConfiguration, ContentKeyPolicyFairPlayConfiguration,
ContentKeyPolicyFairPlayOfflineRentalConfiguration, ContentKeyPolicyPlayReadyConfiguration,
ContentKeyPolicyPlayReadyLicense, ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader,
ContentKeyPolicyFairPlayOfflineRentalConfiguration,
ContentKeyPolicyPlayReadyConfiguration, ContentKeyPolicyPlayReadyLicense,
ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader,
ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier,
ContentKeyPolicyPlayReadyPlayRight,
ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction)
@@ -251,7 +252,7 @@ def _generate_content_key_policy_option(policy_option_name, clear_key_configurat
alt_symmetric_token_keys, alt_rsa_token_keys, alt_x509_token_keys,
token_claims, token_type, open_id_connect_discovery_document,
widevine_template, ask, fair_play_pfx_password, fair_play_pfx,
rental_and_lease_key_type, rental_duration, play_ready_template,
rental_and_lease_key_type, rental_duration, play_ready_template,
fp_playback_duration_seconds, fp_storage_duration_seconds):

configuration = None
@@ -262,7 +263,7 @@ def _generate_content_key_policy_option(policy_option_name, clear_key_configurat

valid_fairplay_configuration = _valid_fairplay_configuration(ask, fair_play_pfx_password,
fair_play_pfx, rental_and_lease_key_type,
rental_duration, fp_playback_duration_seconds, fp_storage_duration_seconds)
rental_duration)

valid_playready_configuration = _valid_playready_configuration(play_ready_template)

@@ -282,11 +283,13 @@ def _generate_content_key_policy_option(policy_option_name, clear_key_configurat
if valid_fairplay_configuration:
offline_configuration = None
if rental_and_lease_key_type == 'DualExpiry':
offline_configuration = ContentKeyPolicyFairPlayOfflineRentalConfiguration(playback_duration_seconds=fp_playback_duration_seconds, storage_duration_seconds=fp_storage_duration_seconds)
if (ask is not None):
ask=bytearray.fromhex(ask)
offline_configuration = ContentKeyPolicyFairPlayOfflineRentalConfiguration(
playback_duration_seconds=fp_playback_duration_seconds,
storage_duration_seconds=fp_storage_duration_seconds)
if ask is not None:
ask = bytearray.fromhex(ask)
configuration = ContentKeyPolicyFairPlayConfiguration(
ask=ask,
ask=ask,
fair_play_pfx_password=fair_play_pfx_password,
fair_play_pfx=_b64_to_str(_read_binary(fair_play_pfx)).decode('ascii'),
rental_and_lease_key_type=rental_and_lease_key_type,
@@ -483,9 +486,10 @@ def _valid_token_restriction(token_key, token_key_type, token_type, issuer, audi


def _valid_fairplay_configuration(ask, fair_play_pfx_password, fair_play_pfx,
rental_and_lease_key_type, rental_duration, fp_playback_duration_seconds, fp_storage_duration_seconds):
rental_and_lease_key_type, rental_duration):
return any([ask, fair_play_pfx_password, fair_play_pfx, rental_and_lease_key_type, rental_duration])


def _valid_playready_configuration(play_ready_template):
if play_ready_template is None:
return False
Original file line number Diff line number Diff line change
@@ -76,6 +76,7 @@ def validate_arguments(preset, insights_to_extract, audio_language, resolution):
if resolution and preset != 'FaceDetector':
raise CLIError("resolution argument only works with FaceDetector preset type.")


def remove_transform_output(client, account_name, resource_group_name, transform_name, output_index):
transform = client.get(resource_group_name, account_name, transform_name)