public async Task CanGetNoResultTupleQuery() { var client = new BigfixClient(username, password); var result = await client.Queries.SearchWithGroupedResults("(id of it , name of it) of bes computers whose (name of it equals \"BADNAME\")"); Assert.Empty(result.Tuples); }
public async Task CanGetQuery() { var client = new BigfixClient(username, password); var result = await client.Queries.Search("(values of it) of (results (bes properties (\"IP Address\"), it)) of bes computers"); Assert.NotEmpty(result.AllAnswers); }
public async Task CanReturnSingleValue() { var client = new BigfixClient(username, password); var result = await client.Computers.Get("1131209333"); Assert.Equal("CAES-HWGCQV2-VM", result.Get(ComputerProperty.Name)); }
public async Task CanReturnMultipleValues() { var client = new BigfixClient(username, password); var result = await client.Computers.Get("63725921"); Assert.Equal("172.17.104.160, 169.237.124.0", result.Get(ComputerProperty.SubnetAddress)); }
public async Task CanUseCommonSingleQuery() { var client = new BigfixClient(username, password); var query = client.Queries.Common.Queries.GetWindowsIdentifyingNumberById("1677559868"); var result = await client.Queries.Search(query); Assert.NotEmpty(result.AllAnswers); }
public async Task CanUseCaseInsensitiveGroupedQuery() { var client = new BigfixClient(username, password); var query = client.Queries.Common.GroupedQueries.GetComputerByNameEquals("caes-7TW1H12"); var result = await client.Queries.SearchWithGroupedResults(query); Assert.NotEmpty(result.Tuples); }
public async Task CanGetComplexTupleQuery() { var client = new BigfixClient(username, password); var result = await client.Queries.SearchWithGroupedResults("(id of it, values of results (it, bes property \"Identifying Number - Windows\"), values of results (it, bes property \"MAC Addresses - Windows\")) of bes computers whose (name of it equals \"CAES-7TW1H12\")"); Assert.NotEmpty(result.Tuples); System.Console.WriteLine(result.Tuples[0].Answers.Length); }
public async Task CanThrowNotFound() { var client = new BigfixClient(username, password); try { var result = await client.Computers.Get("999999"); } catch (BigfixApiException ex) { Assert.Equal(HttpStatusCode.NotFound, ex.StatusCode); } }
public async Task CanGetComputer() { var client = new BigfixClient(username, password); var result = await client.Computers.Get("1677559868"); Assert.True(true); var ip = result.Get(ComputerProperty.IPAddress); Assert.False(string.IsNullOrEmpty(ip)); }