Skip to content

Commit

Permalink
Inspector's StopAssessmentRun API has been updated with a new input o…
Browse files Browse the repository at this point in the history
…ption - stopAction. This request parameter can be set to either START_EVALUATION or SKIP_EVALUATION. START_EVALUATION (the default value, and the previous behavior) stops the AWS agent data collection and begins the results evaluation for findings generation based on the data collected so far. SKIP_EVALUATION cancels the assessment run immediately, after which no findings are generated.
  • Loading branch information
sstevenkang committed Jul 31, 2017
1 parent 1d5eea7 commit ed80e9b
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 3 deletions.
16 changes: 14 additions & 2 deletions generator/ServiceModels/inspector/inspector-2016-02-16.normal.json
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,8 @@
"FAILED",
"ERROR",
"COMPLETED",
"COMPLETED_WITH_ERRORS"
"COMPLETED_WITH_ERRORS",
"CANCELED"
]
},
"AssessmentRunStateChange":{
Expand Down Expand Up @@ -1330,7 +1331,7 @@
},
"userAttributesForFindings":{
"shape":"UserAttributeList",
"documentation":"<p>The user-defined attributes that are assigned to every finding that is generated by the assessment run that uses this assessment template.</p>"
"documentation":"<p>The user-defined attributes that are assigned to every finding that is generated by the assessment run that uses this assessment template. An attribute is a key and value pair (an <a>Attribute</a> object). Within an assessment template, each key must be unique.</p>"
}
}
},
Expand Down Expand Up @@ -2669,13 +2670,24 @@
}
}
},
"StopAction":{
"type":"string",
"enum":[
"START_EVALUATION",
"SKIP_EVALUATION"
]
},
"StopAssessmentRunRequest":{
"type":"structure",
"required":["assessmentRunArn"],
"members":{
"assessmentRunArn":{
"shape":"Arn",
"documentation":"<p>The ARN of the assessment run that you want to stop.</p>"
},
"stopAction":{
"shape":"StopAction",
"documentation":"<p>An input option that can be set to either START_EVALUATION or SKIP_EVALUATION. START_EVALUATION (the default value), stops the AWS agent from collecting data and begins the results evaluation and the findings generation process. SKIP_EVALUATION cancels the assessment run immediately, after which no findings are generated.</p>"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ internal bool IsSetRulesPackageArns()
/// Gets and sets the property UserAttributesForFindings.
/// <para>
/// The user-defined attributes that are assigned to every finding that is generated by
/// the assessment run that uses this assessment template.
/// the assessment run that uses this assessment template. An attribute is a key and value
/// pair (an <a>Attribute</a> object). Within an assessment template, each key must be
/// unique.
/// </para>
/// </summary>
public List<Attribute> UserAttributesForFindings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ public IRequest Marshall(StopAssessmentRunRequest publicRequest)
context.Writer.Write(publicRequest.AssessmentRunArn);
}

if(publicRequest.IsSetStopAction())
{
context.Writer.WritePropertyName("stopAction");
context.Writer.Write(publicRequest.StopAction);
}


writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ namespace Amazon.Inspector.Model
public partial class StopAssessmentRunRequest : AmazonInspectorRequest
{
private string _assessmentRunArn;
private StopAction _stopAction;

/// <summary>
/// Gets and sets the property AssessmentRunArn.
Expand All @@ -53,5 +54,26 @@ internal bool IsSetAssessmentRunArn()
return this._assessmentRunArn != null;
}

/// <summary>
/// Gets and sets the property StopAction.
/// <para>
/// An input option that can be set to either START_EVALUATION or SKIP_EVALUATION. START_EVALUATION
/// (the default value), stops the AWS agent from collecting data and begins the results
/// evaluation and the findings generation process. SKIP_EVALUATION cancels the assessment
/// run immediately, after which no findings are generated.
/// </para>
/// </summary>
public StopAction StopAction
{
get { return this._stopAction; }
set { this._stopAction = value; }
}

// Check to see if StopAction property is set
internal bool IsSetStopAction()
{
return this._stopAction != null;
}

}
}
54 changes: 54 additions & 0 deletions sdk/src/Services/Inspector/Generated/ServiceEnumerations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ public static implicit operator AssessmentRunNotificationSnsStatusCode(string va
public class AssessmentRunState : ConstantClass
{

/// <summary>
/// Constant CANCELED for AssessmentRunState
/// </summary>
public static readonly AssessmentRunState CANCELED = new AssessmentRunState("CANCELED");
/// <summary>
/// Constant COLLECTING_DATA for AssessmentRunState
/// </summary>
Expand Down Expand Up @@ -1241,4 +1245,54 @@ public static implicit operator Severity(string value)
}
}


/// <summary>
/// Constants used for properties of type StopAction.
/// </summary>
public class StopAction : ConstantClass
{

/// <summary>
/// Constant SKIP_EVALUATION for StopAction
/// </summary>
public static readonly StopAction SKIP_EVALUATION = new StopAction("SKIP_EVALUATION");
/// <summary>
/// Constant START_EVALUATION for StopAction
/// </summary>
public static readonly StopAction START_EVALUATION = new StopAction("START_EVALUATION");

/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public StopAction(string value)
: base(value)
{
}

/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static StopAction FindValue(string value)
{
return FindValue<StopAction>(value);
}

/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator StopAction(string value)
{
return FindValue(value);
}
}

}

0 comments on commit ed80e9b

Please sign in to comment.