Using new attribute schema for all resources

Currently resources use old style of attribute schema. For example:

    attribute_name: _('Description')

This patch contains changes to migrate for new attribute Schema class.
For example:

    attribute_name: attributes.Schema(_('Descriprion'))

Partial-Bug: #1307319

Change-Id: I54c7b9d481655b0051d0f7ff668672011ac882e9
This commit is contained in:
Sergey Kraynev 2014-04-18 09:15:00 -04:00
parent 1aba2fa252
commit e01251b605
35 changed files with 745 additions and 301 deletions

View File

@ -14,6 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from heat.engine import attributes
from heat.engine import properties
from heat.engine import resource
from heat.openstack.common.gettextutils import _
@ -139,15 +140,33 @@ class DockerContainer(resource.Resource):
}
attributes_schema = {
'info': _('Container info'),
'network_info': _('Container network info'),
'network_ip': _('Container ip address'),
'network_gateway': _('Container ip gateway'),
'network_tcp_ports': _('Container TCP ports'),
'network_udp_ports': _('Container UDP ports'),
'logs': _('Container logs'),
'logs_head': _('Container first logs line'),
'logs_tail': _('Container last logs line')
'info': attributes.Schema(
_('Container info')
),
'network_info': attributes.Schema(
_('Container network info')
),
'network_ip': attributes.Schema(
_('Container ip address')
),
'network_gateway': attributes.Schema(
_('Container ip gateway')
),
'network_tcp_ports': attributes.Schema(
_('Container TCP ports')
),
'network_udp_ports': attributes.Schema(
_('Container UDP ports')
),
'logs': attributes.Schema(
_('Container logs')
),
'logs_head': attributes.Schema(
_('Container first logs line')
),
'logs_tail': attributes.Schema(
_('Container last logs line')
),
}
def get_client(self):

View File

@ -12,6 +12,7 @@
# under the License.
from heat.common import exception
from heat.engine import attributes
from heat.engine import properties
from heat.engine import resource
@ -49,8 +50,12 @@ class MarconiQueue(resource.Resource):
}
attributes_schema = {
"queue_id": _("ID of the queue."),
"href": _("The resource href of the queue.")
"queue_id": attributes.Schema(
_("ID of the queue.")
),
"href": attributes.Schema(
_("The resource href of the queue.")
),
}
update_allowed_keys = ('Properties',)

View File

@ -15,6 +15,7 @@
import copy
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
@ -507,10 +508,12 @@ class WebHook(resource.Resource):
update_allowed_properties = (NAME, METADATA)
attributes_schema = {
'executeUrl': _(
"The url for executing the webhook (requires auth)."),
'capabilityUrl': _(
"The url for executing the webhook (doesn't require auth)."),
'executeUrl': attributes.Schema(
_("The url for executing the webhook (requires auth).")
),
'capabilityUrl': attributes.Schema(
_("The url for executing the webhook (doesn't require auth).")
),
}
def _get_args(self, props):

View File

@ -28,6 +28,7 @@ import itertools
from heat.openstack.common import log as logging
from heat.openstack.common.gettextutils import _
from heat.engine import attributes
from heat.engine import function
from heat.engine import scheduler
from heat.engine import constraints
@ -364,8 +365,10 @@ class CloudLoadBalancer(resource.Resource):
}
attributes_schema = {
'PublicIp': _('Public IP address of the specified '
'instance.')}
'PublicIp': attributes.Schema(
_('Public IP address of the specified instance.')
),
}
update_allowed_keys = ('Properties',)

View File

@ -14,6 +14,7 @@
import copy
from heat.common import exception
from heat.engine import attributes
from heat.engine import properties
from heat.engine.resources import nova_utils
from heat.engine.resources import server
@ -60,9 +61,15 @@ class CloudServer(server.Server):
attributes_schema = copy.deepcopy(server.Server.attributes_schema)
attributes_schema.update(
{
'distro': _('The Linux distribution on the server.'),
'privateIPv4': _('The private IPv4 address of the server.'),
'admin_pass': _('The administrator password for the server.'),
'distro': attributes.Schema(
_('The Linux distribution on the server.')
),
'privateIPv4': attributes.Schema(
_('The private IPv4 address of the server.')
),
'admin_pass': attributes.Schema(
_('The administrator password for the server.')
),
}
)

View File

@ -14,6 +14,7 @@
import netaddr
from heat.common import exception
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
@ -69,8 +70,12 @@ class CloudNetwork(resource.Resource):
}
attributes_schema = {
"cidr": _("The CIDR for an isolated private network."),
"label": _("The name of the network.")
"cidr": attributes.Schema(
_("The CIDR for an isolated private network.")
),
"label": attributes.Schema(
_("The name of the network.")
),
}
def __init__(self, name, json_snippet, stack):

View File

