Ejemplo n.º 1
0
 public DataBoxEdgeAlert(DataBoxEdgeManagementClient dataBoxManagementClient,
                         string respResourceGroupName, string deviceName)
 {
     this._dataBoxManagementClient = dataBoxManagementClient;
     this.DeviceName        = deviceName;
     this.ResourceGroupName = respResourceGroupName;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets resources by subscription
        /// </summary>
        /// <param name="client"></param>
        /// <param name="continuationToken"></param>
        /// <returns></returns>
        public static IEnumerable <DataBoxEdgeDevice> GetResourcesBySubscription(
            DataBoxEdgeManagementClient client,
            out string continuationToken)
        {
            //Create a databox edge/gateway device
            IPage <DataBoxEdgeDevice> resourceList = client.Devices.ListBySubscription();

            continuationToken = resourceList.NextPageLink;
            return(resourceList);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets next page of shares
        /// </summary>
        /// <param name="client"></param>
        /// <param name="nextLink"></param>
        /// <param name="continuationToken"></param>
        /// <returns>List of shares</returns>
        public static IEnumerable <Share> ListSharesNext(
            DataBoxEdgeManagementClient client,
            string nextLink,
            out string continuationToken)
        {
            IPage <Share> shares = client.Shares.ListByDataBoxEdgeDeviceNext(nextLink);

            continuationToken = shares.NextPageLink;
            return(shares);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Gets next page of bandwidth schedules in device
        /// </summary>
        /// <param name="client"></param>
        /// <param name="nextLink"></param>
        /// <param name="continuationToken"></param>
        /// <returns></returns>
        public static IEnumerable <BandwidthSchedule> ListBandwidthSchedulesNext(
            DataBoxEdgeManagementClient client,
            string nextLink,
            out string continuationToken)
        {
            //Create a databox edge/gateway device
            IPage <BandwidthSchedule> scheduleList = client.BandwidthSchedules.ListByDataBoxEdgeDeviceNext(nextLink);

            continuationToken = scheduleList.NextPageLink;
            return(scheduleList);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Gets next page of users
        /// </summary>
        /// <param name="client"></param>
        /// <param name="nextLink"></param>
        /// <param name="continuationToken"></param>
        /// <returns></returns>
        public static IEnumerable <User> ListUsersNext(
            DataBoxEdgeManagementClient client,
            string nextLink,
            out string continuationToken)
        {
            //Create a databox edge/gateway device
            IPage <User> userList = client.Users.ListByDataBoxEdgeDeviceNext(nextLink);

            continuationToken = userList.NextPageLink;
            return(userList);
        }
        /// <summary>
        /// Gets storage accounts in the device
        /// </summary>
        /// <param name="client"></param>
        /// <param name="deviceName"></param>
        /// <param name="resourceGroupName"></param>
        /// <param name="continuationToken"></param>
        /// <returns>List of shares</returns>
        public static IEnumerable <StorageAccount> ListStorageAccounts(
            DataBoxEdgeManagementClient client,
            string deviceName,
            string resourceGroupName,
            out string continuationToken)
        {
            IPage <StorageAccount> storageAccounts = client.StorageAccounts.ListByDataBoxEdgeDevice(deviceName, resourceGroupName);

            continuationToken = storageAccounts.NextPageLink;
            return(storageAccounts);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Gets next page of alerts in device
        /// </summary>
        /// <param name="client"></param>
        /// <param name="nextLink"></param>
        /// <param name="continuationToken"></param>
        /// <returns></returns>
        public static IEnumerable <Alert> ListAlertsNext(
            DataBoxEdgeManagementClient client,
            string nextLink,
            out string continuationToken)
        {
            // Gets the alert list
            IPage <Alert> alertList = client.Alerts.ListByDataBoxEdgeDeviceNext(nextLink);

            continuationToken = alertList.NextPageLink;
            return(alertList);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Gets next page of storage account credentials
        /// </summary>
        /// <param name="client"></param>
        /// <param name="nextLink"></param>
        /// <param name="continuationToken"></param>
        /// <returns></returns>
        public static IEnumerable <StorageAccountCredential> ListStorageAccountCredentialsNext(
            DataBoxEdgeManagementClient client,
            string nextLink,
            out string continuationToken)
        {
            //Create a databox edge/gateway device
            IPage <StorageAccountCredential> sacList = client.StorageAccountCredentials.ListByDataBoxEdgeDeviceNext(nextLink);

            continuationToken = sacList.NextPageLink;
            return(sacList);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Gets the bandwidth schedules in device
        /// </summary>
        /// <param name="client"></param>
        /// <param name="deviceName"></param>
        /// <param name="resourceGroupName"></param>
        /// <param name="continuationToken"></param>
        /// <returns></returns>
        public static IEnumerable <BandwidthSchedule> ListBandwidthSchedules(
            DataBoxEdgeManagementClient client,
            string deviceName,
            string resourceGroupName,
            out string continuationToken)
        {
            //Create a databox edge/gateway device
            IPage <BandwidthSchedule> scheduleList = client.BandwidthSchedules.ListByDataBoxEdgeDevice(deviceName, resourceGroupName);

            continuationToken = scheduleList.NextPageLink;
            return(scheduleList);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Gets shares in the device
        /// </summary>
        /// <param name="client"></param>
        /// <param name="deviceName"></param>
        /// <param name="resourceGroupName"></param>
        /// <param name="continuationToken"></param>
        /// <returns>List of shares</returns>
        public static IEnumerable <Share> ListShares(
            DataBoxEdgeManagementClient client,
            string deviceName,
            string resourceGroupName,
            out string continuationToken)
        {
            //Create a databox edge/gateway device
            IPage <Share> shares = client.Shares.ListByDataBoxEdgeDevice(deviceName, resourceGroupName);

            continuationToken = shares.NextPageLink;
            return(shares);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Gets users in the device
        /// </summary>
        /// <param name="client"></param>
        /// <param name="deviceName"></param>
        /// <param name="resourceGroupName"></param>
        /// <param name="continuationToken"></param>
        /// <returns></returns>
        public static IEnumerable <User> ListUsers(
            DataBoxEdgeManagementClient client,
            string deviceName,
            string resourceGroupName,
            out string continuationToken)
        {
            //Create a databox edge/gateway device
            IPage <User> userList = client.Users.ListByDataBoxEdgeDevice(deviceName, resourceGroupName);

            continuationToken = userList.NextPageLink;
            return(userList);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Gets containers in the storage account
        /// </summary>
        /// <param name="client"></param>
        /// <param name="deviceName"></param>
        /// <param name="resourceGroupName"></param>
        /// <param name="continuationToken"></param>
        /// <returns>List of shares</returns>
        public static IEnumerable <Container> ListContainers(
            DataBoxEdgeManagementClient client,
            string deviceName,
            string storageAccountName,
            string resourceGroupName,
            out string continuationToken)
        {
            IPage <Container> containers = client.Containers.ListByStorageAccount(deviceName, storageAccountName, resourceGroupName);

            continuationToken = containers.NextPageLink;
            return(containers);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Creates or updates given edge resource
        /// </summary>
        /// <param name="device"></param>
        /// <param name="deviceName"></param>
        /// <param name="client"></param>
        /// <param name="resourceGroupName"></param>
        /// <returns></returns>
        public static DataBoxEdgeDevice CreateOrUpdate(
            this DataBoxEdgeDevice device,
            string deviceName,
            DataBoxEdgeManagementClient client,
            string resourceGroupName)
        {
            //Create a databox edge/gateway device
            client.Devices.CreateOrUpdate(deviceName,
                                          device,
                                          resourceGroupName
                                          );

            //Returns a databox edge/gateway device
            return(client.Devices.Get(deviceName, resourceGroupName));
        }
        /// <summary>
        /// Initializes common properties used across tests
        /// </summary>
        public DataBoxEdgeTestBase(ITestOutputHelper testOutputHelper)
        {
            // Getting test method name here as we are not initializing context from each method
            var   helper = (TestOutputHelper)testOutputHelper;
            ITest test   = (ITest)helper.GetType().GetField("test", BindingFlags.NonPublic | BindingFlags.Instance)
                           .GetValue(helper);

            this.Context = MockContext.Start(this.GetType(), test.TestCase.TestMethod.Method.Name);

            this.Client = this.Context.GetServiceClient <DataBoxEdgeManagementClient>();
            var testEnv = TestEnvironmentFactory.GetTestEnvironment();

            this.SubscriptionId = testEnv.SubscriptionId;

            if (HttpMockServer.Mode == HttpRecorderMode.Record)
            {
                HttpMockServer.Variables[SubIdKey] = testEnv.SubscriptionId;
            }
        }