public override void ExecuteCmdlet()
        {
            ConsumerGroupAttributes consumerGroup = new ConsumerGroupAttributes();

            if (!string.IsNullOrEmpty(UserMetadata))
            {
                consumerGroup.UserMetadata = UserMetadata;
            }

            if (ShouldProcess(target: Name, action: string.Format(Resources.CreateConsumerGroup, Name, EventHub)))
            {
                WriteObject(Client.CreateOrUpdateConsumerGroup(ResourceGroupName, Namespace, EventHub, Name, consumerGroup));
            }
        }
Exemplo n.º 2
0
 public override void ExecuteCmdlet()
 {
     if (!string.IsNullOrEmpty(Name))
     {
         // Get a ConsumnerGroup
         ConsumerGroupAttributes consumergroupAttributesList = Client.GetConsumerGroup(ResourceGroupName, Namespace, EventHub, Name);
         WriteObject(consumergroupAttributesList);
     }
     else
     {
         // Get all ConsumnerGroups
         IEnumerable <ConsumerGroupAttributes> consumergroupAttributesList = Client.ListAllConsumerGroup(ResourceGroupName, Namespace, EventHub);
         WriteObject(consumergroupAttributesList.ToList(), true);
     }
 }
        public override void ExecuteCmdlet()
        {
            ConsumerGroupAttributes consumerGroup = new ConsumerGroupAttributes();

            EventHubAttributes getEventHub = Client.GetEventHub(ResourceGroupName, NamespaceName, EventHubName);

            consumerGroup.Name     = ConsumerGroupName;
            consumerGroup.Location = getEventHub.Location;

            if (!string.IsNullOrEmpty(UserMetadata))
            {
                consumerGroup.UserMetadata = UserMetadata;
            }

            if (ShouldProcess(target: consumerGroup.Name, action: string.Format("Updating ConsumerGroup: {0} for the Eventhub:{1}", consumerGroup.Name, EventHubName)))
            {
                WriteObject(Client.CreateOrUpdateConsumerGroup(ResourceGroupName, NamespaceName, EventHubName, consumerGroup.Name, consumerGroup));
            }
        }
        public override void ExecuteCmdlet()
        {
            ConsumerGroupAttributes consumerGroup = new ConsumerGroupAttributes();

            consumerGroup.Name = ConsumerGroupName;
            var getnamespace = Client.GetNamespace(ResourceGroupName, NamespaceName);

            consumerGroup.Location = getnamespace.Location;

            if (!string.IsNullOrEmpty(UserMetadata))
            {
                consumerGroup.UserMetadata = UserMetadata;
            }

            if (ShouldProcess(target: consumerGroup.Name, action: string.Format("Adding a new Consumer Group {0} under Eventhub {1}", consumerGroup.Name, EventHubName)))
            {
                WriteObject(Client.CreateOrUpdateConsumerGroup(ResourceGroupName, NamespaceName, EventHubName, consumerGroup.Name, consumerGroup));
            }
        }
Exemplo n.º 5
0
        public ConsumerGroupAttributes CreateOrUpdateConsumerGroup(string resourceGroupName, string namespaceName, string eventHubName, string consumerGroupName, ConsumerGroupAttributes parameter)
        {
            var Parameter1 = new ConsumerGroupCreateOrUpdateParameters()
            {
                Name         = parameter.Name,
                Location     = parameter.Location,
                CreatedAt    = parameter.CreatedAt,
                UpdatedAt    = parameter.UpdatedAt,
                EventHubPath = parameter.EventHubPath,
                UserMetadata = parameter.UserMetadata
            };
            var response = Client.ConsumerGroups.CreateOrUpdate(resourceGroupName, namespaceName, eventHubName, Parameter1.Name, Parameter1);

            return(new ConsumerGroupAttributes(response));
        }
Exemplo n.º 6
0
        public ConsumerGroupAttributes CreateOrUpdateConsumerGroup(string resourceGroupName, string namespaceName, string eventHubName, string consumerGroupName, ConsumerGroupAttributes parameter)
        {
            var Parameter1 = new ConsumerGroup()
            {
                UserMetadata = parameter.UserMetadata
            };
            var response = Client.ConsumerGroups.CreateOrUpdate(resourceGroupName, namespaceName, eventHubName, consumerGroupName, Parameter1);

            return(new ConsumerGroupAttributes(response));
        }