@ -19,6 +19,7 @@ import six
from heat.common import exception
from heat.common import timeutils as iso8601utils
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import environment
from heat.engine import function
@ -142,8 +143,10 @@ class InstanceGroup(stack_resource.StackResource):
update_allowed_keys = ('Properties', 'UpdatePolicy',)
attributes_schema = {
"InstanceList": _("A comma-delimited list of server ip addresses. "
"(Heat extension).")
"InstanceList": attributes.Schema(
_("A comma-delimited list of server ip addresses. "
"(Heat extension).")
),
}
rolling_update_schema = {
MIN_INSTANCES_IN_SERVICE: properties.Schema(properties.Schema.NUMBER,
@ -1008,8 +1011,9 @@ class ScalingPolicy(signal_responder.SignalResponder, CooldownMixin):
update_allowed_keys = ('Properties',)
attributes_schema = {
"AlarmUrl": _("A signed url to handle the alarm. "
"(Heat extension).")
"AlarmUrl": attributes.Schema(
_("A signed url to handle the alarm. (Heat extension).")
),
}
def handle_create(self):
@ -1148,7 +1152,9 @@ class AutoScalingPolicy(ScalingPolicy):
update_allowed_keys = ('Properties',)
attributes_schema = {
"alarm_url": _("A signed url to handle the alarm.")
"alarm_url": attributes.Schema(
_("A signed url to handle the alarm.")
),
}
def _get_adjustement_type(self):

View File

@ -12,6 +12,7 @@
# under the License.
from heat.common import exception
from heat.engine import attributes
from heat.engine import clients
from heat.engine import constraints
from heat.engine import properties
@ -47,9 +48,11 @@ class ElasticIp(resource.Resource):
}
attributes_schema = {
'AllocationId': _('ID that AWS assigns to represent the allocation of'
' the address for use with Amazon VPC. Returned only'
' for VPC elastic IP addresses.')
'AllocationId': attributes.Schema(
_('ID that AWS assigns to represent the allocation of the address '
'for use with Amazon VPC. Returned only for VPC elastic IP '
'addresses.')
),
}
def __init__(self, name, json_snippet, stack):

View File

@ -19,6 +19,7 @@ import six
cfg.CONF.import_opt('instance_user', 'heat.common.config')
from heat.common import exception
from heat.engine import attributes
from heat.engine import clients
from heat.engine import constraints
from heat.engine import properties
@ -51,8 +52,9 @@ class Restarter(signal_responder.SignalResponder):
}
attributes_schema = {
"AlarmUrl": _("A signed url to handle the alarm "
"(Heat extension).")
"AlarmUrl": attributes.Schema(
_("A signed url to handle the alarm (Heat extension).")
),
}
def _find_resource(self, resource_id):
@ -296,17 +298,24 @@ class Instance(resource.Resource):
),
}
attributes_schema = {'AvailabilityZone': _('The Availability Zone where '
'the specified instance is '
'launched.'),
'PrivateDnsName': _('Private DNS name of the'
' specified instance.'),
'PublicDnsName': _('Public DNS name of the specified '
'instance.'),
'PrivateIp': _('Private IP address of the specified '
'instance.'),
'PublicIp': _('Public IP address of the specified '
'instance.')}
attributes_schema = {
'AvailabilityZone': attributes.Schema(
_('The Availability Zone where the specified instance is '
'launched.')
),
'PrivateDnsName': attributes.Schema(
_('Private DNS name of the specified instance.')
),
'PublicDnsName': attributes.Schema(
_('Public DNS name of the specified instance.')
),
'PrivateIp': attributes.Schema(
_('Private IP address of the specified instance.')
),
'PublicIp': attributes.Schema(
_('Public IP address of the specified instance.')
),
}
update_allowed_keys = ('Metadata', 'Properties')

View File

@ -16,6 +16,7 @@ from oslo.config import cfg
from heat.common import exception
from heat.common import template_format
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine.resources import nova_utils
@ -341,18 +342,24 @@ class LoadBalancer(stack_resource.StackResource):
}
attributes_schema = {
"CanonicalHostedZoneName": _("The name of the hosted zone that is "
"associated with the LoadBalancer."),
"CanonicalHostedZoneNameID": _("The ID of the hosted zone name "
"that is associated with the "
"LoadBalancer."),
"DNSName": _("The DNS name for the LoadBalancer."),
"SourceSecurityGroup.GroupName": _("The security group that you can "
"use as part of your inbound "
"rules for your LoadBalancer's "
"back-end instances."),
"SourceSecurityGroup.OwnerAlias": _("Owner of the source "
"security group.")
"CanonicalHostedZoneName": attributes.Schema(
_("The name of the hosted zone that is associated with the "
"LoadBalancer.")
),
"CanonicalHostedZoneNameID": attributes.Schema(
_("The ID of the hosted zone name that is associated with the "
"LoadBalancer.")
),
"DNSName": attributes.Schema(
_("The DNS name for the LoadBalancer.")
),
"SourceSecurityGroup.GroupName": attributes.Schema(
_("The security group that you can use as part of your inbound "
"rules for your LoadBalancer's back-end instances.")
),
"SourceSecurityGroup.OwnerAlias": attributes.Schema(
_("Owner of the source security group.")
),
}
update_allowed_keys = ('Properties',)

View File

@ -11,6 +11,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from heat.engine import attributes
from heat.engine import clients
from heat.engine import properties
from heat.engine import resource
@ -76,8 +77,11 @@ class NetworkInterface(resource.Resource):
),
}
attributes_schema = {'PrivateIpAddress': _('Private IP address of the '
'network interface.')}
attributes_schema = {
'PrivateIpAddress': attributes.Schema(
_('Private IP address of the network interface.')
),
}
@staticmethod
def network_id_from_subnet_id(neutronclient, subnet_id):

View File

