Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 31 additions & 23 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@ packages.
Documentation
-------------

* `Documentation <http://python-otcextensions.readthedocs.io/en/latest/>`
`Documentation Overview <http://python-otcextensions.readthedocs.io/en/latest/>`_

Installation
------------

`Installation Page <https://python-otcextensions.readthedocs.io/en/latest/install/index.html>`_

The OTC Extensions are hosted as the package `otcextensions` on PyPI
and can be installed by pip as

.. code-block: console

$ pip install otcextensions

There are several options
Expand All @@ -38,10 +41,11 @@ installation as well as installation from operating system packets or directly
from source. Refer to the installation instructions_ in the projects
documentation.


Configuration
-------------

`Configuration Page <https://python-otcextensions.readthedocs.io/en/latest/install/configuration.html>`_

Acessing the Open Telekom Cloud APIs requires authentication and
authorization. For both there are several options available:

Expand All @@ -58,26 +62,28 @@ authorization. For both there are several options available:

.. code-block:: yaml

clouds:
otc:
profile: otc
auth:
username: "*username*"
password: "*password*"
project_name: "eu-de"
auth_url: "https://iam.eu-de.otc.t-systems.com:443/v3"
user_domain_name: "*OTC00000000001000000xxx*"
interface: "public"
identity_api_version: 3
ak: "*40 digit access key*"
sk: "*20 digit secure key*"
clouds:
otc:
profile: otc
auth:
username: '<USER_NAME>'
password: '<PASSWORD>'
project_name: '<eu-de_project>'
# or project_id: '<123456_PROJECT_ID>'
user_domain_name: 'OTC00000000001000000xxx'
# or user_domain_id: '<123456_DOMAIN_ID>'
auth_url: 'https://iam.eu-de.otc.t-systems.com:443/v3'
interface: 'public'
identity_api_version: 3 # !Important
ak: '<AK_VALUE>' # AK/SK pair for access to OBS
sk: '<SK_VALUE>'

With this configuration you can start using the CLI with ``openstack
--os-cloud otc *command*`` or by ``export OS_CLOUD=otc; openstack
*command*``.

* **Environment variables:** Authentication using username/password is often
used:
used::

export OS_AUTH_URL=<url-to-openstack-identity>
export OS_IDENTITY_API_VERSION=3
Expand All @@ -89,7 +95,6 @@ authorization. For both there are several options available:
export S3_ACCESS_KEY_ID=<access_key>
export S3_SECRET_ACCESS_KEY=<secret_access_key>


* **Command-Line Options:** The corresponding command-line options look
very similar::

Expand All @@ -111,7 +116,7 @@ authorization. For both there are several options available:
export OS_TOKEN=<token>
export OS_URL=<url-to-openstack-service>

The corresponding command-line options look very similar::
* The corresponding command-line options look very similar::

--os-token <token>
--os-url <url-to-openstack-service>
Expand All @@ -123,21 +128,24 @@ https://docs.openstack.org/python-openstackclient/latest/cli/authentication.html
or
https://developer.openstack.org/sdks/python/openstacksdk/users/config

OTC Extensions CLI Usage
------------------------

`OTCE CLI Command Overview <https://python-otcextensions.readthedocs.io/en/latest/cli/index.html>`_

Writing Own Code
----------------
OTC Extensions SDK Guides
-------------------------

XXX Example XXXX
`OTCE SDK Guides <https://python-otcextensions.readthedocs.io/en/latest/sdk/guides/index.html>`_

Contributing
------------

See CONTRIBUTING.rst
* `Contribution Page <https://python-otcextensions.readthedocs.io/en/latest/contributor/index.html>`_

Further Links
-------------

* `Issue Tracker <https://github.com/OpenTelekomCloud/python-otcextensions/issues>`_

.. _instructions: http://python-otcextensions.readthedocs.io/en/latest/install/

43 changes: 43 additions & 0 deletions doc/source/cli/ces.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Cloud Eye Service (CES)
=======================

