-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
24 tag management service - predefined tags (#426)
24 tag management service - predefined tags Reviewed-by: Anton Sidelnikov
- Loading branch information
1 parent
dfa43e6
commit e50a947
Showing
19 changed files
with
650 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
TMS API | ||
======= | ||
|
||
.. automodule:: otcextensions.sdk.tms.v1._proxy | ||
|
||
The Tag Management Service Class | ||
-------------------------------- | ||
|
||
Tag Management Service (TMS) high-level interface is | ||
available through the ``tms`` member of a | ||
:class:`~openstack.connection.Connection` object. The ``tms`` member | ||
will only be added if the ``otcextensions.sdk.register_otc_extensions(conn)`` | ||
method is called. | ||
|
||
Predefined Tag Operations | ||
^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
.. autoclass:: otcextensions.sdk.tms.v1._proxy.Proxy | ||
:noindex: | ||
:members: predefined_tags, create_predefined_tag, delete_predefined_tag, | ||
update_predefined_tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
TMS Resources | ||
============= | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
v1/predefined_tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
otcextensions.sdk.tms.v1.predefined_tag | ||
======================================= | ||
|
||
.. automodule:: otcextensions.sdk.tms.v1.predefined_tag | ||
|
||
The Predefined Tag Class | ||
------------------------ | ||
|
||
The ``PredefinedTag`` class inherits from | ||
:class:`~otcextensions.sdk.sdk_resource.Resource`. | ||
|
||
.. autoclass:: otcextensions.sdk.tms.v1.predefined_tag.PredefinedTag | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env python3 | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
""" | ||
Add Predefined Tag | ||
""" | ||
import openstack | ||
from otcextensions import sdk | ||
|
||
openstack.enable_logging(True) | ||
conn = openstack.connect(cloud='otc') | ||
sdk.register_otc_extensions(conn) | ||
|
||
attrs = { | ||
'key': 'key2', | ||
'value': 'value2' | ||
} | ||
conn.tms.create_predefined_tag(**attrs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env python3 | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
""" | ||
Delete Predefined Tag | ||
""" | ||
import openstack | ||
from otcextensions import sdk | ||
|
||
openstack.enable_logging(True) | ||
conn = openstack.connect(cloud='otc') | ||
sdk.register_otc_extensions(conn) | ||
|
||
attrs = { | ||
'key': 'key2', | ||
'value': 'value2' | ||
} | ||
conn.tms.delete_predefined_tag(**attrs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env python3 | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
""" | ||
List Predefined Tags | ||
""" | ||
import openstack | ||
from otcextensions import sdk | ||
|
||
openstack.enable_logging(True) | ||
conn = openstack.connect(cloud='otc') | ||
sdk.register_otc_extensions(conn) | ||
|
||
tags = conn.tms.predefined_tags() | ||
print(tags) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env python3 | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
""" | ||
Update Predefined Tag | ||
""" | ||
import openstack | ||
from otcextensions import sdk | ||
|
||
openstack.enable_logging(True) | ||
conn = openstack.connect(cloud='otc') | ||
sdk.register_otc_extensions(conn) | ||
|
||
attrs = { | ||
"new_tag": { | ||
"key": "check_this", | ||
"value": "mate"}, | ||
"old_tag": { | ||
'key': 'key1', | ||
'value': 'value1' | ||
} | ||
} | ||
conn.tms.update_predefined_tag(**attrs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.