本文整理了Java中com.amazonaws.Request.setHttpMethod
方法的一些代码示例,展示了Request.setHttpMethod
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.setHttpMethod
方法的具体详情如下:
包路径:com.amazonaws.Request
类名称:Request
方法名:setHttpMethod
[英]Sets the HTTP method (GET, POST, etc) to use when sending this request.
[中]设置发送此请求时要使用的HTTP方法(GET、POST等)。
代码示例来源:origin: aws/aws-sdk-java
public Request<TerminateInstancesRequest> marshall(TerminateInstancesRequest terminateInstancesRequest) {
if (terminateInstancesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<TerminateInstancesRequest> request = new DefaultRequest<TerminateInstancesRequest>(terminateInstancesRequest, "AmazonEC2");
request.addParameter("Action", "TerminateInstances");
request.addParameter("Version", "2016-11-15");
request.setHttpMethod(HttpMethodName.POST);
com.amazonaws.internal.SdkInternalList<String> terminateInstancesRequestInstanceIdsList = (com.amazonaws.internal.SdkInternalList<String>) terminateInstancesRequest
.getInstanceIds();
if (!terminateInstancesRequestInstanceIdsList.isEmpty() || !terminateInstancesRequestInstanceIdsList.isAutoConstruct()) {
int instanceIdsListIndex = 1;
for (String terminateInstancesRequestInstanceIdsListValue : terminateInstancesRequestInstanceIdsList) {
if (terminateInstancesRequestInstanceIdsListValue != null) {
request.addParameter("InstanceId." + instanceIdsListIndex, StringUtils.fromString(terminateInstancesRequestInstanceIdsListValue));
}
instanceIdsListIndex++;
}
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<DeleteFlowLogsRequest> marshall(DeleteFlowLogsRequest deleteFlowLogsRequest) {
if (deleteFlowLogsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<DeleteFlowLogsRequest> request = new DefaultRequest<DeleteFlowLogsRequest>(deleteFlowLogsRequest, "AmazonEC2");
request.addParameter("Action", "DeleteFlowLogs");
request.addParameter("Version", "2016-11-15");
request.setHttpMethod(HttpMethodName.POST);
com.amazonaws.internal.SdkInternalList<String> deleteFlowLogsRequestFlowLogIdsList = (com.amazonaws.internal.SdkInternalList<String>) deleteFlowLogsRequest
.getFlowLogIds();
if (!deleteFlowLogsRequestFlowLogIdsList.isEmpty() || !deleteFlowLogsRequestFlowLogIdsList.isAutoConstruct()) {
int flowLogIdsListIndex = 1;
for (String deleteFlowLogsRequestFlowLogIdsListValue : deleteFlowLogsRequestFlowLogIdsList) {
if (deleteFlowLogsRequestFlowLogIdsListValue != null) {
request.addParameter("FlowLogId." + flowLogIdsListIndex, StringUtils.fromString(deleteFlowLogsRequestFlowLogIdsListValue));
}
flowLogIdsListIndex++;
}
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<UnmonitorInstancesRequest> marshall(UnmonitorInstancesRequest unmonitorInstancesRequest) {
if (unmonitorInstancesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<UnmonitorInstancesRequest> request = new DefaultRequest<UnmonitorInstancesRequest>(unmonitorInstancesRequest, "AmazonEC2");
request.addParameter("Action", "UnmonitorInstances");
request.addParameter("Version", "2016-11-15");
request.setHttpMethod(HttpMethodName.POST);
com.amazonaws.internal.SdkInternalList<String> unmonitorInstancesRequestInstanceIdsList = (com.amazonaws.internal.SdkInternalList<String>) unmonitorInstancesRequest
.getInstanceIds();
if (!unmonitorInstancesRequestInstanceIdsList.isEmpty() || !unmonitorInstancesRequestInstanceIdsList.isAutoConstruct()) {
int instanceIdsListIndex = 1;
for (String unmonitorInstancesRequestInstanceIdsListValue : unmonitorInstancesRequestInstanceIdsList) {
if (unmonitorInstancesRequestInstanceIdsListValue != null) {
request.addParameter("InstanceId." + instanceIdsListIndex, StringUtils.fromString(unmonitorInstancesRequestInstanceIdsListValue));
}
instanceIdsListIndex++;
}
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<RebootInstancesRequest> marshall(RebootInstancesRequest rebootInstancesRequest) {
if (rebootInstancesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<RebootInstancesRequest> request = new DefaultRequest<RebootInstancesRequest>(rebootInstancesRequest, "AmazonEC2");
request.addParameter("Action", "RebootInstances");
request.addParameter("Version", "2016-11-15");
request.setHttpMethod(HttpMethodName.POST);
com.amazonaws.internal.SdkInternalList<String> rebootInstancesRequestInstanceIdsList = (com.amazonaws.internal.SdkInternalList<String>) rebootInstancesRequest
.getInstanceIds();
if (!rebootInstancesRequestInstanceIdsList.isEmpty() || !rebootInstancesRequestInstanceIdsList.isAutoConstruct()) {
int instanceIdsListIndex = 1;
for (String rebootInstancesRequestInstanceIdsListValue : rebootInstancesRequestInstanceIdsList) {
if (rebootInstancesRequestInstanceIdsListValue != null) {
request.addParameter("InstanceId." + instanceIdsListIndex, StringUtils.fromString(rebootInstancesRequestInstanceIdsListValue));
}
instanceIdsListIndex++;
}
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<ReleaseHostsRequest> marshall(ReleaseHostsRequest releaseHostsRequest) {
if (releaseHostsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<ReleaseHostsRequest> request = new DefaultRequest<ReleaseHostsRequest>(releaseHostsRequest, "AmazonEC2");
request.addParameter("Action", "ReleaseHosts");
request.addParameter("Version", "2016-11-15");
request.setHttpMethod(HttpMethodName.POST);
com.amazonaws.internal.SdkInternalList<String> releaseHostsRequestHostIdsList = (com.amazonaws.internal.SdkInternalList<String>) releaseHostsRequest
.getHostIds();
if (!releaseHostsRequestHostIdsList.isEmpty() || !releaseHostsRequestHostIdsList.isAutoConstruct()) {
int hostIdsListIndex = 1;
for (String releaseHostsRequestHostIdsListValue : releaseHostsRequestHostIdsList) {
if (releaseHostsRequestHostIdsListValue != null) {
request.addParameter("HostId." + hostIdsListIndex, StringUtils.fromString(releaseHostsRequestHostIdsListValue));
}
hostIdsListIndex++;
}
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<DescribeAccountAttributesRequest> marshall(DescribeAccountAttributesRequest describeAccountAttributesRequest) {
if (describeAccountAttributesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<DescribeAccountAttributesRequest> request = new DefaultRequest<DescribeAccountAttributesRequest>(describeAccountAttributesRequest, "AmazonEC2");
request.addParameter("Action", "DescribeAccountAttributes");
request.addParameter("Version", "2016-11-15");
request.setHttpMethod(HttpMethodName.POST);
com.amazonaws.internal.SdkInternalList<String> describeAccountAttributesRequestAttributeNamesList = (com.amazonaws.internal.SdkInternalList<String>) describeAccountAttributesRequest
.getAttributeNames();
if (!describeAccountAttributesRequestAttributeNamesList.isEmpty() || !describeAccountAttributesRequestAttributeNamesList.isAutoConstruct()) {
int attributeNamesListIndex = 1;
for (String describeAccountAttributesRequestAttributeNamesListValue : describeAccountAttributesRequestAttributeNamesList) {
if (describeAccountAttributesRequestAttributeNamesListValue != null) {
request.addParameter("AttributeName." + attributeNamesListIndex,
StringUtils.fromString(describeAccountAttributesRequestAttributeNamesListValue));
}
attributeNamesListIndex++;
}
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<DescribeExportTasksRequest> marshall(DescribeExportTasksRequest describeExportTasksRequest) {
if (describeExportTasksRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<DescribeExportTasksRequest> request = new DefaultRequest<DescribeExportTasksRequest>(describeExportTasksRequest, "AmazonEC2");
request.addParameter("Action", "DescribeExportTasks");
request.addParameter("Version", "2016-11-15");
request.setHttpMethod(HttpMethodName.POST);
com.amazonaws.internal.SdkInternalList<String> describeExportTasksRequestExportTaskIdsList = (com.amazonaws.internal.SdkInternalList<String>) describeExportTasksRequest
.getExportTaskIds();
if (!describeExportTasksRequestExportTaskIdsList.isEmpty() || !describeExportTasksRequestExportTaskIdsList.isAutoConstruct()) {
int exportTaskIdsListIndex = 1;
for (String describeExportTasksRequestExportTaskIdsListValue : describeExportTasksRequestExportTaskIdsList) {
if (describeExportTasksRequestExportTaskIdsListValue != null) {
request.addParameter("ExportTaskId." + exportTaskIdsListIndex, StringUtils.fromString(describeExportTasksRequestExportTaskIdsListValue));
}
exportTaskIdsListIndex++;
}
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<MonitorInstancesRequest> marshall(MonitorInstancesRequest monitorInstancesRequest) {
if (monitorInstancesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<MonitorInstancesRequest> request = new DefaultRequest<MonitorInstancesRequest>(monitorInstancesRequest, "AmazonEC2");
request.addParameter("Action", "MonitorInstances");
request.addParameter("Version", "2016-11-15");
request.setHttpMethod(HttpMethodName.POST);
com.amazonaws.internal.SdkInternalList<String> monitorInstancesRequestInstanceIdsList = (com.amazonaws.internal.SdkInternalList<String>) monitorInstancesRequest
.getInstanceIds();
if (!monitorInstancesRequestInstanceIdsList.isEmpty() || !monitorInstancesRequestInstanceIdsList.isAutoConstruct()) {
int instanceIdsListIndex = 1;
for (String monitorInstancesRequestInstanceIdsListValue : monitorInstancesRequestInstanceIdsList) {
if (monitorInstancesRequestInstanceIdsListValue != null) {
request.addParameter("InstanceId." + instanceIdsListIndex, StringUtils.fromString(monitorInstancesRequestInstanceIdsListValue));
}
instanceIdsListIndex++;
}
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<DeleteVpcEndpointsRequest> marshall(DeleteVpcEndpointsRequest deleteVpcEndpointsRequest) {
if (deleteVpcEndpointsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<DeleteVpcEndpointsRequest> request = new DefaultRequest<DeleteVpcEndpointsRequest>(deleteVpcEndpointsRequest, "AmazonEC2");
request.addParameter("Action", "DeleteVpcEndpoints");
request.addParameter("Version", "2016-11-15");
request.setHttpMethod(HttpMethodName.POST);
com.amazonaws.internal.SdkInternalList<String> deleteVpcEndpointsRequestVpcEndpointIdsList = (com.amazonaws.internal.SdkInternalList<String>) deleteVpcEndpointsRequest
.getVpcEndpointIds();
if (!deleteVpcEndpointsRequestVpcEndpointIdsList.isEmpty() || !deleteVpcEndpointsRequestVpcEndpointIdsList.isAutoConstruct()) {
int vpcEndpointIdsListIndex = 1;
for (String deleteVpcEndpointsRequestVpcEndpointIdsListValue : deleteVpcEndpointsRequestVpcEndpointIdsList) {
if (deleteVpcEndpointsRequestVpcEndpointIdsListValue != null) {
request.addParameter("VpcEndpointId." + vpcEndpointIdsListIndex, StringUtils.fromString(deleteVpcEndpointsRequestVpcEndpointIdsListValue));
}
vpcEndpointIdsListIndex++;
}
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<DescribeConversionTasksRequest> marshall(DescribeConversionTasksRequest describeConversionTasksRequest) {
if (describeConversionTasksRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<DescribeConversionTasksRequest> request = new DefaultRequest<DescribeConversionTasksRequest>(describeConversionTasksRequest, "AmazonEC2");
request.addParameter("Action", "DescribeConversionTasks");
request.addParameter("Version", "2016-11-15");
request.setHttpMethod(HttpMethodName.POST);
com.amazonaws.internal.SdkInternalList<String> describeConversionTasksRequestConversionTaskIdsList = (com.amazonaws.internal.SdkInternalList<String>) describeConversionTasksRequest
.getConversionTaskIds();
if (!describeConversionTasksRequestConversionTaskIdsList.isEmpty() || !describeConversionTasksRequestConversionTaskIdsList.isAutoConstruct()) {
int conversionTaskIdsListIndex = 1;
for (String describeConversionTasksRequestConversionTaskIdsListValue : describeConversionTasksRequestConversionTaskIdsList) {
if (describeConversionTasksRequestConversionTaskIdsListValue != null) {
request.addParameter("ConversionTaskId." + conversionTaskIdsListIndex,
StringUtils.fromString(describeConversionTasksRequestConversionTaskIdsListValue));
}
conversionTaskIdsListIndex++;
}
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<DescribeSecurityGroupReferencesRequest> marshall(DescribeSecurityGroupReferencesRequest describeSecurityGroupReferencesRequest) {
if (describeSecurityGroupReferencesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<DescribeSecurityGroupReferencesRequest> request = new DefaultRequest<DescribeSecurityGroupReferencesRequest>(
describeSecurityGroupReferencesRequest, "AmazonEC2");
request.addParameter("Action", "DescribeSecurityGroupReferences");
request.addParameter("Version", "2016-11-15");
request.setHttpMethod(HttpMethodName.POST);
com.amazonaws.internal.SdkInternalList<String> describeSecurityGroupReferencesRequestGroupIdList = (com.amazonaws.internal.SdkInternalList<String>) describeSecurityGroupReferencesRequest
.getGroupId();
if (!describeSecurityGroupReferencesRequestGroupIdList.isEmpty() || !describeSecurityGroupReferencesRequestGroupIdList.isAutoConstruct()) {
int groupIdListIndex = 1;
for (String describeSecurityGroupReferencesRequestGroupIdListValue : describeSecurityGroupReferencesRequestGroupIdList) {
if (describeSecurityGroupReferencesRequestGroupIdListValue != null) {
request.addParameter("GroupId." + groupIdListIndex, StringUtils.fromString(describeSecurityGroupReferencesRequestGroupIdListValue));
}
groupIdListIndex++;
}
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<CancelSpotInstanceRequestsRequest> marshall(CancelSpotInstanceRequestsRequest cancelSpotInstanceRequestsRequest) {
if (cancelSpotInstanceRequestsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<CancelSpotInstanceRequestsRequest> request = new DefaultRequest<CancelSpotInstanceRequestsRequest>(cancelSpotInstanceRequestsRequest,
"AmazonEC2");
request.addParameter("Action", "CancelSpotInstanceRequests");
request.addParameter("Version", "2016-11-15");
request.setHttpMethod(HttpMethodName.POST);
com.amazonaws.internal.SdkInternalList<String> cancelSpotInstanceRequestsRequestSpotInstanceRequestIdsList = (com.amazonaws.internal.SdkInternalList<String>) cancelSpotInstanceRequestsRequest
.getSpotInstanceRequestIds();
if (!cancelSpotInstanceRequestsRequestSpotInstanceRequestIdsList.isEmpty()
|| !cancelSpotInstanceRequestsRequestSpotInstanceRequestIdsList.isAutoConstruct()) {
int spotInstanceRequestIdsListIndex = 1;
for (String cancelSpotInstanceRequestsRequestSpotInstanceRequestIdsListValue : cancelSpotInstanceRequestsRequestSpotInstanceRequestIdsList) {
if (cancelSpotInstanceRequestsRequestSpotInstanceRequestIdsListValue != null) {
request.addParameter("SpotInstanceRequestId." + spotInstanceRequestIdsListIndex,
StringUtils.fromString(cancelSpotInstanceRequestsRequestSpotInstanceRequestIdsListValue));
}
spotInstanceRequestIdsListIndex++;
}
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<DisableVpcClassicLinkRequest> marshall(DisableVpcClassicLinkRequest disableVpcClassicLinkRequest) {
if (disableVpcClassicLinkRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<DisableVpcClassicLinkRequest> request = new DefaultRequest<DisableVpcClassicLinkRequest>(disableVpcClassicLinkRequest, "AmazonEC2");
request.addParameter("Action", "DisableVpcClassicLink");
request.addParameter("Version", "2016-11-15");
request.setHttpMethod(HttpMethodName.POST);
if (disableVpcClassicLinkRequest.getVpcId() != null) {
request.addParameter("VpcId", StringUtils.fromString(disableVpcClassicLinkRequest.getVpcId()));
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<GetServerCertificateRequest> marshall(GetServerCertificateRequest getServerCertificateRequest) {
if (getServerCertificateRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<GetServerCertificateRequest> request = new DefaultRequest<GetServerCertificateRequest>(getServerCertificateRequest, "AmazonIdentityManagement");
request.addParameter("Action", "GetServerCertificate");
request.addParameter("Version", "2010-05-08");
request.setHttpMethod(HttpMethodName.POST);
if (getServerCertificateRequest.getServerCertificateName() != null) {
request.addParameter("ServerCertificateName", StringUtils.fromString(getServerCertificateRequest.getServerCertificateName()));
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<CreateDomainRequest> marshall(CreateDomainRequest createDomainRequest) {
if (createDomainRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<CreateDomainRequest> request = new DefaultRequest<CreateDomainRequest>(createDomainRequest, "AmazonSimpleDB");
request.addParameter("Action", "CreateDomain");
request.addParameter("Version", "2009-04-15");
request.setHttpMethod(HttpMethodName.POST);
if (createDomainRequest.getDomainName() != null) {
request.addParameter("DomainName", StringUtils.fromString(createDomainRequest.getDomainName()));
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<DeleteHsmConfigurationRequest> marshall(DeleteHsmConfigurationRequest deleteHsmConfigurationRequest) {
if (deleteHsmConfigurationRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<DeleteHsmConfigurationRequest> request = new DefaultRequest<DeleteHsmConfigurationRequest>(deleteHsmConfigurationRequest, "AmazonRedshift");
request.addParameter("Action", "DeleteHsmConfiguration");
request.addParameter("Version", "2012-12-01");
request.setHttpMethod(HttpMethodName.POST);
if (deleteHsmConfigurationRequest.getHsmConfigurationIdentifier() != null) {
request.addParameter("HsmConfigurationIdentifier", StringUtils.fromString(deleteHsmConfigurationRequest.getHsmConfigurationIdentifier()));
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<GetPasswordDataRequest> marshall(GetPasswordDataRequest getPasswordDataRequest) {
if (getPasswordDataRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<GetPasswordDataRequest> request = new DefaultRequest<GetPasswordDataRequest>(getPasswordDataRequest, "AmazonEC2");
request.addParameter("Action", "GetPasswordData");
request.addParameter("Version", "2016-11-15");
request.setHttpMethod(HttpMethodName.POST);
if (getPasswordDataRequest.getInstanceId() != null) {
request.addParameter("InstanceId", StringUtils.fromString(getPasswordDataRequest.getInstanceId()));
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<DeleteTargetGroupRequest> marshall(DeleteTargetGroupRequest deleteTargetGroupRequest) {
if (deleteTargetGroupRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<DeleteTargetGroupRequest> request = new DefaultRequest<DeleteTargetGroupRequest>(deleteTargetGroupRequest, "AmazonElasticLoadBalancing");
request.addParameter("Action", "DeleteTargetGroup");
request.addParameter("Version", "2015-12-01");
request.setHttpMethod(HttpMethodName.POST);
if (deleteTargetGroupRequest.getTargetGroupArn() != null) {
request.addParameter("TargetGroupArn", StringUtils.fromString(deleteTargetGroupRequest.getTargetGroupArn()));
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<DeleteDBClusterSnapshotRequest> marshall(DeleteDBClusterSnapshotRequest deleteDBClusterSnapshotRequest) {
if (deleteDBClusterSnapshotRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<DeleteDBClusterSnapshotRequest> request = new DefaultRequest<DeleteDBClusterSnapshotRequest>(deleteDBClusterSnapshotRequest, "AmazonDocDB");
request.addParameter("Action", "DeleteDBClusterSnapshot");
request.addParameter("Version", "2014-10-31");
request.setHttpMethod(HttpMethodName.POST);
if (deleteDBClusterSnapshotRequest.getDBClusterSnapshotIdentifier() != null) {
request.addParameter("DBClusterSnapshotIdentifier", StringUtils.fromString(deleteDBClusterSnapshotRequest.getDBClusterSnapshotIdentifier()));
}
return request;
}
代码示例来源:origin: aws/aws-sdk-java
public Request<DeleteClientVpnEndpointRequest> marshall(DeleteClientVpnEndpointRequest deleteClientVpnEndpointRequest) {
if (deleteClientVpnEndpointRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
Request<DeleteClientVpnEndpointRequest> request = new DefaultRequest<DeleteClientVpnEndpointRequest>(deleteClientVpnEndpointRequest, "AmazonEC2");
request.addParameter("Action", "DeleteClientVpnEndpoint");
request.addParameter("Version", "2016-11-15");
request.setHttpMethod(HttpMethodName.POST);
if (deleteClientVpnEndpointRequest.getClientVpnEndpointId() != null) {
request.addParameter("ClientVpnEndpointId", StringUtils.fromString(deleteClientVpnEndpointRequest.getClientVpnEndpointId()));
}
return request;
}
内容来源于网络,如有侵权,请联系作者删除!