The CES client is the command-line interface (CLI) for
the Cloud Eye Service (CES) API and its extensions.

For help on a specific `ces` command, enter:

.. code-block:: console

$ openstack ces help SUBCOMMAND

.. _alarm:

Alarm Rule Operations
---------------------

.. autoprogram-cliff:: openstack.ces.v1
:command: ces alarm *

.. _metric:

Metric Operations
-----------------

.. autoprogram-cliff:: openstack.ces.v1
:command: ces metric *

.. _quota:

Quota Operations
----------------

.. autoprogram-cliff:: openstack.ces.v1
:command: ces quota *

.. _event_data:

Event Data Operations
---------------------

.. autoprogram-cliff:: openstack.ces.v1
:command: ces event data *
19 changes: 19 additions & 0 deletions doc/source/cli/identity.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Identity Service (IAM)
======================

The Identity client is the command-line interface (CLI) for
the Identity Service (IAM) API and its extensions.

For help on a specific `identity` command, enter:

.. code-block:: console

$ openstack identity help SUBCOMMAND

.. _identity_credential:

Identity Credential Operations
------------------------------

.. autoprogram-cliff:: openstack.identity.v3
:command: identity credential *
2 changes: 2 additions & 0 deletions doc/source/cli/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ documentation of these services:
anti_ddos
auto_scaling
cce_v2
ces
cts
dcs
deh
dms
dns
identity
kms
load_balancer
nat
Expand Down
4 changes: 2 additions & 2 deletions doc/source/coverage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ under several service tags. This may change in future.
* - ces
- Cloudeye
- X
-
-
- X
- X
-
* - cts
- Clout Trace Service
Expand Down
1 change: 1 addition & 0 deletions doc/source/enforcer.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def get_proxy_methods():
names = ["otcextensions.sdk.anti_ddos.v1._proxy",
"otcextensions.sdk.auto_scaling.v1._proxy",
"otcextensions.sdk.cce.v1._proxy",
"otcextensions.sdk.ces.v1._proxy",
"otcextensions.sdk.cts.v1._proxy",
"otcextensions.sdk.dcs.v1._proxy",
"otcextensions.sdk.dms.v1._proxy",
Expand Down
115 changes: 115 additions & 0 deletions doc/source/sdk/guides/ces.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
Cloud Eye Service (CES)
=========================

Cloud Eye (CES) is a high-performance monitoring service with integrated
alarm functions. Open Telekom Cloud users benefit from a dashboard with
a basic overview of resources and their current status. Users can
configure the alarm function in such a way that they receive
notifications via SMS or email. Monitoring with the Cloud Eye Service
is activated by default; the free service does not need to be booked
or activated.

.. contents:: Table of Contents
:local:

CES Alarm Rule
--------------

The alarm function is based on collected metrics. You can set alarm rules for
key metrics of cloud services. When the metric data triggers the conditions
set in the alarm rule, Cloud Eye sends emails, or text messages, to you, or
sends HTTP/HTTPS requests to the servers. In this way, you are immediately
informed of cloud service exceptions and can quickly handle the faults to
avoid service losses.

Cloud Eye uses the SMN service to notify users. This
requires you to create a topic and add subscriptions to this topic on the
SMN console first. Then when you create alarm rules, you can enable the
Alarm Notification function and select the created topic. When an error
occurs, Cloud Eye can broadcast alarm information to those subscriptions in
real time.


Create Alarm Rule
^^^^^^^^^^^^^^^^^

This interface is used to create a CES alarm with parameters.

.. literalinclude:: ../examples/ces/create_alarm.py
:lines: 16-89

Get Alarm Rule
^^^^^^^^^^^^^^

This interface is used to get a CES alarm rule by name or ID or an instance of
class :class:`~otcextensions.sdk.ces.v1.alarm.Alarm`.

.. literalinclude:: ../examples/ces/get_alarm.py
:lines: 16-24

Delete Alarm Rule
^^^^^^^^^^^^^^^^^

This interface is used to delete a CES Alarm Rule instance by id
or an instance of class
:class:`~otcextensions.sdk.cts.v1.tracker.Tracker`.

.. literalinclude:: ../examples/ces/delete_alarm.py
:lines: 16-25

Switch Alarm Rule State
^^^^^^^^^^^^^^^^^^^^^^^^

This interface is used to switch the Alarm Rule State by using name or id.

.. literalinclude:: ../examples/ces/switch_alarm_state.py
:lines: 16-25


Monitoring Data Management
--------------------------

Monitoring / Metric data is used to generate and query custom monitoring
data.

List Metric Data
^^^^^^^^^^^^^^^^

This interface is used to query all CES metric data and to filter
the output with query parameters.

.. literalinclude:: ../examples/ces/list_metric_data.py
:lines: 16-34


Miscellaneous
-------------

List Metrics
^^^^^^^^^^^^

This API is used to query the metric list. You can specify the namespace,
metric, dimension, sorting order, start records, and the maximum number of
records when using this API to query metrics.

.. literalinclude:: ../examples/ces/list_metrics.py
:lines: 16-23

List Quotas
^^^^^^^^^^^

This API is used to query a resource quota and the used amount. The current
resource refers to alarm rules only.

.. literalinclude:: ../examples/ces/list_quotas.py
:lines: 16-23

List Host Configuration / Event Data
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This API is used to query the host configuration for a specified event type
in a specified period of time. You can specify the dimension of data to be
queried.

.. literalinclude:: ../examples/ces/list_event_data.py
:lines: 16-32
1 change: 1 addition & 0 deletions doc/source/sdk/guides/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Open Telekom Cloud related User Guides
anti_ddos
auto_scaling
cce
ces
cts
dcs
deh
Expand Down
34 changes: 34 additions & 0 deletions doc/source/sdk/proxies/ces.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
CES API
=======

.. automodule:: otcextensions.sdk.ces.v1._proxy

The Cloud Eye Service Class
---------------------------

The CES high-level interface is available through the ``ces``
member of a :class:`~openstack.connection.Connection` object. The
``ces`` member will only be added if the
``otcextensions.sdk.register_otc_extensions(conn)`` method is called.

Alarm Rule Operations
^^^^^^^^^^^^^^^^^^^^^

.. autoclass:: otcextensions.sdk.ces.v1._proxy.Proxy
:noindex:
:members: alarms, get_alarm, create_alarm, delete_alarm, find_alarm,
switch_alarm_state

Monitoring Data Operations
^^^^^^^^^^^^^^^^^^^^^^^^^^

.. autoclass:: otcextensions.sdk.ces.v1._proxy.Proxy
:noindex:
:members: metric_data

Miscellaneous Operations
^^^^^^^^^^^^^^^^^^^^^^^^

.. autoclass:: otcextensions.sdk.ces.v1._proxy.Proxy
:noindex:
:members: metrics, quotas, event_data
4 changes: 2 additions & 2 deletions doc/source/sdk/proxies/cts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ CTS API

.. automodule:: otcextensions.sdk.cts.v1._proxy

The Distributed Message Service Class
-------------------------------------
The Cloud Trace Service Class
-----------------------------

The CTS high-level interface is available through the ``cts``
member of a :class:`~openstack.connection.Connection` object. The
Expand Down
1 change: 1 addition & 0 deletions doc/source/sdk/proxies/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Service Proxies
AutoScaling Service (AS) <auto_scaling>
Cloud Container Engine v1 (CCEv1) <cce_v1>
Cloud Container Engine v2 (CCE) <cce_v3>
Cloud Eye Service (CES) <ces>
Cloud Trace Service (CTS) <cts>
Distributed Cache Service (DCS) <dcs>
Dedicated Host Service (DeH) <deh>
Expand Down
Loading