예제 #1
0
 private Amazon.Inspector.Model.CreateAssessmentTemplateResponse CallAWSServiceOperation(IAmazonInspector client, Amazon.Inspector.Model.CreateAssessmentTemplateRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Inspector", "CreateAssessmentTemplate");
     try
     {
         #if DESKTOP
         return(client.CreateAssessmentTemplate(request));
         #elif CORECLR
         return(client.CreateAssessmentTemplateAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
        public void InspectorCreateAssessmentTemplate()
        {
            #region create-assessment-template-1481064046719

            var response = client.CreateAssessmentTemplate(new CreateAssessmentTemplateRequest
            {
                AssessmentTargetArn    = "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX",
                AssessmentTemplateName = "ExampleAssessmentTemplate",
                DurationInSeconds      = 180,
                RulesPackageArns       = new List <string> {
                    "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-11B9DBXp"
                },
                UserAttributesForFindings = new List <Attribute> {
                    new Attribute {
                        Key   = "Example",
                        Value = "example"
                    }
                }
            });

            string assessmentTemplateArn = response.AssessmentTemplateArn;

            #endregion
        }