-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rewrite most of documentation. * Make creating the `$openstack` object more clear. * Rename and rearrange main operations as CRUDL (Create, Read, Update, Delete, List)
- Loading branch information
Showing
256 changed files
with
1,709 additions
and
1,847 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from docutils.parsers.rst import Directive | ||
from docutils import nodes | ||
|
||
|
||
class OsDoc(Directive): | ||
required_arguments = 1 | ||
has_content = True | ||
|
||
def run(self): | ||
full_url = self.arguments[0] | ||
title = 'official documentation' | ||
|
||
text = [] | ||
text.extend([ | ||
nodes.Text('More information can be found in the '), | ||
nodes.reference(title, title, internal=False, refuri=self.arguments[0]), | ||
nodes.Text('.') | ||
]) | ||
|
||
return [nodes.paragraph( | ||
'', | ||
'', | ||
nodes.Text('More information can be found in the '), | ||
nodes.reference(title, title, internal=False, refuri=full_url), | ||
nodes.Text('.') | ||
)] | ||
|
||
|
||
def setup(app): | ||
app.add_directive('osdoc', OsDoc) | ||
return {'version': '0.1'} |
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 |
---|---|---|
@@ -1,33 +1,41 @@ | ||
from docutils import nodes | ||
from sphinx.addnodes import download_reference | ||
from docutils.parsers.rst import directives | ||
from sphinx.directives.code import LiteralInclude | ||
import re | ||
|
||
from sphinx.util.typing import OptionSpec | ||
|
||
|
||
class Sample(LiteralInclude): | ||
option_spec: OptionSpec = { | ||
'full': directives.flag, | ||
} | ||
|
||
def run(self): | ||
self.arguments[0] = "/../samples/" + self.arguments[0] | ||
self.options['language'] = 'php' | ||
|
||
def run(self): | ||
self.arguments[0] = "/../samples/" + self.arguments[0] | ||
self.options['language'] = 'php' | ||
pattern = r"[\s+]?(\<\?php.*?]\);)" | ||
|
||
pattern = r"[\s+]?(\<\?php.*?]\);)" | ||
code_block = super(Sample, self).run()[0] | ||
if 'full' in self.options: | ||
return [code_block] | ||
|
||
code_block = super(Sample, self).run()[0] | ||
string = str(code_block[0]) | ||
string = str(code_block[0]) | ||
|
||
match = re.match(pattern, string, re.S) | ||
if match is None: | ||
return [code_block] | ||
match = re.match(pattern, string, re.S) | ||
if match is None: | ||
return [code_block] | ||
|
||
auth_str = match.group(1).strip() | ||
main_str = re.sub(pattern, "", string, 0, re.S).strip() | ||
main_str = re.sub(pattern, "", string, 0, re.S).strip() | ||
if main_str == '': | ||
return [code_block] | ||
|
||
show_hide_btn = download_reference(reftarget=self.arguments[0]) | ||
return [ | ||
nodes.literal_block(main_str, main_str, language="php") | ||
] | ||
|
||
return [ | ||
show_hide_btn, | ||
nodes.literal_block(auth_str, auth_str, language="php"), | ||
nodes.literal_block(main_str, main_str, language="php")] | ||
|
||
def setup(app): | ||
app.add_directive('sample', Sample) | ||
return {'version': '0.1'} | ||
app.add_directive('sample', Sample) | ||
return {'version': '0.1'} |
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,4 @@ | ||
summary { | ||
margin-bottom: 1rem; | ||
cursor: pointer; | ||
} |
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,18 @@ | ||
Create Service | ||
============== | ||
|
||
In order to work with the service you have to :doc:`setup the client </setup>` first. | ||
|
||
Service can be created via :substitution-code:`|method|()` method of the ``OpenStack`` object. | ||
|
||
.. code-block:: php | ||
:substitutions: | ||
$service = $openstack->|method|(); | ||
A list of additional options can be passed to the method. For example, to change the region: | ||
|
||
.. code-block:: php | ||
:substitutions: | ||
$service = $openstack->|method|(['region' => '{region}']); |
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 @@ | ||
In order to work with |models| you have to :doc:`create the service <create>` first. |
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,35 @@ | ||
Installation | ||
============ | ||
|
||
Requirements | ||
------------ | ||
|
||
* PHP >= 7, < 9 | ||
* cURL extension | ||
|
||
Install via composer | ||
-------------------- | ||
|
||
You must install this library through Composer: | ||
|
||
.. code-block:: bash | ||
composer require php-opencloud/openstack | ||
If you do not have Composer installed, please read the `Composer installation instructions`_. | ||
|
||
Include autoloader | ||
------------------ | ||
|
||
Once you have installed the SDK as a dependency of your project, you will need to load Composer’s autoloader | ||
(which registers all the required namespaces). To do this, place the following line of PHP code at the top of your | ||
application’s PHP files: | ||
|
||
.. code-block:: php | ||
require 'vendor/autoload.php'; | ||
This assumes your application's PHP files are located in the same folder as ``vendor/``. If your files are located | ||
elsewhere, please supply the path to vendor/autoload.php in the require statement above. | ||
|
||
.. _Composer installation instructions: https://getcomposer.org/doc/00-intro.md |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
sphinxcontrib-phpdomain>=0.11.0 | ||
sphinx-rtd-theme>=0.5.1 | ||
sphinx-rtd-theme>=0.5.1 | ||
sphinx-toolbox>=3.5.0 | ||
sphinx-substitution-extensions |
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,3 @@ | ||
.. |method| replace:: blockStorageV3 | ||
|
||
.. include:: /common/create-service.rst |
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 |
---|---|---|
@@ -1,9 +1,15 @@ | ||
Block Storage v3 | ||
================ | ||
|
||
OpenStack Block Storage API v3 (Cinder). Cinder is the OpenStack Block Storage service for providing volumes | ||
to Nova virtual machines, Ironic bare metal hosts, containers and more. | ||
|
||
.. osdoc:: https://docs.openstack.org/api-ref/block-storage/v3/ | ||
|
||
.. toctree:: | ||
:maxdepth: 3 | ||
:maxdepth: 3 | ||
|
||
volumes | ||
volume-types | ||
snapshots | ||
create | ||
volumes | ||
volume-types | ||
snapshots |
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.