Пример #1
0
        public override void ExecuteCmdlet()
        {
            try
            {
                // Get a Namespace List Keys for the specified AuthorizationRule
                if (ParameterSetName.Equals(NamespaceAuthoRuleParameterSet))
                {
                    PSListKeysAttributes keys = Client.GetNamespaceListKeys(ResourceGroupName, Namespace, Name);
                    WriteObject(keys, true);
                }

                // Get a EventHub List Keys for the specified AuthorizationRule
                if (ParameterSetName.Equals(EventhubAuthoRuleParameterSet))
                {
                    PSListKeysAttributes keys = Client.GetEventHubListKeys(ResourceGroupName, Namespace, EventHub, Name);
                    WriteObject(keys, true);
                }

                // Get Alias List Keys for the specified AuthorizationRule
                if (ParameterSetName.Equals(AliasAuthoRuleParameterSet))
                {
                    PSListKeysAttributes keys = Client.GetAliasListKeys(ResourceGroupName, Namespace, AliasName, Name);
                    WriteObject(keys, true);
                }
            }
            catch (Management.EventHub.Models.ErrorResponseException ex)
            {
                WriteError(Eventhub.EventHubsClient.WriteErrorforBadrequest(ex));
            }
        }
Пример #2
0
        public override void ExecuteCmdlet()
        {
            // Get a Namespace List Keys for the specified AuthorizationRule
            if (ParameterSetName.Equals(NamespaceAuthoRuleParameterSet))
            {
                PSListKeysAttributes keys = Client.GetNamespaceListKeys(ResourceGroupName, Namespace, Name);
                WriteObject(keys, true);
            }

            // Get a Queue List Keys for the specified AuthorizationRule
            if (ParameterSetName.Equals(QueueAuthoRuleParameterSet))
            {
                PSListKeysAttributes keys = Client.GetQueueKey(ResourceGroupName, Namespace, Queue, Name);
                WriteObject(keys, true);
            }

            // Get a Topic List Keys for the specified AuthorizationRule
            if (ParameterSetName.Equals(TopicAuthoRuleParameterSet))
            {
                PSListKeysAttributes keys = Client.GetTopicKey(ResourceGroupName, Namespace, Topic, Name);
                WriteObject(keys, true);
            }

            // Get Alias List Keys for the specified AuthorizationRule
            if (ParameterSetName.Equals(AliasAuthoRuleParameterSet))
            {
                PSListKeysAttributes keys = Client.GetAliasListKeys(ResourceGroupName, Namespace, AliasName, Name);
                WriteObject(keys, true);
            }
        }
Пример #3
0
        public override void ExecuteCmdlet()
        {
            // Get a Namespace List Keys for the specified AuthorizationRule
            if (ParameterSetName.Equals(NamespaceAuthoRuleParameterSet))
            {
                PSListKeysAttributes keys = Client.GetNamespaceListKeys(ResourceGroupName, Namespace, Name);
                WriteObject(keys, true);
            }

            // Get a EventHub List Keys for the specified AuthorizationRule
            if (ParameterSetName.Equals(EventhubAuthoRuleParameterSet))
            {
                PSListKeysAttributes keys = Client.GetEventHubListKeys(ResourceGroupName, Namespace, EventHub, Name);
                WriteObject(keys, true);
            }

            // Get Alias List Keys for the specified AuthorizationRule
            if (ParameterSetName.Equals(AliasAuthoRuleParameterSet))
            {
                PSListKeysAttributes keys = Client.GetAliasListKeys(ResourceGroupName, Namespace, AliasName, Name);
                WriteObject(keys, true);
            }
        }
Пример #4
0
        public override void ExecuteCmdlet()
        {
            try
            {
                // Get a Namespace List Keys for the specified AuthorizationRule
                if (ParameterSetName.Equals(NamespaceAuthoRuleParameterSet))
                {
                    PSListKeysAttributes keys = Client.GetNamespaceListKeys(ResourceGroupName, Namespace, Name);
                    WriteObject(keys, true);
                }

                // Get a Queue List Keys for the specified AuthorizationRule
                if (ParameterSetName.Equals(QueueAuthoRuleParameterSet))
                {
                    PSListKeysAttributes keys = Client.GetQueueKey(ResourceGroupName, Namespace, Queue, Name);
                    WriteObject(keys, true);
                }

                // Get a Topic List Keys for the specified AuthorizationRule
                if (ParameterSetName.Equals(TopicAuthoRuleParameterSet))
                {
                    PSListKeysAttributes keys = Client.GetTopicKey(ResourceGroupName, Namespace, Topic, Name);
                    WriteObject(keys, true);
                }

                // Get Alias List Keys for the specified AuthorizationRule
                if (ParameterSetName.Equals(AliasAuthoRuleParameterSet))
                {
                    PSListKeysAttributes keys = Client.GetAliasListKeys(ResourceGroupName, Namespace, AliasName, Name);
                    WriteObject(keys, true);
                }
            }
            catch (ErrorResponseException ex)
            {
                WriteError(ServiceBusClient.WriteErrorforBadrequest(ex));
            }
        }