@ -11,6 +11,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from heat.engine import attributes
from heat.engine import clients
from heat.engine import constraints
from heat.engine import properties
@ -60,14 +61,28 @@ class Firewall(neutron.NeutronResource):
}
attributes_schema = {
'name': _('Name for the firewall.'),
'description': _('Description of the firewall.'),
'admin_state_up': _('The administrative state of the firewall.'),
'firewall_policy_id': _('Unique identifier of the firewall policy '
'used to create the firewall.'),
'status': _('The status of the firewall.'),
'tenant_id': _('Id of the tenant owning the firewall.'),
'show': _('All attributes.'),
'name': attributes.Schema(
_('Name for the firewall.')
),
'description': attributes.Schema(
_('Description of the firewall.')
),
'admin_state_up': attributes.Schema(
_('The administrative state of the firewall.')
),
'firewall_policy_id': attributes.Schema(
_('Unique identifier of the firewall policy used to create '
'the firewall.')
),
'status': attributes.Schema(
_('The status of the firewall.')
),
'tenant_id': attributes.Schema(
_('Id of the tenant owning the firewall.')
),
'show': attributes.Schema(
_('All attributes.')
),
}
update_allowed_keys = ('Properties',)
@ -145,12 +160,24 @@ class FirewallPolicy(neutron.NeutronResource):
}
attributes_schema = {
'name': _('Name for the firewall policy.'),
'description': _('Description of the firewall policy.'),
'firewall_rules': _('List of firewall rules in this firewall policy.'),
'shared': _('Shared status of this firewall policy.'),
'audited': _('Audit status of this firewall policy.'),
'tenant_id': _('Id of the tenant owning the firewall policy.')
'name': attributes.Schema(
_('Name for the firewall policy.')
),
'description': attributes.Schema(
_('Description of the firewall policy.')
),
'firewall_rules': attributes.Schema(
_('List of firewall rules in this firewall policy.')
),
'shared': attributes.Schema(
_('Shared status of this firewall policy.')
),
'audited': attributes.Schema(
_('Audit status of this firewall policy.')
),
'tenant_id': attributes.Schema(
_('Id of the tenant owning the firewall policy.')
),
}
update_allowed_keys = ('Properties',)
@ -269,24 +296,49 @@ class FirewallRule(neutron.NeutronResource):
}
attributes_schema = {
'name': _('Name for the firewall rule.'),
'description': _('Description of the firewall rule.'),
'firewall_policy_id': _('Unique identifier of the firewall policy to '
'which this firewall rule belongs.'),
'shared': _('Shared status of this firewall rule.'),
'protocol': _('Protocol value for this firewall rule.'),
'ip_version': _('Ip_version for this firewall rule.'),
'source_ip_address': _('Source ip_address for this firewall rule.'),
'destination_ip_address': _('Destination ip_address for this '
'firewall rule.'),
'source_port': _('Source port range for this firewall rule.'),
'destination_port': _('Destination port range for this firewall '
'rule.'),
'action': _('Allow or deny action for this firewall rule.'),
'enabled': _('Indicates whether this firewall rule is enabled or '
'not.'),
'position': _('Position of the rule within the firewall policy.'),
'tenant_id': _('Id of the tenant owning the firewall.')
'name': attributes.Schema(
_('Name for the firewall rule.')
),
'description': attributes.Schema(
_('Description of the firewall rule.')
),
'firewall_policy_id': attributes.Schema(
_('Unique identifier of the firewall policy to which this '
'firewall rule belongs.')
),
'shared': attributes.Schema(
_('Shared status of this firewall rule.')
),
'protocol': attributes.Schema(
_('Protocol value for this firewall rule.')
),
'ip_version': attributes.Schema(
_('Ip_version for this firewall rule.')
),
'source_ip_address': attributes.Schema(
_('Source ip_address for this firewall rule.')
),
'destination_ip_address': attributes.Schema(
_('Destination ip_address for this firewall rule.')
),
'source_port': attributes.Schema(
_('Source port range for this firewall rule.')
),
'destination_port': attributes.Schema(
_('Destination port range for this firewall rule.')
),
'action': attributes.Schema(
_('Allow or deny action for this firewall rule.')
),
'enabled': attributes.Schema(
_('Indicates whether this firewall rule is enabled or not.')
),
'position': attributes.Schema(
_('Position of the rule within the firewall policy.')
),
'tenant_id': attributes.Schema(
_('Id of the tenant owning the firewall.')
),
}
update_allowed_keys = ('Properties',)

View File

@ -11,6 +11,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from heat.engine import attributes
from heat.engine import clients
from heat.engine import properties
from heat.engine.resources.neutron import neutron
@ -62,16 +63,28 @@ class FloatingIP(neutron.NeutronResource):
}
attributes_schema = {
'router_id': _('ID of the router used as gateway, set when associated '
'with a port.'),
'tenant_id': _('The tenant owning this floating IP.'),
'floating_network_id': _('ID of the network in which this IP is '
'allocated.'),
'fixed_ip_address': _('IP address of the associated port, if '
'specified.'),
'floating_ip_address': _('The allocated address of this IP.'),
'port_id': _('ID of the port associated with this IP.'),
'show': _('All attributes.')
'router_id': attributes.Schema(
_('ID of the router used as gateway, set when associated with a '
'port.')
),
'tenant_id': attributes.Schema(
_('The tenant owning this floating IP.')
),
'floating_network_id': attributes.Schema(
_('ID of the network in which this IP is allocated.')
),
'fixed_ip_address': attributes.Schema(
_('IP address of the associated port, if specified.')
),
'floating_ip_address': attributes.Schema(
_('The allocated address of this IP.')
),
'port_id': attributes.Schema(
_('ID of the port associated with this IP.')
),
'show': attributes.Schema(
_('All attributes.')
),
}
def add_dependencies(self, deps):

View File

