Skip to content

Commit

Permalink
Restore read the docs (#371)
Browse files Browse the repository at this point in the history
* add readthedocs.yaml
* remove button
* move to python 3
  • Loading branch information
k0ka authored Dec 12, 2023
1 parent b49c6a6 commit 184990e
Show file tree
Hide file tree
Showing 16 changed files with 115 additions and 100 deletions.
22 changes: 22 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"

# Build documentation in the "doc/" directory with Sphinx
sphinx:
configuration: doc/conf.py

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: doc/requirements.txt
1 change: 1 addition & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea/
_build/
api-docs/build
12 changes: 2 additions & 10 deletions doc/_exts/samples.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from sphinx.directives import LiteralInclude
from docutils import nodes
from sphinx.addnodes import download_reference
from sphinx.writers.html import HTMLTranslator
from sphinx.directives.code import LiteralInclude
import re

class Sample(LiteralInclude):
Expand All @@ -10,7 +9,7 @@ def run(self):
self.arguments[0] = "/../samples/" + self.arguments[0]
self.options['language'] = 'php'

pattern = "[\s+]?(\<\?php.*?]\);)"
pattern = r"[\s+]?(\<\?php.*?]\);)"

code_block = super(Sample, self).run()[0]
string = str(code_block[0])
Expand All @@ -29,13 +28,6 @@ def run(self):
nodes.literal_block(auth_str, auth_str, language="php"),
nodes.literal_block(main_str, main_str, language="php")]

def visit_download_reference(self, node):
self.context.append('<a href="javascript:void(0);" class="toggle btn">Show auth code</a>')

def depart_download_reference(self, node):
self.body.append(self.context.pop())

def setup(app):
app.add_node(download_reference, html=(visit_download_reference, depart_download_reference))
app.add_directive('sample', Sample)
return {'version': '0.1'}
2 changes: 1 addition & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sphinxcontrib-phpdomain==0.1.4
sphinxcontrib-phpdomain>=0.11.0
10 changes: 5 additions & 5 deletions doc/services/identity/v3/credentials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,35 @@ Add credential
Create a secret/access pair for use with ec2 style auth. This operation will generates a new set of credentials that
map the user/tenant pair.

.. sample:: Identity/v2/credentials/add_cred.php
.. sample:: Identity/v3/credentials/add_cred.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_createCredential

List credentials
----------------

List all credentials for a given user.

.. sample:: Identity/v2/credentials/list_creds.php
.. sample:: Identity/v3/credentials/list_creds.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_listCredentials

Show credential details
-----------------------

Retrieve a user's access/secret pair by the access key.

.. sample:: Identity/v2/credentials/get_cred.php
.. sample:: Identity/v3/credentials/get_cred.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_getCredential

Update credential
-----------------

.. sample:: Identity/v2/credentials/update_cred.php
.. sample:: Identity/v3/credentials/update_cred.php
.. refdoc:: OpenStack/Identity/v3/Models/Credential.html#method_update

Delete credential
-----------------

Delete a user's access/secret pair.

.. sample:: Identity/v2/credentials/delete_cred.php
.. sample:: Identity/v3/credentials/delete_cred.php
.. refdoc:: OpenStack/Identity/v3/Models/Credential.html#method_delete
26 changes: 13 additions & 13 deletions doc/services/identity/v3/domains.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,77 +4,77 @@ Domains
Add domain
----------

.. sample:: Identity/v2/domains/add_domain.php
.. sample:: Identity/v3/domains/add_domain.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_createDomain

List domains
------------

.. sample:: Identity/v2/domains/list_domains.php
.. sample:: Identity/v3/domains/list_domains.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_listDomains

Show domain details
-------------------

.. sample:: Identity/v2/domains/show_domain.php
.. sample:: Identity/v3/domains/show_domain.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_getDomain

Update domain
-------------

.. sample:: Identity/v2/domains/update_domain.php
.. sample:: Identity/v3/domains/update_domain.php
.. refdoc:: OpenStack/Identity/v3/Models/Domain.html#method_update

Delete domain
-------------

.. sample:: Identity/v2/domains/delete_domain.php
.. sample:: Identity/v3/domains/delete_domain.php
.. refdoc:: OpenStack/Identity/v3/Models/Domain.html#method_delete

