From 74b2e264960cfb195dc2459b42bd9ec72bdd9293 Mon Sep 17 00:00:00 2001 From: "Daniel G. Taylor" Date: Tue, 2 Dec 2014 13:11:20 -0800 Subject: [PATCH] Support latest resource model version. This change adds support for the latest version of the JSON description files for resources. The following has changed: 1. An action's `.path` has been moved into `.resource.path` if a resource is present. If it is present, then a path outside of the resource is no longer valid. This fixes #33. 2. Sub-resources previously defined with either `hasOne` or `hasMany` are now defined with a single `belongsTo` key. The internal Boto 3 representation, however, remains the same and is accessed via `resource.references`. As a result of the format changes, I had to update the internal resource model, adjust the search path behavior for actions and update various tests that made assumptions about the older format. I also discovered that we were using a mix of old and new files for different services, so this change includes updates to EC2 and Glacier so that all resources are using the new format. With this change, we no longer support the older format. --- CHANGELOG.rst | 9 + .../resources/ec2-2014-10-01.resources.json | 2248 +++++++++-------- .../glacier-2012-06-01.resources.json | 737 +++--- boto3/resources/action.py | 11 +- boto3/resources/model.py | 5 +- tests/unit/resources/test_action.py | 4 +- tests/unit/resources/test_factory.py | 2 +- tests/unit/resources/test_model.py | 10 +- 8 files changed, 1616 insertions(+), 1410 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 9ce3bb3106..cd060fd500 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,15 @@ Changelog ========= +Unreleased +---------- + +* feature: Update `Amazon EC2 `_ resource model. +* feature: Support `belongsTo` resource reference as well as `path` + specified in an action's resource definition. +* bugfix: Fix an issue accessing SQS message bodies + (`issue 33 `__) + 0.0.3 - 2014-11-26 ------------------ diff --git a/boto3/data/resources/ec2-2014-10-01.resources.json b/boto3/data/resources/ec2-2014-10-01.resources.json index 4de8806e7f..df0816b095 100644 --- a/boto3/data/resources/ec2-2014-10-01.resources.json +++ b/boto3/data/resources/ec2-2014-10-01.resources.json @@ -1,109 +1,42 @@ { "service": { "actions": { - "CreateInstances": { - "request": { "operation": "RunInstances" }, - "resource": { - "type": "Instance", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"Instances[].InstanceId" } - ] - }, - "path": "Instances[]" - }, - "CreateSubnet": { - "request": { "operation": "CreateSubnet" }, - "resource": { - "type": "Subnet", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"Subnet.SubnetId" } - ] - }, - "path": "Subnet" - }, - "CreateVpc": { - "request": { "operation": "CreateVpc" }, - "resource": { - "type": "Vpc", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"Vpc.VpcId" } - ] - }, - "path": "Vpc" - }, - "RegisterImage": { - "request": { "operation": "RegisterImage" }, + "CreateDhcpOptions": { + "request": { "operation": "CreateDhcpOptions" }, "resource": { - "type": "Image", + "type": "DhcpOptions", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"ImageId" } - ] + { "target": "Id", "sourceType": "responsePath", "source": "DhcpOptions.DhcpOptionsId" } + ], + "path": "DhcpOptions" } }, - "CreateVolume": { - "request": { "operation": "CreateVolume" }, - "resource": { - "type": "Image", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"VolumeId" } - ] - }, - "path": "$" - }, - "CreateSnapshot": { - "request": { "operation": "CreateSnapshot" }, - "resource": { - "type": "Snapshot", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"SnapshotId" } - ] - }, - "path": "$" - }, - "CreateSecurityGroup": { - "request": { "operation": "CreateSecurityGroup" }, + "CreateInstances": { + "request": { "operation": "RunInstances" }, "resource": { - "type": "SecurityGroup", + "type": "Instance", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"GroupId" } - ] + { "target": "Id", "sourceType": "responsePath", "source": "Instances[].InstanceId" } + ], + "path": "Instances[]" } }, - "CreateDhcpOptions": { - "request": { "operation": "CreateDhcpOptions" }, - "resource": { - "type": "DhcpOptions", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"DhcpOptions.DhcpOptionsId" } - ] - }, - "path": "DhcpOptions" - }, "CreateInternetGateway": { "request": { "operation": "CreateInternetGateway" }, "resource": { "type": "InternetGateway", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"InternetGateway.InternetGatewayId" } - ] - }, - "path": "InternetGateway" + { "target": "Id", "sourceType": "responsePath", "source": "InternetGateway.InternetGatewayId" } + ], + "path": "InternetGateway" + } }, "CreateKeyPair": { "request": { "operation": "CreateKeyPair" }, "resource": { "type": "KeyPair", "identifiers": [ - { "target":"Name", "sourceType":"responsePath", "source":"KeyName" } - ] - } - }, - "ImportKeyPair": { - "request": { "operation": "ImportKeyPair" }, - "resource": { - "type": "KeyPair", - "identifiers": [ - { "target":"Name", "sourceType":"responsePath", "source":"KeyName" } + { "target": "Name", "sourceType": "responsePath", "source": "KeyName" } ] } }, @@ -112,27 +45,27 @@ "resource": { "type": "NetworkAcl", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"NetworkAcl.NetworkAclId" } - ] - }, - "path": "NetworkAcl" + { "target": "Id", "sourceType": "responsePath", "source": "NetworkAcl.NetworkAclId" } + ], + "path": "NetworkAcl" + } }, "CreateNetworkInterface": { "request": { "operation": "CreateNetworkInterface" }, "resource": { "type": "NetworkInterface", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"NetworkInterface.NetworkInterfaceId" } - ] - }, - "path": "NetworkInterface" + { "target": "Id", "sourceType": "responsePath", "source": "NetworkInterface.NetworkInterfaceId" } + ], + "path": "NetworkInterface" + } }, "CreatePlacementGroup": { "request": { "operation": "CreatePlacementGroup" }, "resource": { "type": "PlacementGroup", "identifiers": [ - { "target":"Id", "sourceType":"requestParameter", "source":"GroupName" } + { "target": "Id", "sourceType": "requestParameter", "source": "GroupName" } ] } }, @@ -141,208 +74,438 @@ "resource": { "type": "RouteTable", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"RouteTable.RouteTableId" } - ] - }, - "path": "RouteTable" - }, - "DisassociateRouteTable": { - "request": { "operation": "DisassociateRouteTable" } + { "target": "Id", "sourceType": "responsePath", "source": "RouteTable.RouteTableId" } + ], + "path": "RouteTable" + } }, - "CreateTags": { - "request": { "operation": "CreateTags" }, + "CreateSecurityGroup": { + "request": { "operation": "CreateSecurityGroup" }, "resource": { - "type": "Tag", + "type": "SecurityGroup", "identifiers": [ - { "target":"ResourceId", "sourceType":"requestParameter", "source":"Resources[]" }, - { "target":"Key", "sourceType":"requestParameter", "source":"Tags[].Key" }, - { "target":"Value", "sourceType":"requestParameter", "source":"Tags[].Value" } + { "target": "Id", "sourceType": "responsePath", "source": "GroupId" } ] } }, - "CreateVpcPeeringConnection": { - "request": { "operation": "CreateVpcPeeringConnection" }, - "resource": { - "type": "VpcPeeringConnection", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"VpcPeeringConnection.VpcPeeringConnectionId" } - ] - }, - "path": "VpcPeeringConnection" - } - }, - "hasMany": { - "Instances": { - "request": { "operation": "DescribeInstances" }, + "CreateSnapshot": { + "request": { "operation": "CreateSnapshot" }, "resource": { - "type": "Instance", + "type": "Snapshot", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"Reservations[].Instances[].InstanceId" } - ] - }, - "path": "Reservations[].Instances[]" + { "target": "Id", "sourceType": "responsePath", "source": "SnapshotId" } + ], + "path": "$" + } }, - "Subnets": { - "request": { "operation": "DescribeSubnets" }, + "CreateSubnet": { + "request": { "operation": "CreateSubnet" }, "resource": { "type": "Subnet", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"Subnets[].SubnetId" } - ] - }, - "path": "Subnets[]" + { "target": "Id", "sourceType": "responsePath", "source": "Subnet.SubnetId" } + ], + "path": "Subnet" + } }, - "Vpcs": { - "request": { "operation": "DescribeVpcs" }, + "CreateTags": { + "request": { "operation": "CreateTags" }, "resource": { - "type": "Vpc", + "type": "Tag", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"Vpcs[].VpcId" } + { "target": "ResourceId", "sourceType": "requestParameter", "source": "Resources[]" }, + { "target": "Key", "sourceType": "requestParameter", "source": "Tags[].Key" }, + { "target": "Value", "sourceType": "requestParameter", "source": "Tags[].Value" } ] - }, - "path": "Vpcs[]" + } }, - "Images": { - "request": { "operation": "DescribeImages" }, + "CreateVolume": { + "request": { "operation": "CreateVolume" }, "resource": { "type": "Image", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"Images[].ImageId" } - ] - }, - "path": "Images[]" + { "target": "Id", "sourceType": "responsePath", "source": "VolumeId" } + ], + "path": "$" + } }, - "Volumes": { - "request": { "operation": "DescribeVolumes" }, + "CreateVpc": { + "request": { "operation": "CreateVpc" }, "resource": { - "type": "Volume", + "type": "Vpc", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"Volumes[].VolumeId" } - ] - }, - "path": "Volumes[]" + { "target": "Id", "sourceType": "responsePath", "source": "Vpc.VpcId" } + ], + "path": "Vpc" + } }, - "Snapshots": { - "request": { "operation": "DescribeSnapshots" }, + "CreateVpcPeeringConnection": { + "request": { "operation": "CreateVpcPeeringConnection" }, "resource": { - "type": "Snapshot", + "type": "VpcPeeringConnection", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"Snapshots[].SnapshotId" } - ] - }, - "path": "Snapshots[]" + { "target": "Id", "sourceType": "responsePath", "source": "VpcPeeringConnection.VpcPeeringConnectionId" } + ], + "path": "VpcPeeringConnection" + } }, - "SecurityGroups": { - "request": { "operation": "DescribeSecurityGroups" }, + "DisassociateRouteTable": { + "request": { "operation": "DisassociateRouteTable" } + }, + "ImportKeyPair": { + "request": { "operation": "ImportKeyPair" }, "resource": { - "type": "SecurityGroup", + "type": "KeyPair", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"SecurityGroups[].GroupId" } + { "target": "Name", "sourceType": "responsePath", "source": "KeyName" } ] - }, - "path": "SecurityGroups[]" + } }, + "RegisterImage": { + "request": { "operation": "RegisterImage" }, + "resource": { + "type": "Image", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "ImageId" } + ] + } + } + }, + "hasMany": { "DhcpOptionsSets": { "request": { "operation": "DescribeDhcpOptions" }, "resource": { "type": "DhcpOptions", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"DhcpOptions[].DhcpOptionsId" } - ] - }, - "path": "DhcpOptions[]" + { "target": "Id", "sourceType": "responsePath", "source": "DhcpOptions[].DhcpOptionsId" } + ], + "path": "DhcpOptions[]" + } + }, + "Images": { + "request": { "operation": "DescribeImages" }, + "resource": { + "type": "Image", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "Images[].ImageId" } + ], + "path": "Images[]" + } + }, + "Instances": { + "request": { "operation": "DescribeInstances" }, + "resource": { + "type": "Instance", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "Reservations[].Instances[].InstanceId" } + ], + "path": "Reservations[].Instances[]" + } }, "InternetGateways": { "request": { "operation": "DescribeInternetGateways" }, "resource": { "type": "InternetGateway", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"InternetGateways[].InternetGatewayId" } - ] - }, - "path": "InternetGateways[]" + { "target": "Id", "sourceType": "responsePath", "source": "InternetGateways[].InternetGatewayId" } + ], + "path": "InternetGateways[]" + } }, "KeyPairs": { "request": { "operation": "DescribeKeyPairs" }, "resource": { "type": "KeyPair", "identifiers": [ - { "target":"Name", "sourceType":"responsePath", "source":"KeyPairs[].KeyName" } - ] - }, - "path": "KeyPairs[]" + { "target": "Name", "sourceType": "responsePath", "source": "KeyPairs[].KeyName" } + ], + "path": "KeyPairs[]" + } }, "NetworkAcls": { "request": { "operation": "DescribeNetworkAcls" }, "resource": { "type": "NetworkAcl", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"NetworkAcls[].NetworkAclId" } - ] - }, - "path": "NetworkAcls[]" + { "target": "Id", "sourceType": "responsePath", "source": "NetworkAcls[].NetworkAclId" } + ], + "path": "NetworkAcls[]" + } }, "NetworkInterfaces": { "request": { "operation": "DescribeNetworkInterfaces" }, "resource": { "type": "NetworkInterface", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"NetworkInterfaces[].NetworkInterfaceId" } - ] - }, - "path": "NetworkInterfaces[]" + { "target": "Id", "sourceType": "responsePath", "source": "NetworkInterfaces[].NetworkInterfaceId" } + ], + "path": "NetworkInterfaces[]" + } }, "PlacementGroups": { "request": { "operation": "DescribePlacementGroups" }, "resource": { "type": "PlacementGroup", "identifiers": [ - { "target":"Name", "sourceType":"responsePath", "source":"PlacementGroups[].GroupName" } - ] - }, - "path": "PlacementGroups[]" + { "target": "Name", "sourceType": "responsePath", "source": "PlacementGroups[].GroupName" } + ], + "path": "PlacementGroups[]" + } }, "RouteTables": { "request": { "operation": "DescribeRouteTables" }, "resource": { "type": "RouteTable", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"RouteTables[].RouteTableId" } - ] - }, - "path": "RouteTables[]" + { "target": "Id", "sourceType": "responsePath", "source": "RouteTables[].RouteTableId" } + ], + "path": "RouteTables[]" + } + }, + "SecurityGroups": { + "request": { "operation": "DescribeSecurityGroups" }, + "resource": { + "type": "SecurityGroup", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "SecurityGroups[].GroupId" } + ], + "path": "SecurityGroups[]" + } + }, + "Snapshots": { + "request": { "operation": "DescribeSnapshots" }, + "resource": { + "type": "Snapshot", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "Snapshots[].SnapshotId" } + ], + "path": "Snapshots[]" + } + }, + "Subnets": { + "request": { "operation": "DescribeSubnets" }, + "resource": { + "type": "Subnet", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "Subnets[].SubnetId" } + ], + "path": "Subnets[]" + } + }, + "Volumes": { + "request": { "operation": "DescribeVolumes" }, + "resource": { + "type": "Volume", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "Volumes[].VolumeId" } + ], + "path": "Volumes[]" + } }, "VpcPeeringConnections": { "request": { "operation": "DescribeVpcPeeringConnections" }, "resource": { "type": "VpcPeeringConnection", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"VpcPeeringConnections[].VpcPeeringConnectionId" } - ] - }, - "path": "VpcPeeringConnections[]" - } - } - }, + { "target": "Id", "sourceType": "responsePath", "source": "VpcPeeringConnections[].VpcPeeringConnectionId" } + ], + "path": "VpcPeeringConnections[]" + } + }, + "Vpcs": { + "request": { "operation": "DescribeVpcs" }, + "resource": { + "type": "Vpc", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "Vpcs[].VpcId" } + ], + "path": "Vpcs[]" + } + } + } + }, "resources": { + "DhcpOptions": { + "identifiers": [ + { + "name": "Id", + "memberName": "DhcpOptionsId" + } + ], + "shape": "DhcpOptions", + "load": { + "request": { + "operation": "DescribeDhcpOptions", + "params": [ + { "target": "DhcpOptionsIds[0]", "sourceType": "identifier", "source": "Id" } + ] + }, + "path": "DhcpOptions[0]" + }, + "actions": { + "AssociateWithVpc": { + "request": { + "operation": "AssociateDhcpOptions", + "params": [ + { "target": "DhcpOptionsId", "sourceType": "identifier", "source": "Id" } + ] + } + }, + "CreateTags": { + "request": { + "operation": "CreateTags", + "params": [ + { "target": "Resources[0]", "sourceType": "identifier", "source": "Id" } + ] + }, + "resource": { + "type": "Tag", + "identifiers": [ + { "target": "ResourceId", "sourceType": "identifier", "source": "Id" }, + { "target": "Key", "sourceType": "requestParameter", "source": "Tags[].Key" }, + { "target": "Value", "sourceType": "requestParameter", "source": "Tags[].Value" } + ] + } + }, + "Delete": { + "request": { + "operation": "DeleteDhcpOptions", + "params": [ + { "target": "DhcpOptionsId", "sourceType": "identifier", "source": "Id" } + ] + } + } + } + }, + "Image": { + "identifiers": [ + { + "name": "Id", + "memberName": "ImageId" + } + ], + "shape": "Image", + "load": { + "request": { + "operation": "DescribeImages", + "params": [ + { "target": "ImageIds[0]", "sourceType": "identifier", "source": "Id" } + ] + }, + "path": "Images[0]" + }, + "actions": { + "CreateTags": { + "request": { + "operation": "CreateTags", + "params": [ + { "target": "Resources[0]", "sourceType": "identifier", "source": "Id" } + ] + }, + "resource": { + "type": "Tag", + "identifiers": [ + { "target": "ResourceId", "sourceType": "identifier", "source": "Id" }, + { "target": "Key", "sourceType": "requestParameter", "source": "Tags[].Key" }, + { "target": "Value", "sourceType": "requestParameter", "source": "Tags[].Value" } + ] + } + }, + "Deregister": { + "request": { + "operation": "DeregisterImage", + "params": [ + { "target": "ImageId", "sourceType": "identifier", "source": "Id" } + ] + } + }, + "DescribeAttribute": { + "request": { + "operation": "DescribeImageAttribute", + "params": [ + { "target": "ImageId", "sourceType": "identifier", "source": "Id" } + ] + } + }, + "ModifyAttribute": { + "request": { + "operation": "ModifyImageAttribute", + "params": [ + { "target": "ImageId", "sourceType": "identifier", "source": "Id" } + ] + } + }, + "ResetAttribute": { + "request": { + "operation": "ResetImageAttribute", + "params": [ + { "target": "ImageId", "sourceType": "identifier", "source": "Id" } + ] + } + } + } + }, "Instance": { - "identifiers": [{ "name": "Id", "memberName" : "InstanceId" }], + "identifiers": [ + { + "name": "Id", + "memberName": "InstanceId" + } + ], "shape": "Instance", "load": { "request": { "operation": "DescribeInstances", "params": [ - { "target":"InstanceIds[0]", "sourceType":"identifier", "source":"Id" } + { "target": "InstanceIds[0]", "sourceType": "identifier", "source": "Id" } ] }, "path": "Reservations[0].Instances[0]" }, "actions": { + "AttachVolume": { + "request": { + "operation": "AttachVolume", + "params": [ + { "target": "InstanceId", "sourceType": "identifier", "source": "Id" } + ] + } + }, "ConsoleOutput": { "request": { "operation": "GetConsoleOutput", "params": [ - { "target":"InstanceId", "sourceType":"identifier", "source":"Id" } + { "target": "InstanceId", "sourceType": "identifier", "source": "Id" } + ] + } + }, + "CreateImage": { + "request": { + "operation": "CreateImage", + "params": [ + { "target": "InstanceId", "sourceType": "identifier", "source": "Id" } + ] + }, + "resource": { + "type": "Image", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "ImageId" } + ] + } + }, + "CreateTags": { + "request": { + "operation": "CreateTags", + "params": [ + { "target": "Resources[0]", "sourceType": "identifier", "source": "Id" } + ] + }, + "resource": { + "type": "Tag", + "identifiers": [ + { "target": "ResourceId", "sourceType": "identifier", "source": "Id" }, + { "target": "Key", "sourceType": "requestParameter", "source": "Tags[].Key" }, + { "target": "Value", "sourceType": "requestParameter", "source": "Tags[].Value" } ] } }, @@ -350,7 +513,15 @@ "request": { "operation": "DescribeInstanceAttribute", "params": [ - { "target":"InstanceId", "sourceType":"identifier", "source":"Id" } + { "target": "InstanceId", "sourceType": "identifier", "source": "Id" } + ] + } + }, + "DetachVolume": { + "request": { + "operation": "DetachVolume", + "params": [ + { "target": "InstanceId", "sourceType": "identifier", "source": "Id" } ] } }, @@ -358,7 +529,7 @@ "request": { "operation": "ModifyInstanceAttribute", "params": [ - { "target":"InstanceId", "sourceType":"identifier", "source":"Id" } + { "target": "InstanceId", "sourceType": "identifier", "source": "Id" } ] } }, @@ -366,7 +537,7 @@ "request": { "operation": "MonitorInstances", "params": [ - { "target":"InstanceIds[0]", "sourceType":"identifier", "source":"Id" } + { "target": "InstanceIds[0]", "sourceType": "identifier", "source": "Id" } ] } }, @@ -374,7 +545,15 @@ "request": { "operation": "GetPasswordData", "params": [ - { "target":"InstanceId", "sourceType":"identifier", "source":"Id" } + { "target": "InstanceId", "sourceType": "identifier", "source": "Id" } + ] + } + }, + "Reboot": { + "request": { + "operation": "RebootInstances", + "params": [ + { "target": "InstanceIds[0]", "sourceType": "identifier", "source": "Id" } ] } }, @@ -382,7 +561,7 @@ "request": { "operation": "ReportInstanceStatus", "params": [ - { "target":"Instances[0]", "sourceType":"identifier", "source":"Id" } + { "target": "Instances[0]", "sourceType": "identifier", "source": "Id" } ] } }, @@ -390,7 +569,7 @@ "request": { "operation": "ResetInstanceAttribute", "params": [ - { "target":"InstanceId", "sourceType":"identifier", "source":"Id" } + { "target": "InstanceId", "sourceType": "identifier", "source": "Id" } ] } }, @@ -398,8 +577,8 @@ "request": { "operation": "ResetInstanceAttribute", "params": [ - { "target":"InstanceId", "sourceType":"identifier", "source":"Id" }, - { "target":"Attribute", "sourceType":"string", "source":"kernel" } + { "target": "InstanceId", "sourceType": "identifier", "source": "Id" }, + { "target": "Attribute", "sourceType": "string", "source": "kernel" } ] } }, @@ -407,8 +586,8 @@ "request": { "operation": "ResetInstanceAttribute", "params": [ - { "target":"InstanceId", "sourceType":"identifier", "source":"Id" }, - { "target":"Attribute", "sourceType":"string", "source":"ramdisk" } + { "target": "InstanceId", "sourceType": "identifier", "source": "Id" }, + { "target": "Attribute", "sourceType": "string", "source": "ramdisk" } ] } }, @@ -416,8 +595,8 @@ "request": { "operation": "ResetInstanceAttribute", "params": [ - { "target":"InstanceId", "sourceType":"identifier", "source":"Id" }, - { "target":"Attribute", "sourceType":"string", "source":"sourceDestCheck" } + { "target": "InstanceId", "sourceType": "identifier", "source": "Id" }, + { "target": "Attribute", "sourceType": "string", "source": "sourceDestCheck" } ] } }, @@ -425,7 +604,7 @@ "request": { "operation": "StartInstances", "params": [ - { "target":"InstanceIds[0]", "sourceType":"identifier", "source":"Id" } + { "target": "InstanceIds[0]", "sourceType": "identifier", "source": "Id" } ] } }, @@ -433,15 +612,7 @@ "request": { "operation": "StopInstances", "params": [ - { "target":"InstanceIds[0]", "sourceType":"identifier", "source":"Id" } - ] - } - }, - "Reboot": { - "request": { - "operation": "RebootInstances", - "params": [ - { "target":"InstanceIds[0]", "sourceType":"identifier", "source":"Id" } + { "target": "InstanceIds[0]", "sourceType": "identifier", "source": "Id" } ] } }, @@ -449,7 +620,7 @@ "request": { "operation": "TerminateInstances", "params": [ - { "target":"InstanceIds[0]", "sourceType":"identifier", "source":"Id" } + { "target": "InstanceIds[0]", "sourceType": "identifier", "source": "Id" } ] } }, @@ -457,79 +628,116 @@ "request": { "operation": "UnmonitorInstances", "params": [ - { "target":"InstanceIds[0]", "sourceType":"identifier", "source":"Id" } + { "target": "InstanceIds[0]", "sourceType": "identifier", "source": "Id" } + ] + } + } + }, + "batchActions": { + "CreateTags": { + "request": { + "operation": "CreateTags", + "params": [ + { "target": "Resources[]", "sourceType": "identifier", "source": "Id" } ] } }, - "CreateImage": { + "Monitor": { "request": { - "operation": "CreateImage", + "operation": "MonitorInstances", "params": [ - { "target":"InstanceId", "sourceType":"identifier", "source":"Id" } + { "target": "InstanceIds[]", "sourceType": "identifier", "source": "Id" } ] - }, - "resource": { - "type": "Image", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"ImageId" } + } + }, + "Reboot": { + "request": { + "operation": "RebootInstances", + "params": [ + { "target": "InstanceIds[]", "sourceType": "identifier", "source": "Id" } ] } }, - "AttachVolume": { + "Start": { "request": { - "operation": "AttachVolume", + "operation": "StartInstances", "params": [ - { "target":"InstanceId", "sourceType":"identifier", "source":"Id" } + { "target": "InstanceIds[]", "sourceType": "identifier", "source": "Id" } ] } }, - "DetachVolume": { + "Stop": { "request": { - "operation": "DetachVolume", + "operation": "StopInstances", "params": [ - { "target":"InstanceId", "sourceType":"identifier", "source":"Id" } + { "target": "InstanceIds[]", "sourceType": "identifier", "source": "Id" } ] } }, - "CreateTags": { + "Terminate": { "request": { - "operation": "CreateTags", + "operation": "TerminateInstances", "params": [ - { "target":"Resources[0]", "sourceType":"identifier", "source":"Id" } + { "target": "InstanceIds[]", "sourceType": "identifier", "source": "Id" } ] - }, - "resource": { - "type": "Tag", - "identifiers": [ - { "target":"ResourceId", "sourceType":"identifier", "source":"Id" }, - { "target":"Key", "sourceType":"requestParameter", "source":"Tags[].Key" }, - { "target":"Value", "sourceType":"requestParameter", "source":"Tags[].Value" } + } + }, + "Unmonitor": { + "request": { + "operation": "UnmonitorInstances", + "params": [ + { "target": "InstanceIds[]", "sourceType": "identifier", "source": "Id" } ] } } }, - "hasOne": { - "Subnet": { - "resource": { - "type": "Subnet", - "identifiers": [ - { "target":"Id", "sourceType":"dataMember", "source":"SubnetId" } - ] - } + "waiters": { + "Running": { + "waiterName": "InstanceRunning", + "params": [ + { "target": "InstanceIds[]", "sourceType": "identifier", "source": "Id" } + ], + "path": "Reservations[0].Instances[0]" }, - "Vpc": { + "Stopped": { + "waiterName": "InstanceStopped", + "params": [ + { "target": "InstanceIds[]", "sourceType": "identifier", "source": "Id" } + ], + "path": "Reservations[0].Instances[0]" + }, + "Terminated": { + "waiterName": "InstanceTerminated", + "params": [ + { "target": "InstanceIds[]", "sourceType": "identifier", "source": "Id" } + ], + "path": "Reservations[0].Instances[0]" + } + }, + "hasMany": { + "Volumes": { + "request": { + "operation": "DescribeVolumes", + "params": [ + { "target": "Filters[0].Name", "sourceType": "string", "source": "attachment.instance-id" }, + { "target": "Filters[0].Values[0]", "sourceType": "identifier", "source": "Id" } + ] + }, "resource": { - "type": "Vpc", + "type": "Volume", "identifiers": [ - { "target":"Id", "sourceType":"dataMember", "source":"VpcId" } - ] + { "target": "Id", "sourceType": "responsePath", "source": "Volumes[].VolumeId" } + ], + "path": "Volumes[]" } - }, + } + }, + "belongsTo": { "Image": { "resource": { "type": "Image", "identifiers": [ - { "target":"Id", "sourceType":"dataMember", "source":"ImageId" } + { "target": "Id", "sourceType": "dataMember", "source": "ImageId" } ] } }, @@ -537,7 +745,7 @@ "resource": { "type": "KeyPair", "identifiers": [ - { "target":"Name", "sourceType":"dataMember", "source":"KeyName" } + { "target": "Name", "sourceType": "dataMember", "source": "KeyName" } ] } }, @@ -545,635 +753,591 @@ "resource": { "type": "PlacementGroup", "identifiers": [ - { "target":"Name", "sourceType":"dataMember", "source":"Placement.GroupName" } + { "target": "Name", "sourceType": "dataMember", "source": "Placement.GroupName" } ] } - } - }, - "hasMany": { - "Volumes": { - "request": { - "operation": "DescribeVolumes", - "params": [ - { "target":"Filters[0].Name", "sourceType":"string", "source":"attachment.instance-id" }, - { "target":"Filters[0].Values[0]", "sourceType":"identifier", "source":"Id" } + }, + "Subnet": { + "resource": { + "type": "Subnet", + "identifiers": [ + { "target": "Id", "sourceType": "dataMember", "source": "SubnetId" } ] - }, + } + }, + "Vpc": { "resource": { - "type": "Volume", + "type": "Vpc", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"Volumes[].VolumeId" } + { "target": "Id", "sourceType": "dataMember", "source": "VpcId" } ] - }, - "path": "Volumes[]" + } } } }, - "Subnet": { - "identifiers": [{ "name": "Id", "memberName" : "SubnetId" }], - "shape": "Subnet", + "InternetGateway": { + "identifiers": [ + { + "name": "Id", + "memberName": "InternetGatewayId" + } + ], + "shape": "InternetGateway", "load": { "request": { - "operation": "DescribeSubnets", + "operation": "DescribeInternetGateways", "params": [ - { "target":"SubnetIds[0]", "sourceType":"identifier", "source":"Id" } + { "target": "InternetGatewayIds[0]", "sourceType": "identifier", "source": "Id" } ] }, - "path": "Subnets[0]" + "path": "InternetGateways[0]" }, "actions": { - "CreateInstances": { - "request": { - "operation": "RunInstances", - "params": [ - { "target":"SubnetId", "sourceType":"identifier", "source":"Id" } - ] - }, - "resource": { - "type": "Instance", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"Instances[].InstanceId" } - ] - }, - "path": "Instances[]" - }, - "Delete": { + "AttachToVpc": { "request": { - "operation": "DeleteSubnet", + "operation": "AttachInternetGateway", "params": [ - { "target":"SubnetId", "sourceType":"identifier", "source":"Id" } + { "target": "InternetGatewayId", "sourceType": "identifier", "source": "Id" } ] } }, - "CreateNetworkInterface": { - "request": { - "operation": "CreateNetworkInterface", - "params": [ - { "target":"SubnetId", "sourceType":"identifier", "source":"Id" } - ] - }, - "resource": { - "type": "NetworkInterface", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"NetworkInterface.NetworkInterfaceId" } - ] - }, - "path": "NetworkInterface" - }, "CreateTags": { "request": { "operation": "CreateTags", "params": [ - { "target":"Resources[0]", "sourceType":"identifier", "source":"Id" } + { "target": "Resources[0]", "sourceType": "identifier", "source": "Id" } ] }, "resource": { "type": "Tag", "identifiers": [ - { "target":"ResourceId", "sourceType":"identifier", "source":"Id" }, - { "target":"Key", "sourceType":"requestParameter", "source":"Tags[].Key" }, - { "target":"Value", "sourceType":"requestParameter", "source":"Tags[].Value" } + { "target": "ResourceId", "sourceType": "identifier", "source": "Id" }, + { "target": "Key", "sourceType": "requestParameter", "source": "Tags[].Key" }, + { "target": "Value", "sourceType": "requestParameter", "source": "Tags[].Value" } ] } - } - }, - "hasMany": { - "Instances": { + }, + "Delete": { "request": { - "operation": "DescribeInstances", + "operation": "DeleteInternetGateway", "params": [ - { "target":"Filters[0].Name", "sourceType":"string", "source":"subnet-id" }, - { "target":"Filters[0].Values[0]", "sourceType":"identifier", "source":"Id" } - ] - }, - "resource": { - "type": "Instance", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"Reservations[].Instances[].InstanceId" } + { "target": "InternetGatewayId", "sourceType": "identifier", "source": "Id" } ] - }, - "path": "Reservations[].Instances[]" + } }, - "NetworkInterfaces": { + "DetachFromVpc": { "request": { - "operation": "DescribeNetworkInterfaces", + "operation": "DetachInternetGateway", "params": [ - { "target":"Filters[0].Name", "sourceType":"string", "source":"subnet-id" }, - { "target":"Filters[0].Values[0]", "sourceType":"identifier", "source":"Id" } + { "target": "InternetGatewayId", "sourceType": "identifier", "source": "Id" } ] - }, - "resource": { - "type": "NetworkInterface", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"NetworkInterfaces[].NetworkInterfaceId" } - ] - }, - "path": "NetworkInterfaces[]" + } } + } + }, + "KeyPair": { + "identifiers": [ + { + "name": "Name", + "memberName": "KeyName" + } + ], + "shape": "KeyPairInfo", + "load": { + "request": { + "operation": "DescribeKeyPairs", + "params": [ + { "target": "KeyNames[0]", "sourceType": "identifier", "source": "Name" } + ] + }, + "path": "KeyPairs[0]" }, - "hasOne": { - "Vpc": { - "resource": { - "type": "Vpc", - "identifiers": [ - { "target":"Id", "sourceType":"dataMember", "source":"VpcId" } + "actions": { + "Delete": { + "request": { + "operation": "DeleteKeyPair", + "params": [ + { "target": "KeyName", "sourceType": "identifier", "source": "Name" } ] } } } }, - "Vpc": { - "identifiers": [{ "name": "Id", "memberName" : "VpcId" }], - "shape": "Vpc", + "NetworkAcl": { + "identifiers": [ + { + "name": "Id", + "memberName": "NetworkAclId" + } + ], + "shape": "NetworkAcl", "load": { "request": { - "operation": "DescribeVpcs", + "operation": "DescribeNetworkAcls", "params": [ - { "target":"VpcIds[0]", "sourceType":"identifier", "source":"Id" } + { "target": "NetworkAclIds[0]", "sourceType": "identifier", "source": "Id" } ] }, - "path": "Vpcs[0]" + "path": "NetworkAcls[0]" }, "actions": { - "CreateSubnet": { + "CreateEntry": { "request": { - "operation": "CreateSubnet", + "operation": "CreateNetworkAclEntry", + "params": [ + { "target": "NetworkAclId", "sourceType": "identifier", "source": "Id" } + ] + } + }, + "CreateTags": { + "request": { + "operation": "CreateTags", "params": [ - { "target":"VpcId", "sourceType":"identifier", "source":"Id" } + { "target": "Resources[0]", "sourceType": "identifier", "source": "Id" } ] }, "resource": { - "type": "Subnet", + "type": "Tag", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"Subnet.SubnetId" } + { "target": "ResourceId", "sourceType": "identifier", "source": "Id" }, + { "target": "Key", "sourceType": "requestParameter", "source": "Tags[].Key" }, + { "target": "Value", "sourceType": "requestParameter", "source": "Tags[].Value" } ] - }, - "path": "Subnet" + } }, "Delete": { "request": { - "operation": "DeleteVpc", + "operation": "DeleteNetworkAcl", "params": [ - { "target":"VpcId", "sourceType":"identifier", "source":"Id" } + { "target": "NetworkAclId", "sourceType": "identifier", "source": "Id" } ] } }, - "DescribeAttribute": { + "DeleteEntry": { "request": { - "operation": "DescribeVpcAttribute", + "operation": "DeleteNetworkAclEntry", "params": [ - { "target":"VpcId", "sourceType":"identifier", "source":"Id" } + { "target": "NetworkAclId", "sourceType": "identifier", "source": "Id" } ] } }, - "ModifyAttribute": { + "ReplaceAssociation": { "request": { - "operation": "ModifyVpcAttribute", + "operation": "ReplaceNetworkAclAssociation", "params": [ - { "target":"VpcId", "sourceType":"identifier", "source":"Id" } + { "target": "NetworkAclId", "sourceType": "identifier", "source": "Id" } ] } }, - "AssociateDhcpOptions": { + "ReplaceEntry": { "request": { - "operation": "AssociateDhcpOptions", + "operation": "ReplaceNetworkAclEntry", "params": [ - { "target":"VpcId", "sourceType":"identifier", "source":"Id" } + { "target": "NetworkAclId", "sourceType": "identifier", "source": "Id" } ] } - }, - "CreateSecurityGroup": { - "request": { - "operation": "CreateSecurityGroup", - "params": [ - { "target":"VpcId", "sourceType":"identifier", "source":"Id" } - ] - }, + } + }, + "belongsTo": { + "Vpc": { "resource": { - "type": "SecurityGroup", + "type": "Vpc", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"GroupId" } + { "target": "Id", "sourceType": "dataMember", "source": "VpcId" } ] } + } + } + }, + "NetworkInterface": { + "identifiers": [ + { + "name": "Id", + "memberName": "NetworkInterfaceId" + } + ], + "shape": "NetworkInterface", + "load": { + "request": { + "operation": "DescribeNetworkInterfaces", + "params": [ + { "target": "NetworkInterfaceIds[0]", "sourceType": "identifier", "source": "Id" } + ] }, - "AttachInternetGateway": { + "path": "NetworkInterfaces[0]" + }, + "actions": { + "AssignPrivateIpAddresses": { "request": { - "operation": "AttachInternetGateway", + "operation": "AssignPrivateIpAddresses", "params": [ - { "target":"VpcId", "sourceType":"identifier", "source":"Id" } + { "target": "NetworkInterfaceId", "sourceType": "identifier", "source": "Id" } ] } }, - "DetachInternetGateway": { + "Attach": { "request": { - "operation": "DetachInternetGateway", + "operation": "AttachNetworkInterface", "params": [ - { "target":"VpcId", "sourceType":"identifier", "source":"Id" } + { "target": "NetworkInterfaceId", "sourceType": "identifier", "source": "Id" } ] } }, - "CreateNetworkAcl": { + "CreateTags": { "request": { - "operation": "CreateNetworkAcl", + "operation": "CreateTags", "params": [ - { "target":"VpcId", "sourceType":"identifier", "source":"Id" } + { "target": "Resources[0]", "sourceType": "identifier", "source": "Id" } ] }, "resource": { - "type": "NetworkAcl", + "type": "Tag", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"NetworkAcl.NetworkAclId" } + { "target": "ResourceId", "sourceType": "identifier", "source": "Id" }, + { "target": "Key", "sourceType": "requestParameter", "source": "Tags[].Key" }, + { "target": "Value", "sourceType": "requestParameter", "source": "Tags[].Value" } ] - }, - "path": "NetworkAcl" + } }, - "CreateRouteTable": { + "Delete": { "request": { - "operation": "CreateRouteTable", + "operation": "DeleteNetworkInterface", "params": [ - { "target":"VpcId", "sourceType":"identifier", "source":"Id" } - ] - }, - "resource": { - "type": "RouteTable", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"RouteTable.RouteTableId" } + { "target": "NetworkInterfaceId", "sourceType": "identifier", "source": "Id" } ] - }, - "path": "RouteTable" + } }, - "RequestVpcPeeringConnection": { + "DescribeAttribute": { "request": { - "operation": "CreateVpcPeeringConnection", + "operation": "DescribeNetworkInterfaceAttribute", "params": [ - { "target":"VpcId", "sourceType":"identifier", "source":"Id" } - ] - }, - "resource": { - "type": "VpcPeeringConnection", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"VpcPeeringConnection.VpcPeeringConnectionId" } + { "target": "NetworkInterfaceId", "sourceType": "identifier", "source": "Id" } ] - }, - "path": "VpcPeeringConnection" + } }, - "CreateTags": { + "Detach": { "request": { - "operation": "CreateTags", + "operation": "DetachNetworkInterface", "params": [ - { "target":"Resources[0]", "sourceType":"identifier", "source":"Id" } - ] - }, - "resource": { - "type": "Tag", - "identifiers": [ - { "target":"ResourceId", "sourceType":"identifier", "source":"Id" }, - { "target":"Key", "sourceType":"requestParameter", "source":"Tags[].Key" }, - { "target":"Value", "sourceType":"requestParameter", "source":"Tags[].Value" } + { "target": "AttachmentId", "sourceType": "dataMember", "source": "Attachment.AttachmentId" } ] } - } - }, - "hasMany": { - "Instances": { + }, + "ModifyAttribute": { "request": { - "operation": "DescribeInstances", + "operation": "ModifyNetworkInterfaceAttribute", "params": [ - { "target":"Filters[0].Name", "sourceType":"string", "source":"vpc-id" }, - { "target":"Filters[0].Values[0]", "sourceType":"identifier", "source":"Id" } + { "target": "NetworkInterfaceId", "sourceType": "identifier", "source": "Id" } ] - }, - "resource": { - "type": "Instance", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"Reservations[].Instances[].InstanceId" } + } + }, + "ResetAttribute": { + "request": { + "operation": "ResetNetworkInterfaceAttribute", + "params": [ + { "target": "NetworkInterfaceId", "sourceType": "identifier", "source": "Id" } ] - }, - "path": "Reservations[].Instances[]" + } }, - "Subnets": { + "UnassignPrivateIpAddresses": { "request": { - "operation": "DescribeSubnets", + "operation": "UnassignPrivateIpAddresses", "params": [ - { "target":"Filters[0].Name", "sourceType":"string", "source":"vpc-id" }, - { "target":"Filters[0].Values[0]", "sourceType":"identifier", "source":"Id" } + { "target": "NetworkInterfaceId", "sourceType": "identifier", "source": "Id" } ] - }, + } + } + }, + "belongsTo": { + "Subnet": { "resource": { "type": "Subnet", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"Subnets[].SubnetId" } + { "target": "Id", "sourceType": "dataMember", "source": "SubnetId" } ] - }, - "path": "Subnets[]" + } }, - "SecurityGroups": { - "request": { - "operation": "DescribeSecurityGroups", - "params": [ - { "target":"Filters[0].Name", "sourceType":"string", "source":"vpc-id" }, - { "target":"Filters[0].Values[0]", "sourceType":"identifier", "source":"Id" } - ] - }, + "Vpc": { "resource": { - "type": "SecurityGroup", + "type": "Vpc", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"SecurityGroups[].GroupId" } + { "target": "Id", "sourceType": "dataMember", "source": "VpcId" } ] - }, - "path": "SecurityGroups[]" + } + } + } + }, + "PlacementGroup": { + "identifiers": [ + { + "name": "Name", + "memberName": "GroupName" + } + ], + "shape": "PlacementGroup", + "load": { + "request": { + "operation": "DescribePlacementGroups", + "params": [ + { "target": "GroupNames[0]", "sourceType": "identifier", "source": "Name" } + ] }, - "InternetGateways": { + "path": "PlacementGroups[0]" + }, + "actions": { + "Delete": { "request": { - "operation": "DescribeInternetGateways", + "operation": "DeletePlacementGroup", "params": [ - { "target":"Filters[0].Name", "sourceType":"string", "source":"attachment.vpc-id" }, - { "target":"Filters[0].Values[0]", "sourceType":"identifier", "source":"Id" } + { "target": "GroupName", "sourceType": "identifier", "source": "Name" } ] - }, - "resource": { - "type": "InternetGateway", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"InternetGateways[].InternetGatewayId" } - ] - }, - "path": "InternetGateways[]" - }, - "NetworkAcls": { + } + } + }, + "hasMany": { + "Instances": { "request": { - "operation": "DescribeNetworkAcls", + "operation": "DescribeInstances", "params": [ - { "target":"Filters[0].Name", "sourceType":"string", "source":"vpc-id" }, - { "target":"Filters[0].Values[0]", "sourceType":"identifier", "source":"Id" } + { "target": "Filters[0].Name", "sourceType": "string", "source": "placement-group-name" }, + { "target": "Filters[0].Values[0]", "sourceType": "identifier", "source": "Name" } ] }, "resource": { - "type": "NetworkAcl", + "type": "Instance", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"NetworkAcls[].NetworkAclId" } - ] - }, - "path": "NetworkAcls[]" + { "target": "Id", "sourceType": "responsePath", "source": "Reservations[].Instances[].InstanceId" } + ], + "path": "Reservations[].Instances[]" + } + } + } + }, + "RouteTable": { + "identifiers": [ + { + "name": "Id", + "memberName": "RouteTableId" + } + ], + "shape": "RouteTable", + "load": { + "request": { + "operation": "DescribeRouteTables", + "params": [ + { "target": "RouteTableIds[0]", "sourceType": "identifier", "source": "Id" } + ] }, - "NetworkInterfaces": { + "path": "RouteTables[0]" + }, + "actions": { + "AssociateWithSubnet": { "request": { - "operation": "DescribeNetworkInterfaces", + "operation": "AssociateRouteTable", "params": [ - { "target":"Filters[0].Name", "sourceType":"string", "source":"vpc-id" }, - { "target":"Filters[0].Values[0]", "sourceType":"identifier", "source":"Id" } + { "target": "RouteTableId", "sourceType": "identifier", "source": "Id" } ] }, "resource": { - "type": "NetworkInterface", + "type": "RouteTableAssociation", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"NetworkInterfaces[].NetworkInterfaceId" } + { "target": "Id", "sourceType": "responsePath", "source": "AssociationId" } ] - }, - "path": "NetworkInterfaces[]" + } }, - "RouteTables": { + "CreateRoute": { "request": { - "operation": "DescribeRouteTables", + "operation": "CreateRoute", "params": [ - { "target":"Filters[0].Name", "sourceType":"string", "source":"vpc-id" }, - { "target":"Filters[0].Values[0]", "sourceType":"identifier", "source":"Id" } - ] - }, - "resource": { - "type": "RouteTable", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"RouteTables[].RouteTableId" } + { "target": "RouteTableId", "sourceType": "identifier", "source": "Id" } ] - }, - "path": "RouteTables[]" + } }, - "RequestedVpcPeeringConnections": { + "CreateTags": { "request": { - "operation": "DescribeVpcPeeringConnections", + "operation": "CreateTags", "params": [ - { "target":"Filters[0].Name", "sourceType":"string", "source":"requester-vpc-info.vpc-id" }, - { "target":"Filters[0].Values[0]", "sourceType":"identifier", "source":"Id" } + { "target": "Resources[0]", "sourceType": "identifier", "source": "Id" } ] }, "resource": { - "type": "VpcPeeringConnection", + "type": "Tag", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"VpcPeeringConnections[].VpcPeeringConnectionId" } + { "target": "ResourceId", "sourceType": "identifier", "source": "Id" }, + { "target": "Key", "sourceType": "requestParameter", "source": "Tags[].Key" }, + { "target": "Value", "sourceType": "requestParameter", "source": "Tags[].Value" } ] - }, - "path": "VpcPeeringConnections[]" - }, - "AcceptedVpcPeeringConnections": { + } + } + }, + "hasMany": { + "Associations": { "request": { - "operation": "DescribeVpcPeeringConnections", + "operation": "DescribeRouteTables", "params": [ - { "target":"Filters[0].Name", "sourceType":"string", "source":"accepter-vpc-info.vpc-id" }, - { "target":"Filters[0].Values[0]", "sourceType":"identifier", "source":"Id" } + { "target": "RouteTableIds[0]", "sourceType": "identifier", "source": "Id" } ] }, "resource": { - "type": "VpcPeeringConnection", + "type": "RouteTableAssociation", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"VpcPeeringConnections[].VpcPeeringConnectionId" } - ] - }, - "path": "VpcPeeringConnections[]" + { "target": "Id", "sourceType": "responsePath", "source": "RouteTables[0].Associations[].RouteTableAssociationId" } + ], + "path": "RouteTables[0].Associations[]" + } } }, - "hasOne": { - "DhcpOptions": { + "belongsTo": { + "Vpc": { "resource": { - "type": "DhcpOptions", + "type": "Vpc", "identifiers": [ - { "target":"Id", "sourceType":"dataMember", "source":"DhcpOptionsId" } + { "target": "Id", "sourceType": "dataMember", "source": "VpcId" } ] } } } }, - "Image": { - "identifiers": [{ "name": "Id", "memberName" : "ImageId" }], - "shape": "Image", - "load": { - "request": { - "operation": "DescribeImages", - "params": [ - { "target":"ImageIds[0]", "sourceType":"identifier", "source":"Id" } - ] - }, - "path": "Images[0]" - }, + "RouteTableAssociation": { + "identifiers": [ + { + "name": "Id", + "memberName": "RouteTableAssociationId" + } + ], + "shape": "RouteTableAssociation", "actions": { - "Deregister": { + "Delete": { "request": { - "operation": "DeregisterImage", + "operation": "DisassociateRouteTable", "params": [ - { "target":"ImageId", "sourceType":"identifier", "source":"Id" } + { "target": "AssociationId", "sourceType": "identifier", "source": "Id" } ] } }, - "DescribeAttribute": { + "ReplaceSubnet": { "request": { - "operation": "DescribeImageAttribute", + "operation": "ReplaceRouteTableAssociation", "params": [ - { "target":"ImageId", "sourceType":"identifier", "source":"Id" } + { "target": "AssociationId", "sourceType": "identifier", "source": "Id" } ] - } - }, - "ModifyAttribute": { - "request": { - "operation": "ModifyImageAttribute", - "params": [ - { "target":"ImageId", "sourceType":"identifier", "source":"Id" } + }, + "resource": { + "type": "RouteTableAssociation", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "NewAssociationId" } ] } - }, - "ResetAttribute": { - "request": { - "operation": "ResetImageAttribute", - "params": [ - { "target":"ImageId", "sourceType":"identifier", "source":"Id" } + } + }, + "belongsTo": { + "RouteTable": { + "resource": { + "type": "RouteTable", + "identifiers": [ + { "target": "Id", "sourceType": "dataMember", "source": "RouteTableId" } ] } }, - "CreateTags": { - "request": { - "operation": "CreateTags", - "params": [ - { "target":"Resources[0]", "sourceType":"identifier", "source":"Id" } - ] - }, + "Subnet": { "resource": { - "type": "Tag", + "type": "Subnet", "identifiers": [ - { "target":"ResourceId", "sourceType":"identifier", "source":"Id" }, - { "target":"Key", "sourceType":"requestParameter", "source":"Tags[].Key" }, - { "target":"Value", "sourceType":"requestParameter", "source":"Tags[].Value" } + { "target": "Id", "sourceType": "dataMember", "source": "SubnetId" } ] } } } }, - "Volume": { - "identifiers": [{ "name": "Id", "memberName" : "VolumeId" }], - "shape": "Volume", + "SecurityGroup": { + "identifiers": [ + { + "name": "Id", + "memberName": "GroupId" + } + ], + "shape": "SecurityGroup", "load": { "request": { - "operation": "DescribeVolumes", + "operation": "DescribeSecurityGroups", "params": [ - { "target":"VolumeIds[0]", "sourceType":"identifier", "source":"Id" } + { "target": "GroupIds[0]", "sourceType": "identifier", "source": "Id" } ] }, - "path": "Volumes[0]" + "path": "SecurityGroups[0]" }, "actions": { - "CreateSnapshot": { - "request": { - "operation": "CreateSnapshot", - "params": [ - { "target":"VolumeId", "sourceType":"identifier", "source":"Id" } - ] - }, - "resource": { - "type": "Snapshot", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"SnapshotId" } - ] - }, - "path": "$" - }, - "AttachToInstance": { - "request": { - "operation": "AttachVolume", - "params": [ - { "target":"VolumeId", "sourceType":"identifier", "source":"Id" } - ] - } - }, - "DetachFromInstance": { + "AuthorizeEgress": { "request": { - "operation": "DetachVolume", + "operation": "AuthorizeSecurityGroupEgress", "params": [ - { "target":"VolumeId", "sourceType":"identifier", "source":"Id" } + { "target": "GroupId", "sourceType": "identifier", "source": "Id" } ] } }, - "DescribeAttribute": { + "AuthorizeIngress": { "request": { - "operation": "DescribeVolumeAttribute", + "operation": "AuthorizeSecurityGroupIngress", "params": [ - { "target":"VolumeId", "sourceType":"identifier", "source":"Id" } + { "target": "GroupId", "sourceType": "identifier", "source": "Id" } ] } }, - "ModifyAttribute": { + "CreateTags": { "request": { - "operation": "ModifyVolumeAttribute", + "operation": "CreateTags", "params": [ - { "target":"VolumeId", "sourceType":"identifier", "source":"Id" } + { "target": "Resources[0]", "sourceType": "identifier", "source": "Id" } ] - } - }, - "EnableIo": { - "request": { - "operation": "EnableVolumeIO", - "params": [ - { "target":"VolumeId", "sourceType":"identifier", "source":"Id" } + }, + "resource": { + "type": "Tag", + "identifiers": [ + { "target": "ResourceId", "sourceType": "identifier", "source": "Id" }, + { "target": "Key", "sourceType": "requestParameter", "source": "Tags[].Key" }, + { "target": "Value", "sourceType": "requestParameter", "source": "Tags[].Value" } ] } }, - "DescribeStatus": { + "Delete": { "request": { - "operation": "DescribeVolumeStatus", + "operation": "DeleteSecurityGroup", "params": [ - { "target":"VolumeIds[0]", "sourceType":"identifier", "source":"Id" } + { "target": "GroupId", "sourceType": "identifier", "source": "Id" } ] } }, - "CreateTags": { + "RevokeEgress": { "request": { - "operation": "CreateTags", - "params": [ - { "target":"Resources[0]", "sourceType":"identifier", "source":"Id" } - ] - }, - "resource": { - "type": "Tag", - "identifiers": [ - { "target":"ResourceId", "sourceType":"identifier", "source":"Id" }, - { "target":"Key", "sourceType":"requestParameter", "source":"Tags[].Key" }, - { "target":"Value", "sourceType":"requestParameter", "source":"Tags[].Value" } + "operation": "RevokeSecurityGroupEgress", + "params": [ + { "target": "GroupId", "sourceType": "identifier", "source": "Id" } ] } - } - }, - "hasMany": { - "Snapshots": { + }, + "RevokeIngress": { "request": { - "operation": "DescribeSnapshots", + "operation": "RevokeSecurityGroupIngress", "params": [ - { "target":"Filters[0].Name", "sourceType":"string", "source":"volume-id" }, - { "target":"Filters[0].Values[0]", "sourceType":"identifier", "source":"Id" } - ] - }, - "resource": { - "type": "Snapshot", - "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"Snapshots[].SnapshotId" } + { "target": "GroupId", "sourceType": "identifier", "source": "Id" } ] - }, - "path": "Snapshots[]" + } } } }, "Snapshot": { - "identifiers": [{ "name": "Id", "memberName" : "SnapshotId" }], + "identifiers": [ + { + "name": "Id", + "memberName": "SnapshotId" + } + ], "shape": "Snapshot", "load": { "request": { "operation": "DescribeSnapshots", "params": [ - { "target":"SnapshotIds[0]", "sourceType":"identifier", "source":"Id" } + { "target": "SnapshotIds[0]", "sourceType": "identifier", "source": "Id" } ] }, "path": "Snapshots[0]" @@ -1183,7 +1347,23 @@ "request": { "operation": "CopySnapshot", "params": [ - { "target":"SourceSnapshotId", "sourceType":"identifier", "source":"Id" } + { "target": "SourceSnapshotId", "sourceType": "identifier", "source": "Id" } + ] + } + }, + "CreateTags": { + "request": { + "operation": "CreateTags", + "params": [ + { "target": "Resources[0]", "sourceType": "identifier", "source": "Id" } + ] + }, + "resource": { + "type": "Tag", + "identifiers": [ + { "target": "ResourceId", "sourceType": "identifier", "source": "Id" }, + { "target": "Key", "sourceType": "requestParameter", "source": "Tags[].Key" }, + { "target": "Value", "sourceType": "requestParameter", "source": "Tags[].Value" } ] } }, @@ -1191,7 +1371,7 @@ "request": { "operation": "DeleteSnapshot", "params": [ - { "target":"SnapshotId", "sourceType":"identifier", "source":"Id" } + { "target": "SnapshotId", "sourceType": "identifier", "source": "Id" } ] } }, @@ -1199,7 +1379,7 @@ "request": { "operation": "DescribeSnapshotAttribute", "params": [ - { "target":"SnapshotId", "sourceType":"identifier", "source":"Id" } + { "target": "SnapshotId", "sourceType": "identifier", "source": "Id" } ] } }, @@ -1207,7 +1387,7 @@ "request": { "operation": "ModifySnapshotAttribute", "params": [ - { "target":"SnapshotId", "sourceType":"identifier", "source":"Id" } + { "target": "SnapshotId", "sourceType": "identifier", "source": "Id" } ] } }, @@ -1215,603 +1395,637 @@ "request": { "operation": "ResetSnapshotAttribute", "params": [ - { "target":"SnapshotId", "sourceType":"identifier", "source":"Id" } - ] - } - }, - "CreateTags": { - "request": { - "operation": "CreateTags", - "params": [ - { "target":"Resources[0]", "sourceType":"identifier", "source":"Id" } - ] - }, - "resource": { - "type": "Tag", - "identifiers": [ - { "target":"ResourceId", "sourceType":"identifier", "source":"Id" }, - { "target":"Key", "sourceType":"requestParameter", "source":"Tags[].Key" }, - { "target":"Value", "sourceType":"requestParameter", "source":"Tags[].Value" } + { "target": "SnapshotId", "sourceType": "identifier", "source": "Id" } ] } } }, - "hasOne": { + "belongsTo": { "Volume": { "resource": { "type": "Volume", "identifiers": [ - { "target":"Id", "sourceType":"dataMember", "source":"VolumeId" } + { "target": "Id", "sourceType": "dataMember", "source": "VolumeId" } ] } } } }, - "SecurityGroup": { - "identifiers": [{ "name": "Id", "memberName" : "GroupId" }], - "shape": "SecurityGroup", + "Subnet": { + "identifiers": [ + { + "name": "Id", + "memberName": "SubnetId" + } + ], + "shape": "Subnet", "load": { "request": { - "operation": "DescribeSecurityGroups", + "operation": "DescribeSubnets", "params": [ - { "target":"GroupIds[0]", "sourceType":"identifier", "source":"Id" } + { "target": "SubnetIds[0]", "sourceType": "identifier", "source": "Id" } ] }, - "path": "SecurityGroups[0]" + "path": "Subnets[0]" }, "actions": { - "Delete": { + "CreateInstances": { "request": { - "operation": "DeleteSecurityGroup", + "operation": "RunInstances", "params": [ - { "target":"GroupId", "sourceType":"identifier", "source":"Id" } + { "target": "SubnetId", "sourceType": "identifier", "source": "Id" } ] + }, + "resource": { + "type": "Instance", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "Instances[].InstanceId" } + ], + "path": "Instances[]" } }, - "AuthorizeEgress": { + "CreateNetworkInterface": { "request": { - "operation": "AuthorizeSecurityGroupEgress", + "operation": "CreateNetworkInterface", "params": [ - { "target":"GroupId", "sourceType":"identifier", "source":"Id" } + { "target": "SubnetId", "sourceType": "identifier", "source": "Id" } ] + }, + "resource": { + "type": "NetworkInterface", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "NetworkInterface.NetworkInterfaceId" } + ], + "path": "NetworkInterface" } }, - "AuthorizeIngress": { + "CreateTags": { "request": { - "operation": "AuthorizeSecurityGroupIngress", + "operation": "CreateTags", "params": [ - { "target":"GroupId", "sourceType":"identifier", "source":"Id" } + { "target": "Resources[0]", "sourceType": "identifier", "source": "Id" } + ] + }, + "resource": { + "type": "Tag", + "identifiers": [ + { "target": "ResourceId", "sourceType": "identifier", "source": "Id" }, + { "target": "Key", "sourceType": "requestParameter", "source": "Tags[].Key" }, + { "target": "Value", "sourceType": "requestParameter", "source": "Tags[].Value" } ] } }, - "RevokeEgress": { + "Delete": { "request": { - "operation": "RevokeSecurityGroupEgress", + "operation": "DeleteSubnet", "params": [ - { "target":"GroupId", "sourceType":"identifier", "source":"Id" } + { "target": "SubnetId", "sourceType": "identifier", "source": "Id" } ] } - }, - "RevokeIngress": { + } + }, + "hasMany": { + "Instances": { "request": { - "operation": "RevokeSecurityGroupIngress", + "operation": "DescribeInstances", "params": [ - { "target":"GroupId", "sourceType":"identifier", "source":"Id" } + { "target": "Filters[0].Name", "sourceType": "string", "source": "subnet-id" }, + { "target": "Filters[0].Values[0]", "sourceType": "identifier", "source": "Id" } ] + }, + "resource": { + "type": "Instance", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "Reservations[].Instances[].InstanceId" } + ], + "path": "Reservations[].Instances[]" } }, - "CreateTags": { + "NetworkInterfaces": { "request": { - "operation": "CreateTags", + "operation": "DescribeNetworkInterfaces", "params": [ - { "target":"Resources[0]", "sourceType":"identifier", "source":"Id" } + { "target": "Filters[0].Name", "sourceType": "string", "source": "subnet-id" }, + { "target": "Filters[0].Values[0]", "sourceType": "identifier", "source": "Id" } ] }, "resource": { - "type": "Tag", + "type": "NetworkInterface", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "NetworkInterfaces[].NetworkInterfaceId" } + ], + "path": "NetworkInterfaces[]" + } + } + }, + "belongsTo": { + "Vpc": { + "resource": { + "type": "Vpc", "identifiers": [ - { "target":"ResourceId", "sourceType":"identifier", "source":"Id" }, - { "target":"Key", "sourceType":"requestParameter", "source":"Tags[].Key" }, - { "target":"Value", "sourceType":"requestParameter", "source":"Tags[].Value" } + { "target": "Id", "sourceType": "dataMember", "source": "VpcId" } ] } } } }, - "DhcpOptions": { - "identifiers": [{ "name": "Id", "memberName" : "DhcpOptionsId" }], - "shape": "DhcpOptions", + "Tag": { + "identifiers": [ + { + "name": "ResourceId", + "memberName": "ResourceId" + }, + { + "name": "Key", + "memberName": "Key" + }, + { + "name": "Value", + "memberName": "Value" + } + ], + "shape": "TagDescription", "load": { "request": { - "operation": "DescribeDhcpOptions", + "operation": "DescribeTags", "params": [ - { "target":"DhcpOptionsIds[0]", "sourceType":"identifier", "source":"Id" } + { "target": "Filters[0].Name", "sourceType": "string", "source": "key" }, + { "target": "Filters[0].Values[0]", "sourceType": "identifier", "source": "Key" }, + { "target": "Filters[1].Name", "sourceType": "string", "source": "value" }, + { "target": "Filters[1].Values[0]", "sourceType": "identifier", "source": "Value" } ] }, - "path": "DhcpOptions[0]" + "path": "Tags[0]" }, "actions": { - "AssociateWithVpc": { - "request": { - "operation": "AssociateDhcpOptions", - "params": [ - { "target":"DhcpOptionsId", "sourceType":"identifier", "source":"Id" } - ] - } - }, "Delete": { "request": { - "operation": "DeleteDhcpOptions", + "operation": "DeleteTags", "params": [ - { "target":"DhcpOptionsId", "sourceType":"identifier", "source":"Id" } + { "target": "Resources[0]", "sourceType": "identifier", "source": "ResourceId" }, + { "target": "Tags[0].Key", "sourceType": "identifier", "source": "Key" }, + { "target": "Tags[0].Value", "sourceType": "identifier", "source": "Value" } ] } - }, - "CreateTags": { + } + }, + "batchActions": { + "Delete": { "request": { - "operation": "CreateTags", + "operation": "DeleteTags", "params": [ - { "target":"Resources[0]", "sourceType":"identifier", "source":"Id" } - ] - }, - "resource": { - "type": "Tag", - "identifiers": [ - { "target":"ResourceId", "sourceType":"identifier", "source":"Id" }, - { "target":"Key", "sourceType":"requestParameter", "source":"Tags[].Key" }, - { "target":"Value", "sourceType":"requestParameter", "source":"Tags[].Value" } + { "target": "Resources[]", "sourceType": "identifier", "source": "ResourceId" }, + { "target": "Tags[*].Key", "sourceType": "identifier", "source": "Key" }, + { "target": "Tags[*].Value", "sourceType": "identifier", "source": "Value" } ] } } } }, - "InternetGateway": { - "identifiers": [{ "name": "Id", "memberName" : "InternetGatewayId" }], - "shape": "InternetGateway", + "Volume": { + "identifiers": [ + { + "name": "Id", + "memberName": "VolumeId" + } + ], + "shape": "Volume", "load": { "request": { - "operation": "DescribeInternetGateways", + "operation": "DescribeVolumes", "params": [ - { "target":"InternetGatewayIds[0]", "sourceType":"identifier", "source":"Id" } + { "target": "VolumeIds[0]", "sourceType": "identifier", "source": "Id" } ] }, - "path": "InternetGateways[0]" + "path": "Volumes[0]" }, "actions": { - "AttachToVpc": { - "request": { - "operation": "AttachInternetGateway", - "params": [ - { "target":"InternetGatewayId", "sourceType":"identifier", "source":"Id" } - ] - } - }, - "DetachFromVpc": { + "AttachToInstance": { "request": { - "operation": "DetachInternetGateway", + "operation": "AttachVolume", "params": [ - { "target":"InternetGatewayId", "sourceType":"identifier", "source":"Id" } + { "target": "VolumeId", "sourceType": "identifier", "source": "Id" } ] } }, - "Delete": { + "CreateSnapshot": { "request": { - "operation": "DeleteInternetGateway", + "operation": "CreateSnapshot", "params": [ - { "target":"InternetGatewayId", "sourceType":"identifier", "source":"Id" } + { "target": "VolumeId", "sourceType": "identifier", "source": "Id" } ] + }, + "resource": { + "type": "Snapshot", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "SnapshotId" } + ], + "path": "$" } }, "CreateTags": { "request": { "operation": "CreateTags", "params": [ - { "target":"Resources[0]", "sourceType":"identifier", "source":"Id" } + { "target": "Resources[0]", "sourceType": "identifier", "source": "Id" } ] }, "resource": { "type": "Tag", "identifiers": [ - { "target":"ResourceId", "sourceType":"identifier", "source":"Id" }, - { "target":"Key", "sourceType":"requestParameter", "source":"Tags[].Key" }, - { "target":"Value", "sourceType":"requestParameter", "source":"Tags[].Value" } + { "target": "ResourceId", "sourceType": "identifier", "source": "Id" }, + { "target": "Key", "sourceType": "requestParameter", "source": "Tags[].Key" }, + { "target": "Value", "sourceType": "requestParameter", "source": "Tags[].Value" } ] } - } - } - }, - "KeyPair": { - "identifiers": [{ "name": "Name", "memberName" : "KeyName" }], - "shape": "KeyPairInfo", - "load": { - "request": { - "operation": "DescribeKeyPairs", - "params": [ - { "target":"KeyNames[0]", "sourceType":"identifier", "source":"Name" } - ] }, - "path": "KeyPairs[0]" - }, - "actions": { - "Delete": { + "DescribeAttribute": { "request": { - "operation": "DeleteKeyPair", + "operation": "DescribeVolumeAttribute", "params": [ - { "target":"KeyName", "sourceType":"identifier", "source":"Name" } + { "target": "VolumeId", "sourceType": "identifier", "source": "Id" } ] } - } - } - }, - "NetworkAcl": { - "identifiers": [{ "name": "Id", "memberName" : "NetworkAclId" }], - "shape": "NetworkAcl", - "load": { - "request": { - "operation": "DescribeNetworkAcls", - "params": [ - { "target":"NetworkAclIds[0]", "sourceType":"identifier", "source":"Id" } - ] }, - "path": "NetworkAcls[0]" - }, - "actions": { - "Delete": { + "DescribeStatus": { "request": { - "operation": "DeleteNetworkAcl", + "operation": "DescribeVolumeStatus", "params": [ - { "target":"NetworkAclId", "sourceType":"identifier", "source":"Id" } + { "target": "VolumeIds[0]", "sourceType": "identifier", "source": "Id" } ] } }, - "CreateEntry": { + "DetachFromInstance": { "request": { - "operation": "CreateNetworkAclEntry", + "operation": "DetachVolume", "params": [ - { "target":"NetworkAclId", "sourceType":"identifier", "source":"Id" } + { "target": "VolumeId", "sourceType": "identifier", "source": "Id" } ] } }, - "DeleteEntry": { + "EnableIo": { "request": { - "operation": "DeleteNetworkAclEntry", + "operation": "EnableVolumeIO", "params": [ - { "target":"NetworkAclId", "sourceType":"identifier", "source":"Id" } + { "target": "VolumeId", "sourceType": "identifier", "source": "Id" } ] } }, - "ReplaceEntry": { + "ModifyAttribute": { "request": { - "operation": "ReplaceNetworkAclEntry", + "operation": "ModifyVolumeAttribute", + "params": [ + { "target": "VolumeId", "sourceType": "identifier", "source": "Id" } + ] + } + } + }, + "hasMany": { + "Snapshots": { + "request": { + "operation": "DescribeSnapshots", + "params": [ + { "target": "Filters[0].Name", "sourceType": "string", "source": "volume-id" }, + { "target": "Filters[0].Values[0]", "sourceType": "identifier", "source": "Id" } + ] + }, + "resource": { + "type": "Snapshot", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "Snapshots[].SnapshotId" } + ], + "path": "Snapshots[]" + } + } + } + }, + "Vpc": { + "identifiers": [ + { + "name": "Id", + "memberName": "VpcId" + } + ], + "shape": "Vpc", + "load": { + "request": { + "operation": "DescribeVpcs", + "params": [ + { "target": "VpcIds[0]", "sourceType": "identifier", "source": "Id" } + ] + }, + "path": "Vpcs[0]" + }, + "actions": { + "AssociateDhcpOptions": { + "request": { + "operation": "AssociateDhcpOptions", "params": [ - { "target":"NetworkAclId", "sourceType":"identifier", "source":"Id" } + { "target": "VpcId", "sourceType": "identifier", "source": "Id" } ] } }, - "ReplaceAssociation": { + "AttachInternetGateway": { "request": { - "operation": "ReplaceNetworkAclAssociation", + "operation": "AttachInternetGateway", "params": [ - { "target":"NetworkAclId", "sourceType":"identifier", "source":"Id" } + { "target": "VpcId", "sourceType": "identifier", "source": "Id" } ] } }, - "CreateTags": { + "CreateNetworkAcl": { "request": { - "operation": "CreateTags", + "operation": "CreateNetworkAcl", "params": [ - { "target":"Resources[0]", "sourceType":"identifier", "source":"Id" } + { "target": "VpcId", "sourceType": "identifier", "source": "Id" } ] }, "resource": { - "type": "Tag", - "identifiers": [ - { "target":"ResourceId", "sourceType":"identifier", "source":"Id" }, - { "target":"Key", "sourceType":"requestParameter", "source":"Tags[].Key" }, - { "target":"Value", "sourceType":"requestParameter", "source":"Tags[].Value" } - ] - } - } - }, - "hasOne": { - "Vpc": { - "resource": { - "type": "Vpc", + "type": "NetworkAcl", "identifiers": [ - { "target":"Id", "sourceType":"dataMember", "source":"VpcId" } - ] + { "target": "Id", "sourceType": "responsePath", "source": "NetworkAcl.NetworkAclId" } + ], + "path": "NetworkAcl" } - } - } - }, - "NetworkInterface": { - "identifiers": [{ "name": "Id", "memberName" : "NetworkInterfaceId" }], - "shape": "NetworkInterface", - "load": { - "request": { - "operation": "DescribeNetworkInterfaces", - "params": [ - { "target":"NetworkInterfaceIds[0]", "sourceType":"identifier", "source":"Id" } - ] }, - "path": "NetworkInterfaces[0]" - }, - "actions": { - "Attach": { + "CreateRouteTable": { "request": { - "operation": "AttachNetworkInterface", + "operation": "CreateRouteTable", "params": [ - { "target":"NetworkInterfaceId", "sourceType":"identifier", "source":"Id" } + { "target": "VpcId", "sourceType": "identifier", "source": "Id" } ] + }, + "resource": { + "type": "RouteTable", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "RouteTable.RouteTableId" } + ], + "path": "RouteTable" } }, - "Detach": { + "CreateSecurityGroup": { "request": { - "operation": "DetachNetworkInterface", + "operation": "CreateSecurityGroup", "params": [ - { "target":"AttachmentId", "sourceType":"dataMember", "source":"Attachment.AttachmentId" } + { "target": "VpcId", "sourceType": "identifier", "source": "Id" } + ] + }, + "resource": { + "type": "SecurityGroup", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "GroupId" } ] } }, - "AssignPrivateIpAddresses": { + "CreateSubnet": { "request": { - "operation": "AssignPrivateIpAddresses", + "operation": "CreateSubnet", "params": [ - { "target":"NetworkInterfaceId", "sourceType":"identifier", "source":"Id" } + { "target": "VpcId", "sourceType": "identifier", "source": "Id" } ] + }, + "resource": { + "type": "Subnet", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "Subnet.SubnetId" } + ], + "path": "Subnet" } }, - "UnassignPrivateIpAddresses": { + "CreateTags": { "request": { - "operation": "UnassignPrivateIpAddresses", + "operation": "CreateTags", "params": [ - { "target":"NetworkInterfaceId", "sourceType":"identifier", "source":"Id" } + { "target": "Resources[0]", "sourceType": "identifier", "source": "Id" } + ] + }, + "resource": { + "type": "Tag", + "identifiers": [ + { "target": "ResourceId", "sourceType": "identifier", "source": "Id" }, + { "target": "Key", "sourceType": "requestParameter", "source": "Tags[].Key" }, + { "target": "Value", "sourceType": "requestParameter", "source": "Tags[].Value" } ] } }, "Delete": { "request": { - "operation": "DeleteNetworkInterface", + "operation": "DeleteVpc", "params": [ - { "target":"NetworkInterfaceId", "sourceType":"identifier", "source":"Id" } + { "target": "VpcId", "sourceType": "identifier", "source": "Id" } ] } }, "DescribeAttribute": { "request": { - "operation": "DescribeNetworkInterfaceAttribute", + "operation": "DescribeVpcAttribute", "params": [ - { "target":"NetworkInterfaceId", "sourceType":"identifier", "source":"Id" } + { "target": "VpcId", "sourceType": "identifier", "source": "Id" } ] } }, - "ModifyAttribute": { + "DetachInternetGateway": { "request": { - "operation": "ModifyNetworkInterfaceAttribute", + "operation": "DetachInternetGateway", "params": [ - { "target":"NetworkInterfaceId", "sourceType":"identifier", "source":"Id" } + { "target": "VpcId", "sourceType": "identifier", "source": "Id" } ] } }, - "ResetAttribute": { + "ModifyAttribute": { "request": { - "operation": "ResetNetworkInterfaceAttribute", + "operation": "ModifyVpcAttribute", "params": [ - { "target":"NetworkInterfaceId", "sourceType":"identifier", "source":"Id" } + { "target": "VpcId", "sourceType": "identifier", "source": "Id" } ] } }, - "CreateTags": { + "RequestVpcPeeringConnection": { "request": { - "operation": "CreateTags", + "operation": "CreateVpcPeeringConnection", "params": [ - { "target":"Resources[0]", "sourceType":"identifier", "source":"Id" } + { "target": "VpcId", "sourceType": "identifier", "source": "Id" } ] }, "resource": { - "type": "Tag", + "type": "VpcPeeringConnection", "identifiers": [ - { "target":"ResourceId", "sourceType":"identifier", "source":"Id" }, - { "target":"Key", "sourceType":"requestParameter", "source":"Tags[].Key" }, - { "target":"Value", "sourceType":"requestParameter", "source":"Tags[].Value" } - ] + { "target": "Id", "sourceType": "responsePath", "source": "VpcPeeringConnection.VpcPeeringConnectionId" } + ], + "path": "VpcPeeringConnection" } } }, - "hasOne": { - "Subnet": { - "resource": { - "type": "Subnet", - "identifiers": [ - { "target":"Id", "sourceType":"dataMember", "source":"SubnetId" } + "hasMany": { + "AcceptedVpcPeeringConnections": { + "request": { + "operation": "DescribeVpcPeeringConnections", + "params": [ + { "target": "Filters[0].Name", "sourceType": "string", "source": "accepter-vpc-info.vpc-id" }, + { "target": "Filters[0].Values[0]", "sourceType": "identifier", "source": "Id" } ] - } - }, - "Vpc": { + }, "resource": { - "type": "Vpc", + "type": "VpcPeeringConnection", "identifiers": [ - { "target":"Id", "sourceType":"dataMember", "source":"VpcId" } - ] + { "target": "Id", "sourceType": "responsePath", "source": "VpcPeeringConnections[].VpcPeeringConnectionId" } + ], + "path": "VpcPeeringConnections[]" } - } - } - }, - "PlacementGroup": { - "identifiers": [{ "name": "Name", "memberName" : "GroupName" }], - "shape": "PlacementGroup", - "load": { - "request": { - "operation": "DescribePlacementGroups", - "params": [ - { "target":"GroupNames[0]", "sourceType":"identifier", "source":"Name" } - ] }, - "path": "PlacementGroups[0]" - }, - "actions": { - "Delete": { - "request": { - "operation": "DeletePlacementGroup", - "params": [ - { "target":"GroupName", "sourceType":"identifier", "source":"Name" } - ] - } - } - }, - "hasMany": { "Instances": { "request": { "operation": "DescribeInstances", "params": [ - { "target":"Filters[0].Name", "sourceType":"string", "source":"placement-group-name" }, - { "target":"Filters[0].Values[0]", "sourceType":"identifier", "source":"Name" } + { "target": "Filters[0].Name", "sourceType": "string", "source": "vpc-id" }, + { "target": "Filters[0].Values[0]", "sourceType": "identifier", "source": "Id" } ] }, "resource": { "type": "Instance", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"Reservations[].Instances[].InstanceId" } - ] - }, - "path": "Reservations[].Instances[]" - } - } - }, - "RouteTable": { - "identifiers": [{ "name": "Id", "memberName" : "RouteTableId" }], - "shape": "RouteTable", - "load": { - "request": { - "operation": "DescribeRouteTables", - "params": [ - { "target":"RouteTableIds[0]", "sourceType":"identifier", "source":"Id" } - ] + { "target": "Id", "sourceType": "responsePath", "source": "Reservations[].Instances[].InstanceId" } + ], + "path": "Reservations[].Instances[]" + } }, - "path": "RouteTables[0]" - }, - "actions": { - "CreateRoute": { + "InternetGateways": { "request": { - "operation": "CreateRoute", + "operation": "DescribeInternetGateways", "params": [ - { "target":"RouteTableId", "sourceType":"identifier", "source":"Id" } + { "target": "Filters[0].Name", "sourceType": "string", "source": "attachment.vpc-id" }, + { "target": "Filters[0].Values[0]", "sourceType": "identifier", "source": "Id" } ] + }, + "resource": { + "type": "InternetGateway", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "InternetGateways[].InternetGatewayId" } + ], + "path": "InternetGateways[]" } }, - "AssociateWithSubnet": { + "NetworkAcls": { "request": { - "operation": "AssociateRouteTable", + "operation": "DescribeNetworkAcls", "params": [ - { "target":"RouteTableId", "sourceType":"identifier", "source":"Id" } + { "target": "Filters[0].Name", "sourceType": "string", "source": "vpc-id" }, + { "target": "Filters[0].Values[0]", "sourceType": "identifier", "source": "Id" } ] }, "resource": { - "type": "RouteTableAssociation", + "type": "NetworkAcl", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"AssociationId" } - ] + { "target": "Id", "sourceType": "responsePath", "source": "NetworkAcls[].NetworkAclId" } + ], + "path": "NetworkAcls[]" } }, - "CreateTags": { + "NetworkInterfaces": { "request": { - "operation": "CreateTags", + "operation": "DescribeNetworkInterfaces", "params": [ - { "target":"Resources[0]", "sourceType":"identifier", "source":"Id" } + { "target": "Filters[0].Name", "sourceType": "string", "source": "vpc-id" }, + { "target": "Filters[0].Values[0]", "sourceType": "identifier", "source": "Id" } ] }, "resource": { - "type": "Tag", + "type": "NetworkInterface", "identifiers": [ - { "target":"ResourceId", "sourceType":"identifier", "source":"Id" }, - { "target":"Key", "sourceType":"requestParameter", "source":"Tags[].Key" }, - { "target":"Value", "sourceType":"requestParameter", "source":"Tags[].Value" } - ] + { "target": "Id", "sourceType": "responsePath", "source": "NetworkInterfaces[].NetworkInterfaceId" } + ], + "path": "NetworkInterfaces[]" } - } - }, - "hasOne": { - "Vpc": { + }, + "RequestedVpcPeeringConnections": { + "request": { + "operation": "DescribeVpcPeeringConnections", + "params": [ + { "target": "Filters[0].Name", "sourceType": "string", "source": "requester-vpc-info.vpc-id" }, + { "target": "Filters[0].Values[0]", "sourceType": "identifier", "source": "Id" } + ] + }, "resource": { - "type": "Vpc", + "type": "VpcPeeringConnection", "identifiers": [ - { "target":"Id", "sourceType":"dataMember", "source":"VpcId" } - ] + { "target": "Id", "sourceType": "responsePath", "source": "VpcPeeringConnections[].VpcPeeringConnectionId" } + ], + "path": "VpcPeeringConnections[]" } - } - }, - "hasMany": { - "Associations": { + }, + "RouteTables": { "request": { "operation": "DescribeRouteTables", "params": [ - { "target":"RouteTableIds[0]", "sourceType":"identifier", "source":"Id" } + { "target": "Filters[0].Name", "sourceType": "string", "source": "vpc-id" }, + { "target": "Filters[0].Values[0]", "sourceType": "identifier", "source": "Id" } ] }, "resource": { - "type": "RouteTableAssociation", + "type": "RouteTable", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"RouteTables[0].Associations[].RouteTableAssociationId" } - ] - }, - "path": "RouteTables[0].Associations[]" - } - } - }, - "RouteTableAssociation": { - "identifiers": [{ "name": "Id", "memberName" : "RouteTableAssociationId" }], - "shape": "RouteTableAssociation", - "actions": { - "ReplaceSubnet": { + { "target": "Id", "sourceType": "responsePath", "source": "RouteTables[].RouteTableId" } + ], + "path": "RouteTables[]" + } + }, + "SecurityGroups": { "request": { - "operation": "ReplaceRouteTableAssociation", + "operation": "DescribeSecurityGroups", "params": [ - { "target":"AssociationId", "sourceType":"identifier", "source":"Id" } + { "target": "Filters[0].Name", "sourceType": "string", "source": "vpc-id" }, + { "target": "Filters[0].Values[0]", "sourceType": "identifier", "source": "Id" } ] }, "resource": { - "type": "RouteTableAssociation", + "type": "SecurityGroup", "identifiers": [ - { "target":"Id", "sourceType":"responsePath", "source":"NewAssociationId" } - ] + { "target": "Id", "sourceType": "responsePath", "source": "SecurityGroups[].GroupId" } + ], + "path": "SecurityGroups[]" } }, - "Delete": { + "Subnets": { "request": { - "operation": "DisassociateRouteTable", + "operation": "DescribeSubnets", "params": [ - { "target":"AssociationId", "sourceType":"identifier", "source":"Id" } + { "target": "Filters[0].Name", "sourceType": "string", "source": "vpc-id" }, + { "target": "Filters[0].Values[0]", "sourceType": "identifier", "source": "Id" } ] - } - } - }, - "hasOne": { - "RouteTable": { + }, "resource": { - "type": "RouteTable", + "type": "Subnet", "identifiers": [ - { "target":"Id", "sourceType":"dataMember", "source":"RouteTableId" } - ] + { "target": "Id", "sourceType": "responsePath", "source": "Subnets[].SubnetId" } + ], + "path": "Subnets[]" } - }, - "Subnet": { + } + }, + "belongsTo": { + "DhcpOptions": { "resource": { - "type": "Subnet", + "type": "DhcpOptions", "identifiers": [ - { "target":"Id", "sourceType":"dataMember", "source":"SubnetId" } + { "target": "Id", "sourceType": "dataMember", "source": "DhcpOptionsId" } ] } } } }, "VpcPeeringConnection": { - "identifiers": [{ "name": "Id", "memberName" : "VpcPeeringConnectionId" }], + "identifiers": [ + { + "name": "Id", + "memberName": "VpcPeeringConnectionId" + } + ], "shape": "VpcPeeringConnection", "load": { "request": { "operation": "DescribeVpcPeeringConnections", "params": [ - { "target":"VpcPeeringConnectionIds[0]", "sourceType":"identifier", "source":"Id" } + { "target": "VpcPeeringConnectionIds[0]", "sourceType": "identifier", "source": "Id" } ] }, "path": "VpcPeeringConnections[0]" @@ -1821,73 +2035,41 @@ "request": { "operation": "AcceptVpcPeeringConnection", "params": [ - { "target":"VpcPeeringConnectionId", "sourceType":"identifier", "source":"Id" } + { "target": "VpcPeeringConnectionId", "sourceType": "identifier", "source": "Id" } ] } }, - "Reject": { + "Delete": { "request": { - "operation": "RejectVpcPeeringConnection", + "operation": "DeleteVpcPeeringConnection", "params": [ - { "target":"VpcPeeringConnectionId", "sourceType":"identifier", "source":"Id" } + { "target": "VpcPeeringConnectionId", "sourceType": "identifier", "source": "Id" } ] } }, - "Delete": { + "Reject": { "request": { - "operation": "DeleteVpcPeeringConnection", + "operation": "RejectVpcPeeringConnection", "params": [ - { "target":"VpcPeeringConnectionId", "sourceType":"identifier", "source":"Id" } + { "target": "VpcPeeringConnectionId", "sourceType": "identifier", "source": "Id" } ] } } }, - "hasOne": { - "RequesterVpc": { + "belongsTo": { + "AccepterVpc": { "resource": { "type": "Vpc", "identifiers": [ - { "target":"Id", "sourceType":"dataMember", "source":"RequesterVpcInfo.VpcId" } + { "target": "Id", "sourceType": "dataMember", "source": "AccepterVpcInfo.VpcId" } ] } }, - "AccepterVpc": { + "RequesterVpc": { "resource": { "type": "Vpc", "identifiers": [ - { "target":"Id", "sourceType":"dataMember", "source":"AccepterVpcInfo.VpcId" } - ] - } - } - } - }, - "Tag": { - "identifiers": [ - { "name": "ResourceId", "memberName" : "ResourceId" }, - { "name": "Key", "memberName" : "Key" }, - { "name": "Value", "memberName" : "Value" } - ], - "shape": "TagDescription", - "load": { - "request": { - "operation": "DescribeTags", - "params": [ - { "target":"Filters[0].Name", "sourceType":"string", "source":"key" }, - { "target":"Filters[0].Values[0]", "sourceType":"identifier", "source":"Key" }, - { "target":"Filters[1].Name", "sourceType":"string", "source":"value" }, - { "target":"Filters[1].Values[0]", "sourceType":"identifier", "source":"Value" } - ] - }, - "path": "Tags[0]" - }, - "actions": { - "Delete": { - "request": { - "operation": "DeleteTags", - "params": [ - { "target":"Resources[0]", "sourceType":"identifier", "source":"ResourceId" }, - { "target":"Tags[0].Key", "sourceType":"identifier", "source":"Key" }, - { "target":"Tags[0].Value", "sourceType":"identifier", "source":"Value" } + { "target": "Id", "sourceType": "dataMember", "source": "RequesterVpcInfo.VpcId" } ] } } diff --git a/boto3/data/resources/glacier-2012-06-01.resources.json b/boto3/data/resources/glacier-2012-06-01.resources.json index 1b20548c30..de902ee499 100644 --- a/boto3/data/resources/glacier-2012-06-01.resources.json +++ b/boto3/data/resources/glacier-2012-06-01.resources.json @@ -1,440 +1,453 @@ { - "service" : { - "actions" : { - "CreateVault" : { - "request" : { - "operation" : "CreateVault", + "service": { + "actions": { + "CreateVault": { + "request": { + "operation": "CreateVault", "params": [ - { "target":"accountId", "sourceType":"string", "source":"-"} + { "target": "accountId", "sourceType": "string", "source": "-" } ] }, - "resource" : { - "type" : "Vault", - "identifiers" : [ - { "target":"AccountId", "sourceType":"requestParameter", "source":"accountId"}, - { "target":"Name", "sourceType":"requestParameter", "source":"vaultName"} + "resource": { + "type": "Vault", + "identifiers": [ + { "target": "AccountId", "sourceType": "requestParameter", "source": "accountId" }, + { "target": "Name", "sourceType": "requestParameter", "source": "vaultName" } ] } } }, - "hasMany" : { - "Vaults" : { - "request" : { - "operation" : "ListVaults", + "hasMany": { + "Vaults": { + "request": { + "operation": "ListVaults", "params": [ - { "target":"accountId", "sourceType":"string", "source":"-"} + { "target": "accountId", "sourceType": "string", "source": "-" } ] }, - "resource" : { - "type" : "Vault", - "identifiers" : [ - { "target":"AccountId", "sourceType":"requestParameter", "source":"accountId"}, - { "target":"Name", "sourceType":"responsePath", "source":"VaultList[].VaultName"} - ] - }, - "path" : "VaultList[]" + "resource": { + "type": "Vault", + "identifiers": [ + { "target": "AccountId", "sourceType": "requestParameter", "source": "accountId" }, + { "target": "Name", "sourceType": "responsePath", "source": "VaultList[].VaultName" } + ], + "path": "VaultList[]" + } } } }, - "resources" : { + "resources": { "Account": { - "identifiers" : [ + "identifiers": [ { "name": "Id" } ], - "subResources": { - "resources": ["Vault"], - "identifiers": { "Id": "AccountId" } + "actions": { + "CreateVault": { + "request": { "operation": "CreateVault" }, + "resource": { + "type": "Vault", + "identifiers": [ + { "target": "AccountId", "sourceType": "identifier", "source": "Id" }, + { "target": "Name", "sourceType": "requestParameter", "source": "vaultName" } + ] + } + } }, - "actions" : { - "CreateVault" : { - "request" : { "operation" : "CreateVault" }, - "resource" : { - "type" : "Vault", - "identifiers" : [ - { "target":"AccountId", "sourceType":"identifier", "source":"Id"}, - { "target":"Name", "sourceType":"requestParameter", "source":"vaultName"} - ] + "hasMany": { + "Vaults": { + "request": { "operation": "ListVaults" }, + "resource": { + "type": "Vault", + "identifiers": [ + { "target": "AccountId", "sourceType": "requestParameter", "source": "accountId" }, + { "target": "Name", "sourceType": "responsePath", "source": "VaultList[].VaultName" } + ], + "path": "VaultList[]" } } }, - "hasMany" : { - "Vaults" : { - "request" : { "operation" : "ListVaults" }, - "resource" : { - "type" : "Vault", - "identifiers" : [ - { "target":"AccountId", "sourceType":"requestParameter", "source":"accountId"}, - { "target":"Name", "sourceType":"responsePath", "source":"VaultList[].VaultName"} - ] + "subResources": { + "resources": [ "Vault" ], + "identifiers": { "Id": "AccountId" } + } + }, + "Archive": { + "identifiers": [ + { "name": "AccountId" }, + { "name": "VaultName" }, + { "name": "Id" } + ], + "actions": { + "Delete": { + "request": { + "operation": "DeleteArchive", + "params": [ + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "vaultName", "sourceType": "identifier", "source": "VaultName" }, + { "target": "archiveId", "sourceType": "identifier", "source": "Id" } + ] + } + }, + "InitiateArchiveRetreival": { + "request": { + "operation": "InitiateJob", + "params": [ + { "target": "vaultName", "sourceType": "identifier", "source": "Name" }, + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "jobParameters.Type", "sourceType": "string", "source": "archive-retrieval" }, + { "target": "jobParameters.ArchiveId", "sourceType": "identifier", "source": "Id" } + ] }, - "path" : "VaultList[]" + "resource": { + "type": "Job", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "jobId" }, + { "target": "AccountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "VaultName", "sourceType": "identifier", "source": "Name" } + ] + } } } }, - "Vault" : { - "identifiers" : [ - { "name":"AccountId" }, - { "name":"Name", "memberName" : "VaultName"} + "Job": { + "identifiers": [ + { "name": "AccountId" }, + { "name": "VaultName" }, + { + "name": "Id", + "memberName": "JobId" + } ], - "shape" : "DescribeVaultOutput", - "load" : { - "request" : { - "operation" : "DescribeVault", - "params" : [ - { "target" : "vaultName", "sourceType" : "identifier", "source" : "Name"}, - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId"} - ] + "shape": "GlacierJobDescription", + "load": { + "request": { + "operation": "DescribeJob", + "params": [ + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "vaultName", "sourceType": "identifier", "source": "VaultName" }, + { "target": "jobId", "sourceType": "identifier", "source": "Id" } + ] }, - "path" : "$" + "path": "$" }, - "actions" : { - "Create" : { - "request" : { - "operation" : "CreateVault", - "params" : [ - { "target" : "vaultName", "sourceType" : "identifier", "source" : "Name"}, - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId"} - ] + "actions": { + "GetOutput": { + "request": { + "operation": "GetJobOutput", + "params": [ + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "vaultName", "sourceType": "identifier", "source": "VaultName" }, + { "target": "jobId", "sourceType": "identifier", "source": "Id" } + ] } - }, - "Delete" : { - "request" : { - "operation" : "DeleteVault", - "params" : [ - { "target" : "vaultName", "sourceType" : "identifier", "source" : "Name"}, - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId"} - ] + } + } + }, + "MultipartUpload": { + "identifiers": [ + { "name": "AccountId" }, + { "name": "VaultName" }, + { + "name": "Id", + "memberName": "MultipartUploadId" + } + ], + "shape": "UploadListElement", + "actions": { + "Abort": { + "request": { + "operation": "AbortMultipartUpload", + "params": [ + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "vaultName", "sourceType": "identifier", "source": "VaultName" }, + { "target": "uploadId", "sourceType": "identifier", "source": "Id" } + ] } }, - "UploadArchive" : { - "request" : { - "operation" : "UploadArchive", - "params" : [ - { "target" : "vaultName", "sourceType" : "identifier", "source" : "Name"}, - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId"} - ] - }, - "resource" : { - "type" : "Archive", - "identifiers" : [ - { "target" : "Id", "sourceType" : "responsePath", "source" : "archiveId" }, - { "target" : "AccountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "VaultName", "sourceType" : "identifier", "source" : "Name" } + "Complete": { + "request": { + "operation": "CompleteMultipartUpload", + "params": [ + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "vaultName", "sourceType": "identifier", "source": "VaultName" }, + { "target": "uploadId", "sourceType": "identifier", "source": "Id" } ] - }, - "path" : "$" + } }, - "InitiateInventoryRetrieval" : { - "request" : { - "operation" : "InitiateJob", - "params" : [ - { "target" : "vaultName", "sourceType" : "identifier", "source" : "Name" }, - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "jobParameters.Type", "sourceType" : "string", "source" : "inventory-retrieval" } + "Parts": { + "request": { + "operation": "ListParts", + "params": [ + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "vaultName", "sourceType": "identifier", "source": "VaultName" }, + { "target": "uploadId", "sourceType": "identifier", "source": "Id" } ] - }, - "resource" : { - "type" : "Job", - "identifiers" :[ - { "target" : "Id", "sourceType" : "responsePath", "source" : "jobId" }, - { "target" : "AccountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "VaultName", "sourceType" : "identifier", "source" : "Name" } + } + }, + "UploadPart": { + "request": { + "operation": "UploadMultipartPart", + "params": [ + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "vaultName", "sourceType": "identifier", "source": "VaultName" }, + { "target": "uploadId", "sourceType": "identifier", "source": "Id" } ] - }, - "path" : "$" + } + } + } + }, + "Notification": { + "identifiers": [ + { "name": "AccountId" }, + { "name": "VaultName" } + ], + "shape": "VaultNotificationConfig", + "load": { + "request": { + "operation": "GetVaultNotifications", + "params": [ + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "vaultName", "sourceType": "identifier", "source": "VaultName" } + ] }, - "InitiateMultipartUpload" : { - "request" : { - "operation" : "InitiateMultipartUpload", - "params" : [ - { "target" : "vaultName", "sourceType" : "identifier", "source" : "Name" }, - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" } + "path": "vaultNotificationConfig" + }, + "actions": { + "Delete": { + "request": { + "operation": "DeleteVaultNotifications", + "params": [ + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "vaultName", "sourceType": "identifier", "source": "VaultName" } ] - }, - "resource" : { - "type" : "MultipartUpload", - "identifiers" : [ - { "target" : "Id", "sourceType" : "responsePath", "source" : "uploadId" }, - { "target" : "AccountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "VaultName", "sourceType" : "identifier", "source" : "Name" } + } + }, + "Set": { + "request": { + "operation": "SetVaultNotifications", + "params": [ + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "vaultName", "sourceType": "identifier", "source": "VaultName" } ] - }, - "path" : "$" + } } + } + }, + "Vault": { + "identifiers": [ + { "name": "AccountId" }, + { + "name": "Name", + "memberName": "VaultName" + } + ], + "shape": "DescribeVaultOutput", + "load": { + "request": { + "operation": "DescribeVault", + "params": [ + { "target": "vaultName", "sourceType": "identifier", "source": "Name" }, + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" } + ] + }, + "path": "$" }, - "hasMany" : { - "Jobs" : { - "request" : { - "operation" : "ListJobs", - "params" : [ - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "vaultName", "sourceType" : "identifier", "source" : "Name" } - ] - }, - "resource" : { - "type" : "Job", - "identifiers" : [ - { "target" : "AccountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "VaultName", "sourceType" : "identifier", "source" : "Name" }, - { "target" : "Id", "sourceType" : "responsePath", "source" : "JobList[].JobId" } + "actions": { + "Create": { + "request": { + "operation": "CreateVault", + "params": [ + { "target": "vaultName", "sourceType": "identifier", "source": "Name" }, + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" } ] - }, - "path" : "JobList[]" + } }, - "CompletedJobs" : { - "request" : { - "operation" : "ListJobs", - "params" : [ - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "vaultName", "sourceType" : "identifier", "source" : "Name" }, - { "target" : "completed", "sourceType" : "boolean", "source": "true" } - ] - }, - "resource" : { - "type" : "Job", - "identifiers" : [ - { "target" : "AccountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "VaultName", "sourceType" : "identifier", "source" : "Name" }, - { "target" : "Id", "sourceType" : "responsePath", "source" : "JobList[].JobId" } + "Delete": { + "request": { + "operation": "DeleteVault", + "params": [ + { "target": "vaultName", "sourceType": "identifier", "source": "Name" }, + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" } ] - }, - "path" : "JobList[]" - }, - "JobsInProgress" : { - "request" : { - "operation" : "ListJobs", - "params" : [ - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "vaultName", "sourceType" : "identifier", "source" : "Name" }, - { "target" : "statuscode", "sourceType" : "string", "source": "InProgress" } - ] - }, - "resource" : { - "type" : "Job", - "identifiers" : [ - { "target" : "AccountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "VaultName", "sourceType" : "identifier", "source" : "Name" }, - { "target" : "Id", "sourceType" : "responsePath", "source" : "JobList[].JobId" } - ] - }, - "path" : "JobList[]" + } }, - "SucceededJobs" : { - "request" : { - "operation" : "ListJobs", - "params" : [ - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "vaultName", "sourceType" : "identifier", "source" : "Name" }, - { "target" : "statuscode", "sourceType" : "string", "source": "Succeeded" } - ] - }, - "resource" : { - "type" : "Job", - "identifiers" : [ - { "target" : "AccountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "VaultName", "sourceType" : "identifier", "source" : "Name" }, - { "target" : "Id", "sourceType" : "responsePath", "source" : "JobList[].JobId" } + "InitiateInventoryRetrieval": { + "request": { + "operation": "InitiateJob", + "params": [ + { "target": "vaultName", "sourceType": "identifier", "source": "Name" }, + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "jobParameters.Type", "sourceType": "string", "source": "inventory-retrieval" } ] }, - "path" : "JobList[]" + "resource": { + "type": "Job", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "jobId" }, + { "target": "AccountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "VaultName", "sourceType": "identifier", "source": "Name" } + ] + } }, - "FailedJobs" : { - "request" : { - "operation" : "ListJobs", - "params" : [ - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "vaultName", "sourceType" : "identifier", "source" : "Name" }, - { "target" : "statuscode", "sourceType" : "string", "source": "Failed" } - ] - }, - "resource" : { - "type" : "Job", - "identifiers" : [ - {"target" : "AccountId", "sourceType" : "identifier", "source" : "AccountId"}, - {"target" : "VaultName", "sourceType" : "identifier", "source" : "Name"}, - {"target" : "Id", "sourceType" : "responsePath", "source" : "JobList[].JobId"} + "InitiateMultipartUpload": { + "request": { + "operation": "InitiateMultipartUpload", + "params": [ + { "target": "vaultName", "sourceType": "identifier", "source": "Name" }, + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" } ] }, - "path" : "JobList[]" + "resource": { + "type": "MultipartUpload", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "uploadId" }, + { "target": "AccountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "VaultName", "sourceType": "identifier", "source": "Name" } + ] + } }, - "MultipartUplaods" : { - "request" : { - "operation" : "ListMultipartUploads", - "params" : [ - { "target" : "vaultName", "sourceType" : "identifier", "source" : "Name" }, - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" } + "UploadArchive": { + "request": { + "operation": "UploadArchive", + "params": [ + { "target": "vaultName", "sourceType": "identifier", "source": "Name" }, + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" } ] }, - "resource" : { - "type" : "MultipartUpload", - "identifiers" : [ - {"target" : "AccountId", "sourceType" : "identifier", "source" : "AccountId"}, - {"target" : "VaultName", "sourceType" : "identifier", "source" : "Name"}, - {"target" : "Id", "sourceType" : "responsePath", "source" : "UploadsList[].MultipartUploadId"} + "resource": { + "type": "Archive", + "identifiers": [ + { "target": "Id", "sourceType": "responsePath", "source": "archiveId" }, + { "target": "AccountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "VaultName", "sourceType": "identifier", "source": "Name" } ] - }, - "path" : "UploadsList[]" + } } }, - "subResources": { - "resources": ["Notification","Job","Archive", "MultipartUpload"], - "identifiers" : {"AccountId" : "AccountId", "Name":"VaultName"} - } - }, - "MultipartUpload" : { - "identifiers" : [ - { "name":"AccountId" }, - { "name":"VaultName" }, - { "name": "Id", "memberName" : "MultipartUploadId"} - ], - "shape" : "UploadListElement", - "actions" : { - "UploadPart" : { - "request" : { - "operation" : "UploadMultipartPart", - "params" : [ - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "vaultName", "sourceType" : "identifier", "source" : "VaultName" }, - { "target" : "uploadId", "sourceType" : "identifier", "source" : "Id" } + "hasMany": { + "CompletedJobs": { + "request": { + "operation": "ListJobs", + "params": [ + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "vaultName", "sourceType": "identifier", "source": "Name" }, + { "target": "completed", "sourceType": "string", "source": "true" } ] + }, + "resource": { + "type": "Job", + "identifiers": [ + { "target": "AccountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "VaultName", "sourceType": "identifier", "source": "Name" }, + { "target": "Id", "sourceType": "responsePath", "source": "JobList[].JobId" } + ], + "path": "JobList[]" } }, - "Complete" : { - "request" : { - "operation" : "CompleteMultipartUpload", - "params" : [ - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "vaultName", "sourceType" : "identifier", "source" : "VaultName" }, - { "target" : "uploadId", "sourceType" : "identifier", "source" : "Id" } + "FailedJobs": { + "request": { + "operation": "ListJobs", + "params": [ + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "vaultName", "sourceType": "identifier", "source": "Name" }, + { "target": "statuscode", "sourceType": "string", "source": "Failed" } ] + }, + "resource": { + "type": "Job", + "identifiers": [ + { "target": "AccountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "VaultName", "sourceType": "identifier", "source": "Name" }, + { "target": "Id", "sourceType": "responsePath", "source": "JobList[].JobId" } + ], + "path": "JobList[]" } }, - "Abort" : { - "request" : { - "operation" : "AbortMultipartUpload", - "params" : [ - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "vaultName", "sourceType" : "identifier", "source" : "VaultName" }, - { "target" : "uploadId", "sourceType" : "identifier", "source" : "Id" } + "Jobs": { + "request": { + "operation": "ListJobs", + "params": [ + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "vaultName", "sourceType": "identifier", "source": "Name" } ] + }, + "resource": { + "type": "Job", + "identifiers": [ + { "target": "AccountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "VaultName", "sourceType": "identifier", "source": "Name" }, + { "target": "Id", "sourceType": "responsePath", "source": "JobList[].JobId" } + ], + "path": "JobList[]" } }, - "Parts" : { - "request" : { - "operation" : "ListParts", - "params" : [ - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "vaultName", "sourceType" : "identifier", "source" : "VaultName" }, - { "target" : "uploadId", "sourceType" : "identifier", "source" : "Id" } - ] - } - } - } - }, - "Archive" : { - "identifiers" : [ - { "name":"AccountId" }, - { "name":"VaultName" }, - { "name": "Id" } - ], - "actions" : { - "Delete" : { + "JobsInProgress": { "request": { - "operation" : "DeleteArchive", - "params" : [ - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "vaultName", "sourceType" : "identifier", "source" : "VaultName" }, - { "target" : "archiveId", "sourceType" : "identifier", "source" : "Id" } + "operation": "ListJobs", + "params": [ + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "vaultName", "sourceType": "identifier", "source": "Name" }, + { "target": "statuscode", "sourceType": "string", "source": "InProgress" } ] + }, + "resource": { + "type": "Job", + "identifiers": [ + { "target": "AccountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "VaultName", "sourceType": "identifier", "source": "Name" }, + { "target": "Id", "sourceType": "responsePath", "source": "JobList[].JobId" } + ], + "path": "JobList[]" } }, - "InitiateArchiveRetreival" : { - "request" : { - "operation" : "InitiateJob", - "params" : [ - { "target" : "vaultName", "sourceType" : "identifier", "source" : "Name" }, - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "jobParameters.Type", "sourceType" : "string", "source" : "archive-retrieval" }, - { "target" : "jobParameters.ArchiveId", "sourceType" : "identifier", "source" : "Id" } + "MultipartUplaods": { + "request": { + "operation": "ListMultipartUploads", + "params": [ + { "target": "vaultName", "sourceType": "identifier", "source": "Name" }, + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" } ] }, - "resource" : { - "type" : "Job", - "identifiers" :[ - { "target" : "Id", "sourceType" : "responsePath", "source" : "jobId" }, - { "target" : "AccountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "VaultName", "sourceType" : "identifier", "source" : "Name" } + "resource": { + "type": "MultipartUpload", + "identifiers": [ + { "target": "AccountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "VaultName", "sourceType": "identifier", "source": "Name" }, + { "target": "Id", "sourceType": "responsePath", "source": "UploadsList[].MultipartUploadId" } + ], + "path": "UploadsList[]" + } + }, + "SucceededJobs": { + "request": { + "operation": "ListJobs", + "params": [ + { "target": "accountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "vaultName", "sourceType": "identifier", "source": "Name" }, + { "target": "statuscode", "sourceType": "string", "source": "Succeeded" } ] }, - "path" : "$" - } - } - }, - "Job" : { - "identifiers" : [ - { "name":"AccountId" }, - { "name":"VaultName" }, - { "name": "Id", "memberName" : "JobId"} - ], - "shape" : "GlacierJobDescription", - "load" : { - "request" : { - "operation" : "DescribeJob", - "params" : [ - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "vaultName", "sourceType" : "identifier", "source" : "VaultName" }, - { "target" : "jobId", "sourceType" : "identifier", "source" : "Id" } - ] - }, - "path" : "$" - }, - "actions" : { - "GetOutput" : { - "request" : { - "operation" : "GetJobOutput", - "params" : [ - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "vaultName", "sourceType" : "identifier", "source" : "VaultName" }, - { "target" : "jobId", "sourceType" : "identifier", "source" : "Id" } - ] + "resource": { + "type": "Job", + "identifiers": [ + { "target": "AccountId", "sourceType": "identifier", "source": "AccountId" }, + { "target": "VaultName", "sourceType": "identifier", "source": "Name" }, + { "target": "Id", "sourceType": "responsePath", "source": "JobList[].JobId" } + ], + "path": "JobList[]" } } - } - }, - "Notification" : { - "identifiers" : [ - { "name": "AccountId" }, - { "name": "VaultName" } - ], - "shape" : "VaultNotificationConfig", - "load" : { - "request" : { - "operation" : "GetVaultNotifications", - "params" : [ - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "vaultName", "sourceType" : "identifier", "source" : "VaultName" } - ] - }, - "path" : "vaultNotificationConfig" }, - "actions" : { - "Set" : { - "request" : { - "operation" : "SetVaultNotifications", - "params" : [ - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "vaultName", "sourceType" : "identifier", "source" : "VaultName" } - ] - } - }, - "Delete" : { - "request" : { - "operation" : "DeleteVaultNotifications", - "params" : [ - { "target" : "accountId", "sourceType" : "identifier", "source" : "AccountId" }, - { "target" : "vaultName", "sourceType" : "identifier", "source" : "VaultName" } - ] - } + "subResources": { + "resources": [ + "Notification", + "Job", + "Archive", + "MultipartUpload" + ], + "identifiers": { + "AccountId": "AccountId", + "Name": "VaultName" } } } diff --git a/boto3/resources/action.py b/boto3/resources/action.py index 22291c24d4..9a096f2ef6 100644 --- a/boto3/resources/action.py +++ b/boto3/resources/action.py @@ -43,16 +43,15 @@ def __init__(self, action_model, factory=None, resource_defs=None, service_model=None): self.action_model = action_model - search_path = action_model.path - # In the simplest case we just return the response, but if a # resource is defined, then we must create these before returning. - if action_model.resource: - self.response_handler = ResourceHandler(search_path, factory, - resource_defs, service_model, action_model.resource, + resource = action_model.resource + if resource: + self.response_handler = ResourceHandler(resource.path, + factory, resource_defs, service_model, resource, action_model.request.operation) else: - self.response_handler = RawHandler(search_path) + self.response_handler = RawHandler(action_model.path) def __call__(self, parent, *args, **kwargs): """ diff --git a/boto3/resources/model.py b/boto3/resources/model.py index ee17783995..ef972c2b85 100644 --- a/boto3/resources/model.py +++ b/boto3/resources/model.py @@ -170,6 +170,9 @@ def __init__(self, definition, resource_defs): #: (``string``) The name of the response resource type self.type = definition.get('type') + #: (``string``) The JMESPath search query or ``None`` + self.path = definition.get('path') + @property def identifiers(self): """ @@ -340,7 +343,7 @@ def references(self): """ references = [] - for key in ['hasOne', 'hasSome']: + for key in ['belongsTo']: for name, definition in self._definition.get(key, {}).items(): references.append( Action(name, definition, self._resource_defs)) diff --git a/tests/unit/resources/test_action.py b/tests/unit/resources/test_action.py index 05b6322edb..ad088b451d 100644 --- a/tests/unit/resources/test_action.py +++ b/tests/unit/resources/test_action.py @@ -92,9 +92,9 @@ def test_service_action_calls_raw_handler(self, handler_mock, params_mock): @mock.patch('boto3.resources.action.ResourceHandler') def test_service_action_calls_resource_handler(self, handler_mock, params_mock): self.action_def['resource'] = { - 'type': 'Frob' + 'type': 'Frob', + 'path': 'Container' } - self.action_def['path'] = 'Container' resource = mock.Mock() resource.meta = { diff --git a/tests/unit/resources/test_factory.py b/tests/unit/resources/test_factory.py index 3654925b8f..5c273f0a4e 100644 --- a/tests/unit/resources/test_factory.py +++ b/tests/unit/resources/test_factory.py @@ -493,7 +493,7 @@ def test_resource_loads_references(self): model = { 'shape': 'InstanceShape', 'identifiers': [{'name': 'GroupId'}], - 'hasOne': { + 'belongsTo': { 'Subnet': { 'resource': { 'type': 'Subnet', diff --git a/tests/unit/resources/test_model.py b/tests/unit/resources/test_model.py index 7d1442f8fb..d66422e338 100644 --- a/tests/unit/resources/test_model.py +++ b/tests/unit/resources/test_model.py @@ -74,7 +74,8 @@ def test_resource_action_response_resource(self): 'actions': { 'GetFrobs': { 'resource': { - 'type': 'Frob' + 'type': 'Frob', + 'path': 'Container.Frobs[]' } } } @@ -84,6 +85,7 @@ def test_resource_action_response_resource(self): action = model.actions[0] self.assertEqual(action.resource.type, 'Frob') + self.assertEqual(action.resource.path, 'Container.Frobs[]') self.assertIsInstance(action.resource.model, ResourceModel) self.assertEqual(action.resource.model.name, 'Frob') @@ -144,7 +146,7 @@ def test_sub_resources(self): def test_resource_references(self): model_def = { - 'hasOne': { + 'belongsTo': { 'Frob': { 'resource': { 'type': 'Frob', @@ -153,9 +155,7 @@ def test_resource_references(self): 'source':'FrobId'} ] }, - } - }, - 'hasSome': { + }, 'Frobs': { 'resource': { 'type': 'Frob'