@ -12,6 +12,7 @@
# under the License.
from heat.common import exception
from heat.engine import attributes
from heat.engine import clients
from heat.engine import constraints
from heat.engine import properties
@ -97,23 +98,41 @@ class HealthMonitor(neutron.NeutronResource):
update_allowed_keys = ('Properties',)
attributes_schema = {
'admin_state_up': _('The administrative state of this health '
'monitor.'),
'delay': _('The minimum time in seconds between regular connections '
'of the member.'),
'expected_codes': _('The list of HTTP status codes expected in '
'response from the member to declare it healthy.'),
'http_method': _('The HTTP method used for requests by the monitor of '
'type HTTP.'),
'max_retries': _('Number of permissible connection failures before '
'changing the member status to INACTIVE.'),
'timeout': _('Maximum number of seconds for a monitor to wait for a '
'connection to be established before it times out.'),
'type': _('One of predefined health monitor types.'),
'url_path': _('The HTTP path used in the HTTP request used by the '
'monitor to test a member health.'),
'tenant_id': _('Tenant owning the health monitor.'),
'show': _('All attributes.'),
'admin_state_up': attributes.Schema(
_('The administrative state of this health monitor.')
),
'delay': attributes.Schema(
_('The minimum time in seconds between regular connections '
'of the member.')
),
'expected_codes': attributes.Schema(
_('The list of HTTP status codes expected in response '
'from the member to declare it healthy.')
),
'http_method': attributes.Schema(
_('The HTTP method used for requests by the monitor of type HTTP.')
),
'max_retries': attributes.Schema(
_('Number of permissible connection failures before changing '
'the member status to INACTIVE.')
),
'timeout': attributes.Schema(
_('Maximum number of seconds for a monitor to wait for a '
'connection to be established before it times out.')
),
'type': attributes.Schema(
_('One of predefined health monitor types.')
),
'url_path': attributes.Schema(
_('The HTTP path used in the HTTP request used by the monitor '
'to test a member health.')
),
'tenant_id': attributes.Schema(
_('Tenant owning the health monitor.')
),
'show': attributes.Schema(
_('All attributes.')
),
}
def handle_create(self):
@ -289,16 +308,32 @@ class Pool(neutron.NeutronResource):
update_allowed_keys = ('Properties',)
attributes_schema = {
'admin_state_up': _('The administrative state of this pool.'),
'name': _('Name of the pool.'),
'protocol': _('Protocol to balance.'),
'subnet_id': _('The subnet for the port on which the members '
'of the pool will be connected.'),
'lb_method': _('The algorithm used to distribute load between the '
'members of the pool.'),
'description': _('Description of the pool.'),
'tenant_id': _('Tenant owning the pool.'),
'vip': _('Vip associated with the pool.'),
'admin_state_up': attributes.Schema(
_('The administrative state of this pool.')
),
'name': attributes.Schema(
_('Name of the pool.')
),
'protocol': attributes.Schema(
_('Protocol to balance.')
),
'subnet_id': attributes.Schema(
_('The subnet for the port on which the members of the pool '
'will be connected.')
),
'lb_method': attributes.Schema(
_('The algorithm used to distribute load between the members '
'of the pool.')
),
'description': attributes.Schema(
_('Description of the pool.')
),
'tenant_id': attributes.Schema(
_('Tenant owning the pool.')
),
'vip': attributes.Schema(
_('Vip associated with the pool.')
),
}
def validate(self):
@ -491,15 +526,28 @@ class PoolMember(neutron.NeutronResource):
}
attributes_schema = {
'admin_state_up': _('The administrative state of this pool '
'member.'),
'tenant_id': _('Tenant owning the pool member.'),
'weight': _('Weight of the pool member in the pool.'),
'address': _('IP address of the pool member.'),
'pool_id': _('The ID of the load balancing pool.'),
'protocol_port': _('TCP port on which the pool member listens for'
'requests or connections.'),
'show': _('All attributes.'),
'admin_state_up': attributes.Schema(
_('The administrative state of this pool member.')
),
'tenant_id': attributes.Schema(
_('Tenant owning the pool member.')
),
'weight': attributes.Schema(
_('Weight of the pool member in the pool.')
),
'address': attributes.Schema(
_('IP address of the pool member.')
),
'pool_id': attributes.Schema(
_('The ID of the load balancing pool.')
),
'protocol_port': attributes.Schema(
_('TCP port on which the pool member listens for requests or '
'connections.')
),
'show': attributes.Schema(
_('All attributes.')
),
}
update_allowed_keys = ('Properties',)

View File

@ -11,6 +11,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from heat.engine import attributes
from heat.engine import clients
from heat.engine import constraints
from heat.engine import properties
@ -43,8 +44,12 @@ class MeteringLabel(neutron.NeutronResource):
}
attributes_schema = {
'name': _('Name of the metering label.'),
'description': _('Description of the metering label.'),
'name': attributes.Schema(
_('Name of the metering label.')
),
'description': attributes.Schema(
_('Description of the metering label.')
),
}
def handle_create(self):
@ -111,12 +116,18 @@ class MeteringRule(neutron.NeutronResource):
}
attributes_schema = {
'direction': _('The direction in which metering rule is applied.'),
'excluded': _('Exclude state for cidr.'),
'metering_label_id': _('The metering label ID to associate with '
'this metering rule..'),
'remote_ip_prefix': _('CIDR to be associated with this metering '
'rule.'),
'direction': attributes.Schema(
_('The direction in which metering rule is applied.')
),
'excluded': attributes.Schema(
_('Exclude state for cidr.')
),
'metering_label_id': attributes.Schema(
_('The metering label ID to associate with this metering rule.')
),
'remote_ip_prefix': attributes.Schema(
_('CIDR to be associated with this metering rule.')
),
}
def handle_create(self):

View File

@ -11,6 +11,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from heat.engine import attributes
from heat.engine import clients
from heat.engine import constraints
from heat.engine import properties
@ -76,12 +77,24 @@ class Net(neutron.NeutronResource):
}
attributes_schema = {
"status": _("The status of the network."),
"name": _("The name of the network."),
"subnets": _("Subnets of this network."),
"admin_state_up": _("The administrative status of the network."),
"tenant_id": _("The tenant owning this network."),
"show": _("All attributes."),
"status": attributes.Schema(
_("The status of the network.")
),
"name": attributes.Schema(
_("The name of the network.")
),
"subnets": attributes.Schema(
_("Subnets of this network.")
),
"admin_state_up": attributes.Schema(
_("The administrative status of the network.")
),
"tenant_id": attributes.Schema(
_("The tenant owning this network.")
),
"show": attributes.Schema(
_("All attributes.")
),
}
update_allowed_keys = ('Properties',)

View File

@ -15,6 +15,7 @@
# limitations under the License.
from heat.common import exception
from heat.engine import attributes
from heat.engine import clients
from heat.engine import constraints
from heat.engine import properties
@ -123,8 +124,12 @@ class NetworkGateway(neutron.NeutronResource):
}
attributes_schema = {
"default": _("A boolean value of default flag."),
"show": _("All attributes.")
"default": attributes.Schema(
_("A boolean value of default flag.")
),
"show": attributes.Schema(
_("All attributes.")
),
}
update_allowed_keys = ('Properties',)