List roles for domain user
--------------------------

.. sample:: Identity/v2/domains/list_user_roles.php
.. sample:: Identity/v3/domains/list_user_roles.php
.. refdoc:: OpenStack/Identity/v3/Models/Domain.html#method_listUserRoles

Grant role to domain user
-------------------------

.. sample:: Identity/v2/domains/grant_user_role.php
.. sample:: Identity/v3/domains/grant_user_role.php
.. refdoc:: OpenStack/Identity/v3/Models/Domain.html#method_grantUserRole

Check role for domain user
--------------------------

.. sample:: Identity/v2/domains/check_user_role.php
.. sample:: Identity/v3/domains/check_user_role.php
.. refdoc:: OpenStack/Identity/v3/Models/Domain.html#method_checkUserRole

Revoke role for domain user
---------------------------

.. sample:: Identity/v2/domains/revoke_user_role.php
.. sample:: Identity/v3/domains/revoke_user_role.php
.. refdoc:: OpenStack/Identity/v3/Models/Domain.html#method_revokeUserRole

List roles for domain group
---------------------------

.. sample:: Identity/v2/domains/list_group_roles.php
.. sample:: Identity/v3/domains/list_group_roles.php
.. refdoc:: OpenStack/Identity/v3/Models/Domain.html#method_listGroupRoles

Grant role to domain group
--------------------------

.. sample:: Identity/v2/domains/grant_group_role.php
.. sample:: Identity/v3/domains/grant_group_role.php
.. refdoc:: OpenStack/Identity/v3/Models/Domain.html#method_grantGroupRole

Check role for domain group
---------------------------

.. sample:: Identity/v2/domains/check_group_role.php
.. sample:: Identity/v3/domains/check_group_role.php
.. refdoc:: OpenStack/Identity/v3/Models/Domain.html#method_checkGroupRole

Revoke role for domain group
----------------------------

.. sample:: Identity/v2/domains/revoke_group_role.php
.. sample:: Identity/v3/domains/revoke_group_role.php
.. refdoc:: OpenStack/Identity/v3/Models/Domain.html#method_revokeGroupRole
10 changes: 5 additions & 5 deletions doc/services/identity/v3/endpoints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ Endpoints
Add endpoints
-------------

.. sample:: Identity/v2/endpoints/add_endpoint.php
.. sample:: Identity/v3/endpoints/add_endpoint.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_createEndpoint

Get endpoint
------------

.. sample:: Identity/v2/endpoints/get_endpoint.php
.. sample:: Identity/v3/endpoints/get_endpoint.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_getEndpoint

List endpoints
--------------

.. sample:: Identity/v2/endpoints/list_endpoints.php
.. sample:: Identity/v3/endpoints/list_endpoints.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_listEndpoints

Update endpoint
---------------

.. sample:: Identity/v2/endpoints/update_endpoint.php
.. sample:: Identity/v3/endpoints/update_endpoint.php
.. refdoc:: OpenStack/Identity/v3/Models/Endpoint.html#method_update

Delete endpoint
---------------

.. sample:: Identity/v2/endpoints/delete_endpoint.php
.. sample:: Identity/v3/endpoints/delete_endpoint.php
.. refdoc:: OpenStack/Identity/v3/Models/Endpoint.html#method_delete
18 changes: 9 additions & 9 deletions doc/services/identity/v3/groups.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,53 @@ Groups
Add group
---------

.. sample:: Identity/v2/groups/add_group.php
.. sample:: Identity/v3/groups/add_group.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_createGroup

List groups
-----------

.. sample:: Identity/v2/groups/list_groups.php
.. sample:: Identity/v3/groups/list_groups.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_listGroups

Show group details
------------------

.. sample:: Identity/v2/groups/get_group.php
.. sample:: Identity/v3/groups/get_group.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_getGroup

Update group
------------

.. sample:: Identity/v2/groups/update_group.php
.. sample:: Identity/v3/groups/update_group.php
.. refdoc:: OpenStack/Identity/v3/Models/Group.html#method_update

Delete group
------------

