use of software.amazon.awssdk.services.ssm.SsmClient in project aws-doc-sdk-examples by awsdocs.
the class CreateOpsItem method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <title> <source> <category> <severity>\n\n" + "Where:\n" + " title - the OpsItem title.\n" + " source - the origin of the OpsItem, such as Amazon EC2 or AWS Systems Manager.\n" + " category - a category to assign to an OpsItem.\n" + " severity - a severity to assign to an OpsItem.\n";
if (args.length != 4) {
System.out.println(USAGE);
System.exit(1);
}
String title = args[0];
String source = args[1];
String category = args[2];
String severity = args[3];
Region region = Region.US_EAST_1;
SsmClient ssmClient = SsmClient.builder().region(region).build();
System.out.println("The Id of the OpsItem is " + createNewOpsItem(ssmClient, title, source, category, severity));
ssmClient.close();
}
use of software.amazon.awssdk.services.ssm.SsmClient in project aws-doc-sdk-examples by awsdocs.
the class DescribeParameters method main.
public static void main(String[] args) {
Region region = Region.US_EAST_1;
SsmClient ssmClient = SsmClient.builder().region(region).build();
describeParams(ssmClient);
ssmClient.close();
}
use of software.amazon.awssdk.services.ssm.SsmClient in project aws-doc-sdk-examples by awsdocs.
the class GetOpsItem method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <opsID>\n\n" + "Where:\n" + " opsID - the Ops item ID value.\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String opsID = args[0];
Region region = Region.US_EAST_1;
SsmClient ssmClient = SsmClient.builder().region(region).build();
getOpsItem(ssmClient, opsID);
ssmClient.close();
}
use of software.amazon.awssdk.services.ssm.SsmClient in project aws-doc-sdk-examples by awsdocs.
the class ResolveOpsItem method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <opsID>\n\n" + "Where:\n" + " opsID - the Ops item ID value.\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
/* Read the name from command args */
String opsID = args[0];
Region region = Region.US_EAST_1;
SsmClient ssmClient = SsmClient.builder().region(region).build();
setOpsItemStatus(ssmClient, opsID);
}
use of software.amazon.awssdk.services.ssm.SsmClient in project athenz by yahoo.
the class MockAWSParameterStoreSyncer method initClient.
@Override
SsmClient initClient() {
Date now = new Date();
SsmClient mock = mock(SsmClient.class);
when(mock.describeParameters(any(DescribeParametersRequest.class))).thenReturn(DescribeParametersResponse.builder().parameters(ParameterMetadata.builder().name("param1").lastModifiedDate(now.toInstant()).build(), ParameterMetadata.builder().name("param2").lastModifiedDate(now.toInstant()).build(), ParameterMetadata.builder().name("param4").lastModifiedDate(now.toInstant()).build()).build());
when(mock.getParameter(parameterRequest("param1"))).thenReturn(GetParameterResponse.builder().parameter(Parameter.builder().name("param1").value("param1-val").lastModifiedDate(now.toInstant()).build()).build());
when(mock.getParameter(parameterRequest("param2"))).thenReturn(GetParameterResponse.builder().parameter(Parameter.builder().name("param2").value("param2-val").lastModifiedDate(now.toInstant()).build()).build());
when(mock.getParameter(parameterRequest("param4"))).thenThrow(new ResourceException(INTERNAL_SERVER_ERROR));
return mock;
}
Aggregations