View File

@ -11,6 +11,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from heat.engine import attributes
from heat.engine import clients
from heat.engine import properties
from heat.engine.resources.neutron import neutron
@ -150,19 +151,43 @@ class Port(neutron.NeutronResource):
}
attributes_schema = {
"admin_state_up": _("The administrative state of this port."),
"device_id": _("Unique identifier for the device."),
"device_owner": _("Name of the network owning the port."),
"fixed_ips": _("Fixed IP addresses."),
"mac_address": _("MAC address of the port."),
"name": _("Friendly name of the port."),
"network_id": _("Unique identifier for the network owning the port."),
"security_groups": _("A list of security groups for the port."),
"status": _("The status of the port."),
"tenant_id": _("Tenant owning the port."),
"allowed_address_pairs": _("Additional MAC/IP address pairs allowed "
"to pass through a port."),
"show": _("All attributes."),
"admin_state_up": attributes.Schema(
_("The administrative state of this port.")
),
"device_id": attributes.Schema(
_("Unique identifier for the device.")
),
"device_owner": attributes.Schema(
_("Name of the network owning the port.")
),
"fixed_ips": attributes.Schema(
_("Fixed IP addresses.")
),
"mac_address": attributes.Schema(
_("MAC address of the port.")
),
"name": attributes.Schema(
_("Friendly name of the port.")
),
"network_id": attributes.Schema(
_("Unique identifier for the network owning the port.")
),
"security_groups": attributes.Schema(
_("A list of security groups for the port.")
),
"status": attributes.Schema(
_("The status of the port.")
),
"tenant_id": attributes.Schema(
_("Tenant owning the port.")
),
"allowed_address_pairs": attributes.Schema(
_("Additional MAC/IP address pairs allowed to pass through "
"a port.")
),
"show": attributes.Schema(
_("All attributes.")
),
}
update_allowed_keys = ('Properties',)

View File

@ -12,6 +12,7 @@
# under the License.
from heat.common import exception
from heat.engine import attributes
from heat.engine import clients
from heat.engine import constraints
from heat.engine import properties
@ -63,9 +64,15 @@ class ProviderNet(net.Net):
update_allowed_keys = ('Properties',)
attributes_schema = {
"status": _("The status of the network."),
"subnets": _("Subnets of this network."),
"show": _("All attributes."),
"status": attributes.Schema(
_("The status of the network.")
),
"subnets": attributes.Schema(
_("Subnets of this network.")
),
"show": attributes.Schema(
_("All attributes.")
),
}
def validate(self):

View File

@ -12,6 +12,7 @@
# under the License.
from heat.common import exception
from heat.engine import attributes
from heat.engine import clients
from heat.engine import properties
from heat.engine.resources.neutron import neutron
@ -86,12 +87,24 @@ class Router(neutron.NeutronResource):
}
attributes_schema = {
"status": _("The status of the router."),
"external_gateway_info": _("Gateway network for the router."),
"name": _("Friendly name of the router."),
"admin_state_up": _("Administrative state of the router."),
"tenant_id": _("Tenant owning the router."),
"show": _("All attributes."),
"status": attributes.Schema(
_("The status of the router.")
),
"external_gateway_info": attributes.Schema(
_("Gateway network for the router.")
),
"name": attributes.Schema(
_("Friendly name of the router.")
),
"admin_state_up": attributes.Schema(
_("Administrative state of the router.")
),
"tenant_id": attributes.Schema(
_("Tenant owning the router.")
),
"show": attributes.Schema(
_("All attributes.")
),
}
update_allowed_keys = ('Properties',)

View File

@ -11,6 +11,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from heat.engine import attributes
from heat.engine import clients
from heat.engine import constraints
from heat.engine import properties
@ -140,18 +141,39 @@ class Subnet(neutron.NeutronResource):
}
attributes_schema = {
"name": _("Friendly name of the subnet."),
"network_id": _("Parent network of the subnet."),
"tenant_id": _("Tenant owning the subnet."),
"allocation_pools": _("Ip allocation pools and their ranges."),
"gateway_ip": _("Ip of the subnet's gateway."),
"host_routes": _("Additional routes for this subnet."),
"ip_version": _("Ip version for the subnet."),
"cidr": _("CIDR block notation for this subnet."),
"dns_nameservers": _("List of dns nameservers."),
"enable_dhcp": _("'true' if DHCP is enabled for this subnet; 'false' "
"otherwise."),
"show": _("All attributes."),
"name": attributes.Schema(
_("Friendly name of the subnet.")
),
"network_id": attributes.Schema(
_("Parent network of the subnet.")
),
"tenant_id": attributes.Schema(
_("Tenant owning the subnet.")
),
"allocation_pools": attributes.Schema(
_("Ip allocation pools and their ranges.")
),
"gateway_ip": attributes.Schema(
_("Ip of the subnet's gateway.")
),
"host_routes": attributes.Schema(
_("Additional routes for this subnet.")
),
"ip_version": attributes.Schema(
_("Ip version for the subnet.")
),
"cidr": attributes.Schema(
_("CIDR block notation for this subnet.")
),
"dns_nameservers": attributes.Schema(
_("List of dns nameservers.")
),
"enable_dhcp": attributes.Schema(
_("'true' if DHCP is enabled for this subnet; 'false' otherwise.")
),
"show": attributes.Schema(
_("All attributes.")
),
}
update_allowed_keys = ('Properties',)

View File

