Skip to content

Commit e7528be

Browse files
committed
Add support for description of tags
1 parent 25f8c4b commit e7528be

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

ec2stack/controllers/default.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def _get_action(action):
4545
security_groups.authenticate_security_group_ingress,
4646
'CreateKeyPair': keypairs.create_keypair,
4747
'CreateSecurityGroup': security_groups.create_security_group,
48+
'CreateTag': tags.create_tags,
4849
'CreateVolume': volumes.create_volume,
4950
'DeleteKeyPair': keypairs.delete_keypair,
5051
'DeleteSecurityGroup': security_groups.delete_security_group,

ec2stack/providers/cloudstack/tags.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
@helpers.authentication_required
13-
def create_tag():
13+
def create_tags():
1414
"""
1515
Create a tag.
1616
@@ -67,6 +67,7 @@ def describe_tags():
6767
@return: Response.
6868
"""
6969
args = {'command': 'listTags'}
70+
response = requester.make_request(args)
7071
response = cloudstack.describe_item(
7172
args, 'tag', {}, 'TagId'
7273
)
@@ -84,7 +85,7 @@ def _describe_tags_response(response):
8485
@return: Response.
8586
"""
8687
return {
87-
'template_name_or_list': 'images.xml',
88+
'template_name_or_list': 'tags.xml',
8889
'response_type': 'DescribeTagsResponse',
8990
'response': response
9091
}

ec2stack/templates/tags.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{% extends "response.xml" %}
2+
{% block response_content %}
3+
{% for tag in response.tag %}
4+
<item>
5+
<resourceId>{{tag.resourceid}}</resourceId>
6+
<resourceType>{{tag.resourcetype}}</resourceType>
7+
<key>{{tag.key}}</key>
8+
<value>{{tag.value}}</value>
9+
</item>
10+
{% endfor %}
11+
{% endblock %}

0 commit comments

Comments
 (0)