Exemplo n.º 1
0
        public async void GetConfigSourceAndAssociatedDevices()
        {
            var configSource = await PortalClient.GetByNameAsync <ConfigSource>("Cisco_IOS").ConfigureAwait(false);

            Assert.NotNull(configSource);

            // Refetch and check
            var refetch = await PortalClient.GetAsync <ConfigSource>(configSource.Id).ConfigureAwait(false);

            Assert.Equal("Cisco_IOS", refetch.Name);
            Assert.Equal(configSource.DisplayName, refetch.DisplayName);

            // Get associated devices
            var devices = await PortalClient.GetConfigSourceDevicesPageAsync(configSource.Id, new Filter <DeviceConfigSource> {
                Skip = 0, Take = 300
            }).ConfigureAwait(false);

            Assert.NotEmpty(devices.Items);
        }