@ -11,6 +11,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from heat.engine import attributes
from heat.engine import clients
from heat.engine import constraints
from heat.engine import properties
@ -72,17 +73,32 @@ class VPNService(neutron.NeutronResource):
}
attributes_schema = {
'admin_state_up': _('The administrative state of the vpn service.'),
'description': _('The description of the vpn service.'),
'name': _('The name of the vpn service.'),
'router_id': _('The unique identifier of the router to which the vpn '
'service was inserted.'),
'status': _('The status of the vpn service.'),
'subnet_id': _('The unique identifier of the subnet in which the vpn '
'service was created.'),
'tenant_id': _('The unique identifier of the tenant owning the vpn '
'service.'),
'show': _('All attributes.'),
'admin_state_up': attributes.Schema(
_('The administrative state of the vpn service.')
),
'description': attributes.Schema(
_('The description of the vpn service.')
),
'name': attributes.Schema(
_('The name of the vpn service.')
),
'router_id': attributes.Schema(
_('The unique identifier of the router to which the vpn service '
'was inserted.')
),
'status': attributes.Schema(
_('The status of the vpn service.')
),
'subnet_id': attributes.Schema(
_('The unique identifier of the subnet in which the vpn service '
'was created.')
),
'tenant_id': attributes.Schema(
_('The unique identifier of the tenant owning the vpn service.')
),
'show': attributes.Schema(
_('All attributes.')
),
}
update_allowed_keys = ('Properties',)
@ -242,34 +258,66 @@ class IPsecSiteConnection(neutron.NeutronResource):
}
attributes_schema = {
'admin_state_up': _('The administrative state of the ipsec site '
'connection.'),
'auth_mode': _('The authentication mode of the ipsec site '
'connection.'),
'description': _('The description of the ipsec site connection.'),
'dpd': _('The dead peer detection protocol configuration of the ipsec '
'site connection.'),
'ikepolicy_id': _('The unique identifier of ike policy associated '
'with the ipsec site connection.'),
'initiator': _('The initiator of the ipsec site connection.'),
'ipsecpolicy_id': _('The unique identifier of ipsec policy '
'associated with the ipsec site connection.'),
'mtu': _('The maximum transmission unit size (in bytes) of the ipsec '
'site connection.'),
'name': _('The name of the ipsec site connection.'),
'peer_address': _('The remote branch router public IPv4 address or '
'IPv6 address or FQDN.'),
'peer_cidrs': _('The remote subnet(s) in CIDR format of the ipsec '
'site connection.'),
'peer_id': _('The remote branch router identity of the ipsec site '
'connection.'),
'psk': _('The pre-shared key string of the ipsec site connection.'),
'route_mode': _('The route mode of the ipsec site connection.'),
'status': _('The status of the ipsec site connection.'),
'tenant_id': _('The unique identifier of the tenant owning the ipsec '
'site connection.'),
'vpnservice_id': _('The unique identifier of vpn service associated '
'with the ipsec site connection.')
'admin_state_up': attributes.Schema(
_('The administrative state of the ipsec site connection.')
),
'auth_mode': attributes.Schema(
_('The authentication mode of the ipsec site connection.')
),
'description': attributes.Schema(
_('The description of the ipsec site connection.')
),
'dpd': attributes.Schema(
_('The dead peer detection protocol configuration of the ipsec '
'site connection.')
),
'ikepolicy_id': attributes.Schema(
_('The unique identifier of ike policy associated with the ipsec '
'site connection.')
),
'initiator': attributes.Schema(
_('The initiator of the ipsec site connection.')
),
'ipsecpolicy_id': attributes.Schema(
_('The unique identifier of ipsec policy associated with the '
'ipsec site connection.')
),
'mtu': attributes.Schema(
_('The maximum transmission unit size (in bytes) of the ipsec '
'site connection.')
),
'name': attributes.Schema(
_('The name of the ipsec site connection.')
),
'peer_address': attributes.Schema(
_('The remote branch router public IPv4 address or IPv6 address '
'or FQDN.')
),
'peer_cidrs': attributes.Schema(
_('The remote subnet(s) in CIDR format of the ipsec site '
'connection.')
),
'peer_id': attributes.Schema(
_('The remote branch router identity of the ipsec site '
'connection.')
),
'psk': attributes.Schema(
_('The pre-shared key string of the ipsec site connection.')
),
'route_mode': attributes.Schema(
_('The route mode of the ipsec site connection.')
),
'status': attributes.Schema(
_('The status of the ipsec site connection.')
),
'tenant_id': attributes.Schema(
_('The unique identifier of the tenant owning the ipsec site '
'connection.')
),
'vpnservice_id': attributes.Schema(
_('The unique identifier of vpn service associated with the ipsec '
'site connection.')
),
}
update_allowed_keys = ('Properties',)
@ -395,20 +443,34 @@ class IKEPolicy(neutron.NeutronResource):
}
attributes_schema = {
'auth_algorithm': _('The authentication hash algorithm used by the ike'
' policy.'),
'description': _('The description of the ike policy.'),
'encryption_algorithm': _('The encryption algorithm used by the ike '
'policy.'),
'ike_version': _('The version of the ike policy.'),
'lifetime': _('The safety assessment lifetime configuration for the '
'ike policy.'),
'name': _('The name of the ike policy.'),
'pfs': _('The perfect forward secrecy of the ike policy.'),
'phase1_negotiation_mode': _('The negotiation mode of the ike '
'policy.'),
'tenant_id': _('The unique identifier of the tenant owning the ike '
'policy.'),
'auth_algorithm': attributes.Schema(
_('The authentication hash algorithm used by the ike policy.')
),
'description': attributes.Schema(
_('The description of the ike policy.')
),
'encryption_algorithm': attributes.Schema(
_('The encryption algorithm used by the ike policy.')
),
'ike_version': attributes.Schema(
_('The version of the ike policy.')
),
'lifetime': attributes.Schema(
_('The safety assessment lifetime configuration for the ike '
'policy.')
),
'name': attributes.Schema(
_('The name of the ike policy.')
),
'pfs': attributes.Schema(
_('The perfect forward secrecy of the ike policy.')
),
'phase1_negotiation_mode': attributes.Schema(
_('The negotiation mode of the ike policy.')
),
'tenant_id': attributes.Schema(
_('The unique identifier of the tenant owning the ike policy.')
),
}
update_allowed_keys = ('Properties',)
@ -535,19 +597,34 @@ class IPsecPolicy(neutron.NeutronResource):
}
attributes_schema = {
'auth_algorithm': _('The authentication hash algorithm of the ipsec '
'policy.'),
'description': _('The description of the ipsec policy.'),
'encapsulation_mode': _('The encapsulation mode of the ipsec policy.'),
'encryption_algorithm': _('The encryption algorithm of the ipsec '
'policy.'),
'lifetime': _('The safety assessment lifetime configuration of the '
'ipsec policy.'),
'name': _('The name of the ipsec policy.'),
'pfs': _('The perfect forward secrecy of the ipsec policy.'),
'tenant_id': _('The unique identifier of the tenant owning the '
'ipsec policy.'),
'transform_protocol': _('The transform protocol of the ipsec policy.')
'auth_algorithm': attributes.Schema(
_('The authentication hash algorithm of the ipsec policy.')
),
'description': attributes.Schema(
_('The description of the ipsec policy.')
),
'encapsulation_mode': attributes.Schema(
_('The encapsulation mode of the ipsec policy.')
),
'encryption_algorithm': attributes.Schema(
_('The encryption algorithm of the ipsec policy.')
),
'lifetime': attributes.Schema(
_('The safety assessment lifetime configuration of the ipsec '
'policy.')
),
'name': attributes.Schema(
_('The name of the ipsec policy.')
),
'pfs': attributes.Schema(
_('The perfect forward secrecy of the ipsec policy.')
),
'tenant_id': attributes.Schema(
_('The unique identifier of the tenant owning the ipsec policy.')
),
'transform_protocol': attributes.Schema(
_('The transform protocol of the ipsec policy.')
),
}
update_allowed_keys = ('Properties',)