.. sample:: Identity/v2/groups/delete_group.php
.. sample:: Identity/v3/groups/delete_group.php
.. refdoc:: OpenStack/Identity/v3/Models/Group.html#method_delete

List users in a group
---------------------

.. sample:: Identity/v2/groups/list_users.php
.. sample:: Identity/v3/groups/list_users.php
.. refdoc:: OpenStack/Identity/v3/Models/Group.html#method_listUsers

Add user to group
-----------------

.. sample:: Identity/v2/groups/add_user.php
.. sample:: Identity/v3/groups/add_user.php
.. refdoc:: OpenStack/Identity/v3/Models/Group.html#method_addUser

Remove user from group
----------------------

.. sample:: Identity/v2/groups/remove_user.php
.. sample:: Identity/v3/groups/remove_user.php
.. refdoc:: OpenStack/Identity/v3/Models/Group.html#method_removeUser

Check user membership in a group
--------------------------------

.. sample:: Identity/v2/groups/check_user_membership.php
.. sample:: Identity/v3/groups/check_user_membership.php
.. refdoc:: OpenStack/Identity/v3/Models/Group.html#method_checkMembership
26 changes: 13 additions & 13 deletions doc/services/identity/v3/projects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,77 +4,77 @@ Projects
Add project
-----------

.. sample:: Identity/v2/projects/add_project.php
.. sample:: Identity/v3/projects/add_project.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_createProject

List projects
-------------

.. sample:: Identity/v2/projects/list_projects.php
.. sample:: Identity/v3/projects/list_projects.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_listProjects

Show project details
--------------------

.. sample:: Identity/v2/projects/get_project.php
.. sample:: Identity/v3/projects/get_project.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_getProject

Update project
--------------

.. sample:: Identity/v2/projects/update_project.php
.. sample:: Identity/v3/projects/update_project.php
.. refdoc:: OpenStack/Identity/v3/Models/Project.html#method_update

Delete project
--------------

.. sample:: Identity/v2/projects/delete_project.php
.. sample:: Identity/v3/projects/delete_project.php
.. refdoc:: OpenStack/Identity/v3/Models/Project.html#method_delete

List roles for project user
---------------------------

.. sample:: Identity/v2/projects/list_user_roles.php
.. sample:: Identity/v3/projects/list_user_roles.php
.. refdoc:: OpenStack/Identity/v3/Models/Project.html#method_listUserRoles

Grant role to project user
--------------------------

.. sample:: Identity/v2/projects/grant_user_role.php
.. sample:: Identity/v3/projects/grant_user_role.php
.. refdoc:: OpenStack/Identity/v3/Models/Project.html#method_grantUserRole

Check role for project user
---------------------------

.. sample:: Identity/v2/projects/check_user_role.php
.. sample:: Identity/v3/projects/check_user_role.php
.. refdoc:: OpenStack/Identity/v3/Models/Project.html#method_checkUserRole

Revoke role for project user
----------------------------

.. sample:: Identity/v2/projects/revoke_user_role.php
.. sample:: Identity/v3/projects/revoke_user_role.php
.. refdoc:: OpenStack/Identity/v3/Models/Project.html#method_revokeUserRole

List roles for project group
----------------------------

.. sample:: Identity/v2/projects/list_group_roles.php
.. sample:: Identity/v3/projects/list_group_roles.php
.. refdoc:: OpenStack/Identity/v3/Models/Project.html#method_listGroupRoles

Grant role to project group
---------------------------

.. sample:: Identity/v2/projects/grant_group_role.php
.. sample:: Identity/v3/projects/grant_group_role.php
.. refdoc:: OpenStack/Identity/v3/Models/Project.html#method_grantGroupRole

Check role for project group
----------------------------

.. sample:: Identity/v2/projects/check_group_role.php
.. sample:: Identity/v3/projects/check_group_role.php
.. refdoc:: OpenStack/Identity/v3/Models/Project.html#method_checkGroupRole

Revoke role for project group
-----------------------------

.. sample:: Identity/v2/projects/revoke_group_role.php
.. sample:: Identity/v3/projects/revoke_group_role.php
.. refdoc:: OpenStack/Identity/v3/Models/Project.html#method_revokeGroupRole
Loading

0 comments on commit 184990e

Please sign in to comment.