forked from aws/aws-sdk-net
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Spot Fleet tagging capability allows customers to automatically tag i…
…nstances launched by Spot Fleet. You can use this feature to label or distinguish instances created by distinct Spot Fleets. Tagging your EC2 instances also enables you to see instance cost allocation by tag in your AWS bill.
- Loading branch information
1 parent
16d0f89
commit 6e0e442
Showing
9 changed files
with
276 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
...Generated/Model/Internal/MarshallTransformations/SpotFleetTagSpecificationUnmarshaller.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
/* | ||
* Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Do not modify this file. This file is generated from the ec2-2016-11-15.normal.json service model. | ||
*/ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.IO; | ||
using System.Net; | ||
using System.Text; | ||
using System.Xml.Serialization; | ||
|
||
using Amazon.EC2.Model; | ||
using Amazon.Runtime; | ||
using Amazon.Runtime.Internal; | ||
using Amazon.Runtime.Internal.Transform; | ||
using Amazon.Runtime.Internal.Util; | ||
namespace Amazon.EC2.Model.Internal.MarshallTransformations | ||
{ | ||
/// <summary> | ||
/// Response Unmarshaller for SpotFleetTagSpecification Object | ||
/// </summary> | ||
public class SpotFleetTagSpecificationUnmarshaller : IUnmarshaller<SpotFleetTagSpecification, XmlUnmarshallerContext>, IUnmarshaller<SpotFleetTagSpecification, JsonUnmarshallerContext> | ||
{ | ||
/// <summary> | ||
/// Unmarshaller the response from the service to the response class. | ||
/// </summary> | ||
/// <param name="context"></param> | ||
/// <returns></returns> | ||
public SpotFleetTagSpecification Unmarshall(XmlUnmarshallerContext context) | ||
{ | ||
SpotFleetTagSpecification unmarshalledObject = new SpotFleetTagSpecification(); | ||
int originalDepth = context.CurrentDepth; | ||
int targetDepth = originalDepth + 1; | ||
|
||
if (context.IsStartOfDocument) | ||
targetDepth += 2; | ||
|
||
while (context.ReadAtDepth(originalDepth)) | ||
{ | ||
if (context.IsStartElement || context.IsAttribute) | ||
{ | ||
if (context.TestExpression("resourceType", targetDepth)) | ||
{ | ||
var unmarshaller = StringUnmarshaller.Instance; | ||
unmarshalledObject.ResourceType = unmarshaller.Unmarshall(context); | ||
continue; | ||
} | ||
if (context.TestExpression("tag/item", targetDepth)) | ||
{ | ||
var unmarshaller = TagUnmarshaller.Instance; | ||
var item = unmarshaller.Unmarshall(context); | ||
unmarshalledObject.Tags.Add(item); | ||
continue; | ||
} | ||
} | ||
else if (context.IsEndElement && context.CurrentDepth < originalDepth) | ||
{ | ||
return unmarshalledObject; | ||
} | ||
} | ||
|
||
return unmarshalledObject; | ||
} | ||
|
||
/// <summary> | ||
/// Unmarshaller error response to exception. | ||
/// </summary> | ||
/// <param name="context"></param> | ||
/// <returns></returns> | ||
public SpotFleetTagSpecification Unmarshall(JsonUnmarshallerContext context) | ||
{ | ||
return null; | ||
} | ||
|
||
|
||
private static SpotFleetTagSpecificationUnmarshaller _instance = new SpotFleetTagSpecificationUnmarshaller(); | ||
|
||
/// <summary> | ||
/// Gets the singleton. | ||
/// </summary> | ||
public static SpotFleetTagSpecificationUnmarshaller Instance | ||
{ | ||
get | ||
{ | ||
return _instance; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
sdk/src/Services/EC2/Generated/Model/SpotFleetTagSpecification.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Do not modify this file. This file is generated from the ec2-2016-11-15.normal.json service model. | ||
*/ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Xml.Serialization; | ||
using System.Text; | ||
using System.IO; | ||
|
||
using Amazon.Runtime; | ||
using Amazon.Runtime.Internal; | ||
|
||
namespace Amazon.EC2.Model | ||
{ | ||
/// <summary> | ||
/// The tags for a Spot fleet resource. | ||
/// </summary> | ||
public partial class SpotFleetTagSpecification | ||
{ | ||
private ResourceType _resourceType; | ||
private List<Tag> _tags = new List<Tag>(); | ||
|
||
/// <summary> | ||
/// Gets and sets the property ResourceType. | ||
/// <para> | ||
/// The type of resource. Currently, the only resource type that is supported is <code>instance</code>. | ||
/// </para> | ||
/// </summary> | ||
public ResourceType ResourceType | ||
{ | ||
get { return this._resourceType; } | ||
set { this._resourceType = value; } | ||
} | ||
|
||
// Check to see if ResourceType property is set | ||
internal bool IsSetResourceType() | ||
{ | ||
return this._resourceType != null; | ||
} | ||
|
||
/// <summary> | ||
/// Gets and sets the property Tags. | ||
/// <para> | ||
/// The tags. | ||
/// </para> | ||
/// </summary> | ||
public List<Tag> Tags | ||
{ | ||
get { return this._tags; } | ||
set { this._tags = value; } | ||
} | ||
|
||
// Check to see if Tags property is set | ||
internal bool IsSetTags() | ||
{ | ||
return this._tags != null && this._tags.Count > 0; | ||
} | ||
|
||
} | ||
} |