View File

@ -11,6 +11,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from heat.engine import attributes
from heat.engine import clients
from heat.engine import properties
from heat.engine import resource
@ -33,8 +34,12 @@ class NovaFloatingIp(resource.Resource):
}
attributes_schema = {
'pool': _('Pool from which floating IP is allocated.'),
'ip': _('Allocated floating IP address.')
'pool': attributes.Schema(
_('Pool from which floating IP is allocated.')
),
'ip': attributes.Schema(
_('Allocated floating IP address.')
),
}
def __init__(self, name, json_snippet, stack):

View File

@ -14,6 +14,7 @@
from novaclient import exceptions as nova_exceptions
from heat.common import exception
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
@ -62,8 +63,12 @@ class KeyPair(resource.Resource):
}
attributes_schema = {
'public_key': _('The public key.'),
'private_key': _('The private key if it has been saved.')
'public_key': attributes.Schema(
_('The public key.')
),
'private_key': attributes.Schema(
_('The private key if it has been saved.')
),
}
def __init__(self, name, json_snippet, stack):

View File

@ -12,6 +12,7 @@
# under the License.
from heat.common import exception
from heat.engine import attributes
from heat.engine.clients import troveclient
from heat.engine import constraints
from heat.engine import properties
@ -162,8 +163,12 @@ class OSDBInstance(resource.Resource):
}
attributes_schema = {
"hostname": _("Hostname of the instance"),
"href": _("Api endpoint reference of the instance")
"hostname": attributes.Schema(
_("Hostname of the instance")
),
"href": attributes.Schema(
_("Api endpoint reference of the instance")
),
}
def __init__(self, name, json_snippet, stack):

View File

@ -16,6 +16,7 @@ import string
from six.moves import xrange
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
@ -62,8 +63,10 @@ class RandomString(resource.Resource):
}
attributes_schema = {
'value': _('The random string generated by this resource. This value '
'is also available by referencing the resource.'),
'value': attributes.Schema(
_('The random string generated by this resource. This value is '
'also available by referencing the resource.')
),
}
_sequences = {

View File

@ -14,6 +14,7 @@
import copy
from heat.common import exception
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import parser
from heat.engine import properties
@ -85,7 +86,9 @@ class ResourceGroup(stack_resource.StackResource):
}
attributes_schema = {
"refs": _("A list of resource IDs for the resources in the group")
"refs": attributes.Schema(
_("A list of resource IDs for the resources in the group")
),
}
update_allowed_keys = ("Properties",)

View File

@ -13,6 +13,7 @@
from six.moves.urllib import parse as urlparse
from heat.engine import attributes
from heat.engine import clients
from heat.engine import constraints
from heat.engine import properties
@ -93,8 +94,12 @@ class S3Bucket(resource.Resource):
}
attributes_schema = {
'DomainName': _('The DNS name of the specified bucket.'),
'WebsiteURL': _('The website endpoint for the specified bucket.')
'DomainName': attributes.Schema(
_('The DNS name of the specified bucket.')
),
'WebsiteURL': attributes.Schema(
_('The website endpoint for the specified bucket.')
),
}
def tags_to_headers(self):

View File

@ -299,11 +299,16 @@ class Server(stack_user.StackUser):
}
attributes_schema = {
'show': _('A dict of all server details as returned by the API.'),
'addresses': _('A dict of all network addresses with corresponding '
'port_id.'),
'networks': _('A dict of assigned network addresses of the form: '
'{"public": [ip1, ip2...], "private": [ip3, ip4]}.'),
'show': attributes.Schema(
_('A dict of all server details as returned by the API.')
),
'addresses': attributes.Schema(
_('A dict of all network addresses with corresponding port_id.')
),
'networks': attributes.Schema(
_('A dict of assigned network addresses of the form: '
'{"public": [ip1, ip2...], "private": [ip3, ip4]}.')
),
'first_address': attributes.Schema(
_('Convenience attribute to fetch the first assigned network '
'address, or an empty string if nothing has been assigned at '
@ -316,11 +321,17 @@ class Server(stack_user.StackUser):
'[<server name>, networks, <network name>, 0]}"')
)
),
'instance_name': _('AWS compatible instance name.'),
'accessIPv4': _('The manually assigned alternative public IPv4 '
'address of the server.'),
'accessIPv6': _('The manually assigned alternative public IPv6 '
'address of the server.'),
'instance_name': attributes.Schema(
_('AWS compatible instance name.')
),
'accessIPv4': attributes.Schema(
_('The manually assigned alternative public IPv4 address '
'of the server.')
),
'accessIPv6': attributes.Schema(
_('The manually assigned alternative public IPv6 address '
'of the server.')
),
}
update_allowed_keys = ('Metadata', 'Properties')

View File

@ -14,6 +14,7 @@
import heatclient.exc as heat_exp
from heat.common import exception
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
@ -140,7 +141,9 @@ class SoftwareConfig(resource.Resource):
}
attributes_schema = {
"config": _("The config value of the software config.")
"config": attributes.Schema(
_("The config value of the software config.")
),
}
def handle_create(self):

View File

@ -19,6 +19,7 @@ import uuid
import heatclient.exc as heat_exp
from heat.common import exception
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import function
from heat.engine import properties
@ -149,10 +150,15 @@ class SoftwareDeployment(signal_responder.SignalResponder):
}
attributes_schema = {
STDOUT: _("Captured stdout from the configuration execution."),
STDERR: _("Captured stderr from the configuration execution."),
STATUS_CODE: _("Returned status code from the configuration "
"execution"),
STDOUT: attributes.Schema(
_("Captured stdout from the configuration execution.")
),
STDERR: attributes.Schema(
_("Captured stderr from the configuration execution.")
),
STATUS_CODE: attributes.Schema(
_("Returned status code from the configuration execution")
),
}
update_allowed_keys = ('Properties',)

View File

@ -14,6 +14,7 @@
from six.moves.urllib import parse as urlparse
from heat.common import exception
from heat.engine import attributes
from heat.engine import clients
from heat.engine import properties
from heat.engine import resource
@ -64,12 +65,24 @@ class SwiftContainer(resource.Resource):
}
attributes_schema = {
'DomainName': _('The host from the container URL.'),
'WebsiteURL': _('The URL of the container.'),
'RootURL': _('The parent URL of the container.'),
'ObjectCount': _('The number of objects stored in the container.'),
'BytesUsed': _('The number of bytes stored in the container.'),
'HeadContainer': _('A map containing all headers for the container.')
'DomainName': attributes.Schema(
_('The host from the container URL.')
),
'WebsiteURL': attributes.Schema(
_('The URL of the container.')
),
'RootURL': attributes.Schema(
_('The parent URL of the container.')
),
'ObjectCount': attributes.Schema(
_('The number of objects stored in the container.')
),
'BytesUsed': attributes.Schema(
_('The number of bytes stored in the container.')
),
'HeadContainer': attributes.Schema(
_('A map containing all headers for the container.')
),
}
def physical_resource_name(self):

View File

@ -12,6 +12,7 @@
# under the License.
from heat.common import exception
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
@ -153,8 +154,12 @@ class AccessKey(resource.Resource):
}
attributes_schema = {
'UserName': _('Username associated with the AccessKey.'),
'SecretAccessKey': _('Keypair secret key.'),
'UserName': attributes.Schema(
_('Username associated with the AccessKey.')
),
'SecretAccessKey': attributes.Schema(
_('Keypair secret key.')
),
}
def __init__(self, name, json_snippet, stack):

View File

@ -14,6 +14,7 @@
import json
from heat.common import exception
from heat.engine import attributes
from heat.engine import clients
from heat.engine import constraints
from heat.engine import properties
@ -481,20 +482,39 @@ class CinderVolume(Volume):
}
attributes_schema = {
'availability_zone': _('The availability zone in which the volume is '
' located.'),
'size': _('The size of the volume in GB.'),
'snapshot_id': _('The snapshot the volume was created from, if any.'),
'display_name': _('Name of the volume.'),
'display_description': _('Description of the volume.'),
'volume_type': _('The type of the volume mapping to a backend, if '
'any.'),
'metadata': _('Key/value pairs associated with the volume.'),
'source_volid': _('The volume used as source, if any.'),
'status': _('The current status of the volume.'),
'created_at': _('The timestamp indicating volume creation.'),
'bootable': _('Boolean indicating if the volume can be booted or '
'not.'),
'availability_zone': attributes.Schema(
_('The availability zone in which the volume is located.')
),
'size': attributes.Schema(
_('The size of the volume in GB.')
),
'snapshot_id': attributes.Schema(
_('The snapshot the volume was created from, if any.')
),
'display_name': attributes.Schema(
_('Name of the volume.')
),
'display_description': attributes.Schema(
_('Description of the volume.')
),
'volume_type': attributes.Schema(
_('The type of the volume mapping to a backend, if any.')
),
'metadata': attributes.Schema(
_('Key/value pairs associated with the volume.')
),
'source_volid': attributes.Schema(
_('The volume used as source, if any.')
),
'status': attributes.Schema(
_('The current status of the volume.')
),
'created_at': attributes.Schema(
_('The timestamp indicating volume creation.')
),
'bootable': attributes.Schema(
_('Boolean indicating if the volume can be booted or not.')
),
}
_volume_creating_status = ['creating', 'restoring-backup', 'downloading']

View File

@ -15,6 +15,7 @@ import json
from heat.common import exception
from heat.common import identifier
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import function
from heat.engine import properties
@ -178,8 +179,10 @@ class WaitCondition(resource.Resource):
}
attributes_schema = {
'Data': _('JSON serialized dict containing data associated with wait '
'condition signals sent to the handle.'),
'Data': attributes.Schema(
_('JSON serialized dict containing data associated with wait '
'condition signals sent to the handle.')
),
}
update_allowed_keys = ('Properties',)