diff --git a/.github/workflows/integration_block_storage.yml b/.github/workflows/integration_block_storage.yml
index 3c344dbae..93dae7253 100644
--- a/.github/workflows/integration_block_storage.yml
+++ b/.github/workflows/integration_block_storage.yml
@@ -1,4 +1,4 @@
-name: Run Block Storage Integration Tests
+name: Block Storage Integration Tests
on:
workflow_dispatch:
diff --git a/.github/workflows/integration_compute.yml b/.github/workflows/integration_compute.yml
index a331f2e3b..e8c41bedb 100644
--- a/.github/workflows/integration_compute.yml
+++ b/.github/workflows/integration_compute.yml
@@ -1,4 +1,4 @@
-name: Run Compute Integration Tests
+name: Compute Integration Tests
on:
workflow_dispatch:
pull_request:
diff --git a/.github/workflows/integration_identity.yml b/.github/workflows/integration_identity.yml
index 97b81bc03..d35c54383 100644
--- a/.github/workflows/integration_identity.yml
+++ b/.github/workflows/integration_identity.yml
@@ -1,4 +1,4 @@
-name: Run Identity Integration Tests
+name: Identity Integration Tests
on:
workflow_dispatch:
pull_request:
diff --git a/.github/workflows/integration_images.yml b/.github/workflows/integration_images.yml
index e6278453f..21d071026 100644
--- a/.github/workflows/integration_images.yml
+++ b/.github/workflows/integration_images.yml
@@ -1,4 +1,4 @@
-name: Run Images Integration Tests
+name: Images Integration Tests
on:
workflow_dispatch:
pull_request:
diff --git a/.github/workflows/integration_networking.yml b/.github/workflows/integration_networking.yml
index eceef16fa..db3678a0a 100644
--- a/.github/workflows/integration_networking.yml
+++ b/.github/workflows/integration_networking.yml
@@ -1,4 +1,4 @@
-name: Run Networking Integration Tests
+name: Networking Integration Tests
on:
workflow_dispatch:
pull_request:
diff --git a/.github/workflows/integration_object_storage.yml b/.github/workflows/integration_object_storage.yml
index 1a76bcafe..5e0e7cc36 100644
--- a/.github/workflows/integration_object_storage.yml
+++ b/.github/workflows/integration_object_storage.yml
@@ -1,4 +1,4 @@
-name: Run Object Storage Integration Tests
+name: Object Storage Integration Tests
on:
workflow_dispatch:
pull_request:
diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml
index fefbc865d..ec1fccbe2 100644
--- a/.github/workflows/unit_tests.yml
+++ b/.github/workflows/unit_tests.yml
@@ -1,4 +1,4 @@
-name: Run Unit Tests
+name: Unit Tests
on:
workflow_dispatch:
pull_request:
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
new file mode 100644
index 000000000..5775c3f63
--- /dev/null
+++ b/.readthedocs.yaml
@@ -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
\ No newline at end of file
diff --git a/README.md b/README.md
index 85ca6e098..4dea18a4e 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,15 @@
# PHP OpenStack SDK
-[![Build Status](https://travis-ci.org/php-opencloud/openstack.svg?branch=master)](https://travis-ci.org/php-opencloud/openstack)
-[![Coverage Status](https://coveralls.io/repos/github/php-opencloud/openstack/badge.svg?branch=master)](https://coveralls.io/github/php-opencloud/openstack?branch=master)
-[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/php-opencloud/openstack/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/php-opencloud/openstack/?branch=master)
+
+![Unit tests](https://github.com/php-opencloud/openstack/actions/workflows/unit_tests.yml/badge.svg)
+[![Documentation Status](https://readthedocs.org/projects/php-openstack-sdk/badge/?version=latest)](https://php-openstack-sdk.readthedocs.io/en/latest/?badge=latest)
+
+[![Block Storage Integration Tests](https://github.com/php-opencloud/openstack/actions/workflows/integration_block_storage.yml/badge.svg)](https://github.com/php-opencloud/openstack/actions/workflows/integration_block_storage.yml)
+[![Compute Integration Tests](https://github.com/php-opencloud/openstack/actions/workflows/integration_compute.yml/badge.svg)](https://github.com/php-opencloud/openstack/actions/workflows/integration_compute.yml)
+[![Identity Integration Tests](https://github.com/php-opencloud/openstack/actions/workflows/integration_identity.yml/badge.svg)](https://github.com/php-opencloud/openstack/actions/workflows/integration_identity.yml)
+[![Images Integration Tests](https://github.com/php-opencloud/openstack/actions/workflows/integration_images.yml/badge.svg)](https://github.com/php-opencloud/openstack/actions/workflows/integration_images.yml)
+[![Networking Integration Tests](https://github.com/php-opencloud/openstack/actions/workflows/integration_networking.yml/badge.svg)](https://github.com/php-opencloud/openstack/actions/workflows/integration_networking.yml)
+[![Object Storage Integration Tests](https://github.com/php-opencloud/openstack/actions/workflows/integration_object_storage.yml/badge.svg)](https://github.com/php-opencloud/openstack/actions/workflows/integration_object_storage.yml)
`php-opencloud/openstack` is an SDK which allows PHP developers to easily connect to OpenStack APIs in a simple and
idiomatic way. This binding is specifically designed for OpenStack APIs, but other provider SDKs are available. Multiple
@@ -15,36 +22,23 @@ OpenStack services, and versions of services, are supported.
* [Contributing guide](/CONTRIBUTING.md)
* [Code of Conduct](/CODE_OF_CONDUCT.md)
-
-## We need your help :smiley:
-
-We invest a large amount of work to ensure this SDK works with many OpenStack distributions via running end-to-end
-integration tests with a real cluster.
-
-If you or your organization are in a position that can help us access popular distributions as listed below, do reach
-out by open an issue in github.
-
-| Distribution | |
-|------------------------------------|-------------------------|
-|OpenStack RDO MicroStack Openstack | Sponsored by [![Ai.net](https://i.imgur.com/wsFRFuX.png)](https://www.ai.net/) |
-|Red Hat OpenStack | Need sponsor! |
-|OVH OpenStack | Need sponsor! |
-|SUSE OpenStack | Need sponsor! |
-|RackSpace OpenStack | Need sponsor! |
-
## Join the community
-- Meet us on Slack: https://phpopencloud.slack.com ([Get your invitation](https://launchpass.com/phpopencloud))
- Report an issue: https://github.com/php-opencloud/openstack/issues
-## Version Guidance
+## Versioning
+
+Openstack SDK follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+Updating between minor versions will not require changes to PHP code or configuration
+and cause no breaking behavioural changes for consumers.
-| Version | Status | PHP Version | Support until |
-| --------- | --------------------------- | ---------------- | ----------------------- |
-| `^3.2` | Latest | `>=7.2.5, >=8.0` | Current |
-| `^3.1` | Latest | `>=7.2.5` | Current |
-| `^3.0` | Bug fixed only | `>=7.0` | Oct 2020 |
-| `^2.0` | End of life | `>=7.0,<7.2` | March 2018 |
+| Version | Status | PHP Version | Support until |
+| --------- |-------------| ---------------- | ----------------------- |
+| `^3.2` | Latest | `>=7.2.5, >=8.0` | Current |
+| `^3.1` | Latest | `>=7.2.5` | Current |
+| `^3.0` | End of life | `>=7.0` | Oct 2020 |
+| `^2.0` | End of life | `>=7.0,<7.2` | March 2018 |
## Upgrade from 2.x to 3.x
@@ -57,7 +51,7 @@ This change was introduced in [#184](https://github.com/php-opencloud/openstack/
## Requirements
-* PHP 7.0
+* PHP >= 7.2.5
* `ext-curl`
## How to install
@@ -71,6 +65,5 @@ composer require php-opencloud/openstack
Engaging the community and lowering barriers for contributors is something we care a lot about. For this reason, we've
taken the time to write a [contributing guide](CONTRIBUTING.md) for folks interested in getting involved in our project.
If you're not sure how you can get involved, feel free to
-[submit an issue](https://github.com/php-opencloud/openstack/issues/new) or
-[contact us](https://developer.rackspace.com/support/). You don't need to be a PHP expert - all members of the
+[submit an issue](https://github.com/php-opencloud/openstack/issues/new). You don't need to be a PHP expert - all members of the
community are welcome!
diff --git a/doc/.gitignore b/doc/.gitignore
index 33ce14771..363a33352 100644
--- a/doc/.gitignore
+++ b/doc/.gitignore
@@ -1,2 +1,3 @@
+.idea/
_build/
api-docs/build
diff --git a/doc/_exts/samples.py b/doc/_exts/samples.py
index 5daa1f9a3..bb11d3ebf 100644
--- a/doc/_exts/samples.py
+++ b/doc/_exts/samples.py
@@ -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):
@@ -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])
@@ -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('Show auth code')
-
-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'}
diff --git a/doc/_templates/sphinx_rtd_theme/__init__.py b/doc/_templates/sphinx_rtd_theme/__init__.py
deleted file mode 100644
index 95ddc52ae..000000000
--- a/doc/_templates/sphinx_rtd_theme/__init__.py
+++ /dev/null
@@ -1,17 +0,0 @@
-"""Sphinx ReadTheDocs theme.
-
-From https://github.com/ryan-roemer/sphinx-bootstrap-theme.
-
-"""
-import os
-
-VERSION = (0, 1, 8)
-
-__version__ = ".".join(str(v) for v in VERSION)
-__version_full__ = __version__
-
-
-def get_html_theme_path():
- """Return list of HTML theme paths."""
- cur_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
- return cur_dir
diff --git a/doc/_templates/sphinx_rtd_theme/breadcrumbs.html b/doc/_templates/sphinx_rtd_theme/breadcrumbs.html
deleted file mode 100644
index 0028421e1..000000000
--- a/doc/_templates/sphinx_rtd_theme/breadcrumbs.html
+++ /dev/null
@@ -1,23 +0,0 @@
-
-{%- endblock %}
-
-
-
diff --git a/doc/_templates/sphinx_rtd_theme/search.html b/doc/_templates/sphinx_rtd_theme/search.html
deleted file mode 100644
index e3aa9b5c6..000000000
--- a/doc/_templates/sphinx_rtd_theme/search.html
+++ /dev/null
@@ -1,50 +0,0 @@
-{#
- basic/search.html
- ~~~~~~~~~~~~~~~~~
-
- Template for the search page.
-
- :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-#}
-{%- extends "layout.html" %}
-{% set title = _('Search') %}
-{% set script_files = script_files + ['_static/searchtools.js'] %}
-{% block footer %}
-
- {# this is used when loading the search index using $.ajax fails,
- such as on Chrome for documents on localhost #}
-
- {{ super() }}
-{% endblock %}
-{% block body %}
-
-
- {% if search_performed %}
-
{{ _('Search Results') }}
- {% if not search_results %}
-
{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}
- {% endif %}
- {% endif %}
-
- {% if search_results %}
-
- {% for href, caption, context in search_results %}
-
-
- Free document hosting provided by Read the Docs.
-
-
-
-{% endif %}
-
diff --git a/doc/conf.py b/doc/conf.py
index 9394ea7d1..16f6c857b 100755
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -27,14 +27,14 @@
source_suffix = '.rst'
master_doc = 'index'
project = u'php-opencloud'
-copyright = u'2015, Jamie Hannaford'
+copyright = u'2015-2023, PHP OpenCloud & contributors'
version = '1.12'
release = '1.12.1'
exclude_patterns = ['_build']
pygments_style = 'sphinx'
html_theme = 'sphinx_rtd_theme'
-html_theme_path = ["_templates", ]
+# html_theme_path = ["_templates", ]
# Output file base name for HTML help builder.
htmlhelp_basename = 'php-openclouddoc'
diff --git a/doc/index.rst b/doc/index.rst
index 9b76c16db..0feb0b934 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -4,7 +4,7 @@ Welcome to the OpenStack SDK for PHP!
Requirements
------------
-* PHP 7
+* PHP >= 7, < 9
* cURL extension
Installation
@@ -41,13 +41,7 @@ Supported services
Help and support
----------------
-If you have specific problems or bugs with this SDK, please file an issue on our official `Github repo`_. We also
-have a `mailing list`_, so feel free to join to keep up to date with all the latest changes and announcements to the
-library.
-
-For general feedback and support requests, send an email to sdk-support@rackspace.com.
-
-You can also find assistance via IRC on #rackspace at freenode.net.
+If you have specific problems or bugs with this SDK, please file an issue on our official `Github repo`_.
Contributing
------------
@@ -57,5 +51,4 @@ If you'd like to contribute to the project, or require help running the unit/int
.. _Composer installation instructions: `https://getcomposer.org/doc/00-intro.md`
.. _Github repo: `https://github.com/php-opencloud/openstack`
-.. _mailing list: `https://groups.google.com/forum/#!forum/php-opencloud`
.. _contributing guidelines: `https://github.com/php-opencloud/openstack/blob/master/CONTRIBUTING.md`
diff --git a/doc/requirements.txt b/doc/requirements.txt
index 449e06ca5..6c439f25b 100644
--- a/doc/requirements.txt
+++ b/doc/requirements.txt
@@ -1 +1,2 @@
-sphinxcontrib-phpdomain==0.1.4
+sphinxcontrib-phpdomain>=0.11.0
+sphinx-rtd-theme>=0.5.1
\ No newline at end of file
diff --git a/doc/services/block-storage/v2/snapshots.rst b/doc/services/block-storage/v2/snapshots.rst
index db9c9da51..5365d6351 100644
--- a/doc/services/block-storage/v2/snapshots.rst
+++ b/doc/services/block-storage/v2/snapshots.rst
@@ -1,2 +1,26 @@
Snapshots
=========
+
+List volumes
+------------
+
+.. sample:: BlockStorage/v2/snapshots/list.php
+.. refdoc:: OpenStack/BlockStorage/v2/Service.html#method_listSnapshots
+
+Each iteration will return a php:class:`Snapshot` instance .
+
+.. include:: /common/generators.rst
+
+List volumes sorted
+~~~~~~~~~~~~~~~~~~~
+
+Possible values for sort_key are:
+
+* display_name
+
+Possible values for sort_dir are:
+
+* asc
+* desc
+
+.. sample:: BlockStorage/v2/snapshots/list_sorted.php
\ No newline at end of file
diff --git a/doc/services/identity/v3/credentials.rst b/doc/services/identity/v3/credentials.rst
index b0cf1d849..56a1e55ea 100644
--- a/doc/services/identity/v3/credentials.rst
+++ b/doc/services/identity/v3/credentials.rst
@@ -7,7 +7,7 @@ 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
@@ -15,7 +15,7 @@ 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
@@ -23,13 +23,13 @@ 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
@@ -37,5 +37,5 @@ 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
diff --git a/doc/services/identity/v3/domains.rst b/doc/services/identity/v3/domains.rst
index 079937e86..409059d94 100644
--- a/doc/services/identity/v3/domains.rst
+++ b/doc/services/identity/v3/domains.rst
@@ -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
diff --git a/doc/services/identity/v3/endpoints.rst b/doc/services/identity/v3/endpoints.rst
index c4aadb84a..d5d99e6af 100644
--- a/doc/services/identity/v3/endpoints.rst
+++ b/doc/services/identity/v3/endpoints.rst
@@ -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
diff --git a/doc/services/identity/v3/groups.rst b/doc/services/identity/v3/groups.rst
index 7a29b6725..4fc037754 100644
--- a/doc/services/identity/v3/groups.rst
+++ b/doc/services/identity/v3/groups.rst
@@ -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
diff --git a/doc/services/identity/v3/projects.rst b/doc/services/identity/v3/projects.rst
index 55177cf25..1de4f2ab8 100644
--- a/doc/services/identity/v3/projects.rst
+++ b/doc/services/identity/v3/projects.rst
@@ -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
\ No newline at end of file
diff --git a/doc/services/identity/v3/roles.rst b/doc/services/identity/v3/roles.rst
index 5baf9ab1b..143dabee3 100644
--- a/doc/services/identity/v3/roles.rst
+++ b/doc/services/identity/v3/roles.rst
@@ -4,17 +4,17 @@ Roles
Add role
--------
-.. sample:: Identity/v2/roles/add_role.php
+.. sample:: Identity/v3/roles/add_role.php
.. refdoc:: OpenStack/Identity/v3/Models/Project.html#method_createRole
List roles
----------
-.. sample:: Identity/v2/roles/list_roles.php
+.. sample:: Identity/v3/roles/list_roles.php
.. refdoc:: OpenStack/Identity/v3/Models/Project.html#method_listRoles
List role assignments
---------------------
-.. sample:: Identity/v2/roles/list_assignments.php
+.. sample:: Identity/v3/roles/list_assignments.php
.. refdoc:: OpenStack/Identity/v3/Models/Project.html#method_listRoleAssignments
diff --git a/doc/services/identity/v3/services.rst b/doc/services/identity/v3/services.rst
index 4ba154af0..39276162e 100644
--- a/doc/services/identity/v3/services.rst
+++ b/doc/services/identity/v3/services.rst
@@ -4,23 +4,23 @@ Services
Add service
-----------
-.. sample:: Identity/v2/services/add_service.php
+.. sample:: Identity/v3/services/add_service.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_createService
List services
-------------
-.. sample:: Identity/v2/services/list_services.php
+.. sample:: Identity/v3/services/list_services.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_listServices
Show service details
--------------------
-.. sample:: Identity/v2/services/get_service.php
+.. sample:: Identity/v3/services/get_service.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_getService
Delete service
--------------
-.. sample:: Identity/v2/services/delete_service.php
+.. sample:: Identity/v3/services/delete_service.php
.. refdoc:: OpenStack/Identity/v3/Models/Service.html#method_delete
\ No newline at end of file
diff --git a/doc/services/identity/v3/tokens.rst b/doc/services/identity/v3/tokens.rst
index 72e8617e9..aff224d19 100644
--- a/doc/services/identity/v3/tokens.rst
+++ b/doc/services/identity/v3/tokens.rst
@@ -10,38 +10,38 @@ Authenticate (generate) token
Generate token with user ID
~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. sample:: Identity/v2/tokens/generate_token_with_user_id.php
+.. sample:: Identity/v3/tokens/generate_token_with_user_id.php
Generate token with username
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. sample:: Identity/v2/tokens/generate_token_with_username.php
+.. sample:: Identity/v3/tokens/generate_token_with_username.php
Generate token from ID
~~~~~~~~~~~~~~~~~~~~~~
-.. sample:: Identity/v2/tokens/generate_token_from_id.php
+.. sample:: Identity/v3/tokens/generate_token_from_id.php
Generate token scoped to project ID
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. sample:: Identity/v2/tokens/generate_token_scoped_to_project_id.php
+.. sample:: Identity/v3/tokens/generate_token_scoped_to_project_id.php
Generate token scoped to project name
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. sample:: Identity/v2/tokens/generate_token_scoped_to_project_name.php
+.. sample:: Identity/v3/tokens/generate_token_scoped_to_project_name.php
Validate token
--------------
-.. sample:: Identity/v2/tokens/validate_token.php
+.. sample:: Identity/v3/tokens/validate_token.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_validateToken
Revoke token
------------
-.. sample:: Identity/v2/tokens/revoke_token.php
+.. sample:: Identity/v3/tokens/revoke_token.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_revokeToken
Cache authentication token
@@ -66,7 +66,7 @@ expire.
Generate token and persist to file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. sample:: Identity/v2/tokens/export_authentication_token.php
+.. sample:: Identity/v3/tokens/export_authentication_token.php
For scalability, it is recommended that cached tokens are stored in persistent storage such as memcache or redis instead
@@ -75,4 +75,4 @@ of a local file.
Initialize Open Stack using cached authentication token
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. sample:: Identity/v2/tokens/use_cached_authentication_token.php
+.. sample:: Identity/v3/tokens/use_cached_authentication_token.php
diff --git a/doc/services/identity/v3/users.rst b/doc/services/identity/v3/users.rst
index db27edbd7..3453c3dc9 100644
--- a/doc/services/identity/v3/users.rst
+++ b/doc/services/identity/v3/users.rst
@@ -4,41 +4,41 @@ Users
Add user
--------
-.. sample:: Identity/v2/users/add_user.php
+.. sample:: Identity/v3/users/add_user.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_createUser
List users
----------
-.. sample:: Identity/v2/users/list_users.php
+.. sample:: Identity/v3/users/list_users.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_listUsers
Show user details
-----------------
-.. sample:: Identity/v2/users/get_user.php
+.. sample:: Identity/v3/users/get_user.php
.. refdoc:: OpenStack/Identity/v3/Service.html#method_getUser
Update user
-----------
-.. sample:: Identity/v2/users/update_user.php
+.. sample:: Identity/v3/users/update_user.php
.. refdoc:: OpenStack/Identity/v3/Models/User.html#method_update
Delete user
-----------
-.. sample:: Identity/v2/users/delete_user.php
+.. sample:: Identity/v3/users/delete_user.php
.. refdoc:: OpenStack/Identity/v3/Models/User.html#method_delete
List groups for user
--------------------
-.. sample:: Identity/v2/users/list_groups.php
+.. sample:: Identity/v3/users/list_groups.php
.. refdoc:: OpenStack/Identity/v3/Models/User.html#method_listGroups
List projects for user
----------------------
-.. sample:: Identity/v2/users/list_projects.php
+.. sample:: Identity/v3/users/list_projects.php
.. refdoc:: OpenStack/Identity/v3/Models/User.html#method_listProjects
diff --git a/doc/services/images/v2/images.rst b/doc/services/images/v2/images.rst
index eacc94f55..d01af0195 100644
--- a/doc/services/images/v2/images.rst
+++ b/doc/services/images/v2/images.rst
@@ -17,6 +17,20 @@ List images
.. include:: /common/generators.rst
+List images sorted
+-----------
+
+Possible values for sort_key are:
+
+* name
+
+Possible values for sort_dir are:
+
+* asc
+* desc
+
+.. sample:: Images/v2/images/list_sorted.php
+
Show image details
------------------
diff --git a/doc/services/object-store/v1/account.rst b/doc/services/object-store/v1/account.rst
index 972e9f20c..12a4a31ed 100644
--- a/doc/services/object-store/v1/account.rst
+++ b/doc/services/object-store/v1/account.rst
@@ -6,13 +6,13 @@ Show account details
To work with an Object Store account, you must first retrieve an account object like so:
-.. sample:: ObjectStore/v2/account/get.php
+.. sample:: ObjectStore/v1/account/get.php
.. refdoc:: OpenStack/ObjectStore/v1/Service.html#method_getAccount
Get account metadata
--------------------
-.. sample:: ObjectStore/v2/account/get_metadata.php
+.. sample:: ObjectStore/v1/account/get_metadata.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/Account.html#method_getMetadata
Replace all metadata with new values
@@ -43,7 +43,7 @@ the metadata of the account will now be:
To merge metadata, you must run:
-.. sample:: ObjectStore/v2/account/reset_metadata.php
+.. sample:: ObjectStore/v1/account/reset_metadata.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/Account.html#method_resetMetadata
Merge new metadata values with existing
@@ -75,5 +75,5 @@ the metadata of the account will now be:
To reset metadata, you must run:
-.. sample:: ObjectStore/v2/account/merge_metadata.php
+.. sample:: ObjectStore/v1/account/merge_metadata.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/Account.html#method_mergeMetadata
\ No newline at end of file
diff --git a/doc/services/object-store/v1/containers.rst b/doc/services/object-store/v1/containers.rst
index fdf742f34..18b2d6567 100644
--- a/doc/services/object-store/v1/containers.rst
+++ b/doc/services/object-store/v1/containers.rst
@@ -4,7 +4,7 @@ Containers
Show details for a container
----------------------------
-.. sample:: ObjectStore/v2/containers/get.php
+.. sample:: ObjectStore/v1/containers/get.php
.. refdoc:: OpenStack/ObjectStore/v1/Service.html#method_getContainer
At this point, the object returned is *empty* because we did not execute a HTTP request to receive the state of the
@@ -25,7 +25,7 @@ and all of the local properties will match those of the remote resource.
List containers
---------------
-.. sample:: ObjectStore/v2/containers/list.php
+.. sample:: ObjectStore/v1/containers/list.php
.. refdoc:: OpenStack/ObjectStore/v1/Service.html#method_listContainers
When listing containers, you must be aware that not *all* information about a container is returned in a collection.
@@ -46,7 +46,7 @@ container.
Delete container
----------------
-.. sample:: ObjectStore/v2/containers/delete.php
+.. sample:: ObjectStore/v1/containers/delete.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/Container.html#method_delete
The API will only accept DELETE requests on containers when they are empty. If you have a container with any objects
@@ -55,7 +55,7 @@ inside, the operation will fail.
Get metadata
------------
-.. sample:: ObjectStore/v2/containers/get_metadata.php
+.. sample:: ObjectStore/v1/containers/get_metadata.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/Container.html#method_getMetadata
The returned value will be a standard associative array, or hash, containing arbitrary key/value pairs. These will
@@ -65,7 +65,7 @@ correspond to the values set either when the container was created, or when a pr
Replace all metadata with new values
------------------------------------
-.. sample:: ObjectStore/v2/containers/reset_metadata.php
+.. sample:: ObjectStore/v1/containers/reset_metadata.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/Container.html#method_resetMetadata
In order to replace all existing metadata with a set of new values, you can use this operation. Any existing metadata
@@ -95,7 +95,7 @@ the metadata of the account will now be:
Merge new metadata values with existing
---------------------------------------
-.. sample:: ObjectStore/v2/containers/merge_metadata.php
+.. sample:: ObjectStore/v1/containers/merge_metadata.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/Container.html#method_mergeMetadata
In order to merge a set of new metadata values with the existing metadata set, you can use this operation. Any existing
diff --git a/doc/services/object-store/v1/objects.rst b/doc/services/object-store/v1/objects.rst
index a679330e1..7b326b153 100644
--- a/doc/services/object-store/v1/objects.rst
+++ b/doc/services/object-store/v1/objects.rst
@@ -4,7 +4,7 @@ Objects
Show details for an object
--------------------------
-.. sample:: ObjectStore/v2/objects/get.php
+.. sample:: ObjectStore/v1/objects/get.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/Container.html#method_getObject
At this point, the object returned is *empty* because we did not execute a HTTP request to receive the state of the
@@ -26,7 +26,7 @@ of the object's metadata, will not download the object's content. To do this, se
Download an object
------------------
-.. sample:: ObjectStore/v2/objects/download.php
+.. sample:: ObjectStore/v1/objects/download.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/StorageObject.html#method_download
As you will notice, a Stream_ object is returned by this call. For more information about dealing with streams, please
@@ -41,7 +41,7 @@ parameter ``$data`` to ``['stream' => true]`` to get the stream before the end o
List objects
------------
-.. sample:: ObjectStore/v2/objects/list.php
+.. sample:: ObjectStore/v1/objects/list.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/Container.html#method_listObjects
When listing objects, you must be aware that not *all* information about a container is returned in a collection.
@@ -64,13 +64,13 @@ Create an object
When creating an object, you can upload its content according to a string representation:
-.. sample:: ObjectStore/v2/objects/create.php
+.. sample:: ObjectStore/v1/objects/create.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/Container.html#method_createObject
If that is not optimal or convenient, you can use a stream instead. Any instance of ``\Psr\Http\Message\StreamInterface``
is acceptable. For example, to use a normal Guzzle stream:
-.. sample:: ObjectStore/v2/objects/create_from_stream.php
+.. sample:: ObjectStore/v1/objects/create_from_stream.php
Create a large object (over 5GB)
--------------------------------
@@ -84,25 +84,25 @@ uploading, this is what happens under the hood:
To upload a DLO, you need to call:
-.. sample:: ObjectStore/v2/objects/create_large_object.php
+.. sample:: ObjectStore/v1/objects/create_large_object.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/Container.html#method_createLargeObject
Copy object
-----------
-.. sample:: ObjectStore/v2/objects/copy.php
+.. sample:: ObjectStore/v1/objects/copy.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/StorageObject.html#method_copy
Delete object
-------------
-.. sample:: ObjectStore/v2/objects/delete.php
+.. sample:: ObjectStore/v1/objects/delete.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/StorageObject.html#method_delete
Get metadata
------------
-.. sample:: ObjectStore/v2/objects/get_metadata.php
+.. sample:: ObjectStore/v1/objects/get_metadata.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/StorageObject.html#method_getMetadata
The returned value will be a standard associative array, or hash, containing arbitrary key/value pairs. These will
@@ -112,7 +112,7 @@ correspond to the values set either when the object was created, or when a previ
Replace all metadata with new values
------------------------------------
-.. sample:: ObjectStore/v2/objects/reset_metadata.php
+.. sample:: ObjectStore/v1/objects/reset_metadata.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/StorageObject.html#method_resetMetadata
In order to replace all existing metadata with a set of new values, you can use this operation. Any existing metadata
@@ -142,7 +142,7 @@ the metadata of the account will now be:
Merge new metadata values with existing
---------------------------------------
-.. sample:: ObjectStore/v2/objects/merge_metadata.php
+.. sample:: ObjectStore/v1/objects/merge_metadata.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/StorageObject.html#method_mergeMetadata
In order to merge a set of new metadata values with the existing metadata set, you can use this operation. Any existing
diff --git a/samples/BlockStorage/v2/snapshots/list_sorted.php b/samples/BlockStorage/v2/snapshots/list_sorted.php
new file mode 100644
index 000000000..e00c18aa1
--- /dev/null
+++ b/samples/BlockStorage/v2/snapshots/list_sorted.php
@@ -0,0 +1,18 @@
+ '{authUrl}',
+ 'region' => '{region}',
+ 'user' => ['id' => '{userId}', 'password' => '{password}'],
+ 'scope' => ['project' => ['id' => '{projectId}']]
+]);
+
+$service = $openstack->blockStorageV2();
+
+$snapshots = $service->listSnapshots(false, ['sortKey' => '{sortKey}', 'sortDir' => '{sortDir}']);
+
+foreach ($snapshots as $snapshot) {
+ /** @var $snapshot \OpenStack\BlockStorage\v2\Models\Snapshot */
+}
diff --git a/samples/Compute/v2/images/delete_image.php b/samples/Compute/v2/images/delete_image.php
index a84628635..51e08b0fc 100644
--- a/samples/Compute/v2/images/delete_image.php
+++ b/samples/Compute/v2/images/delete_image.php
@@ -15,3 +15,5 @@
$compute = $openstack->computeV2(['region' => '{region}']);
$image = $compute->getImage(['id' => '{imageId}']);
+
+$image->delete();
diff --git a/samples/Images/v2/images/list.php b/samples/Images/v2/images/list.php
index 0173cf32f..42a714c6b 100644
--- a/samples/Images/v2/images/list.php
+++ b/samples/Images/v2/images/list.php
@@ -13,4 +13,5 @@
->listImages();
foreach ($images as $image) {
+ /** @var \OpenStack\Images\v2\Models\Image $image */
}
diff --git a/samples/Images/v2/images/list_sorted.php b/samples/Images/v2/images/list_sorted.php
new file mode 100644
index 000000000..07f85f621
--- /dev/null
+++ b/samples/Images/v2/images/list_sorted.php
@@ -0,0 +1,16 @@
+ '{authUrl}',
+ 'region' => '{region}',
+ 'user' => ['id' => '{userId}', 'password' => '{password}'],
+ 'scope' => ['project' => ['id' => '{projectId}']]
+]);
+
+$images = $openstack->imagesV2()->listImages(['sortKey' => '{sortKey}', 'sortDir' => '{sortDir}']);
+
+foreach ($images as $image) {
+ /** @var \OpenStack\Images\v2\Models\Image $image */
+}
diff --git a/src/BlockStorage/v2/Models/Snapshot.php b/src/BlockStorage/v2/Models/Snapshot.php
index f36dbeba2..fbf266c4c 100644
--- a/src/BlockStorage/v2/Models/Snapshot.php
+++ b/src/BlockStorage/v2/Models/Snapshot.php
@@ -84,6 +84,8 @@ public function retrieve()
}
/**
+ * {@inheritdoc}
+ *
* @param array $userOptions {@see \OpenStack\BlockStorage\v2\Api::postSnapshots}
*/
public function create(array $userOptions): Creatable
diff --git a/src/BlockStorage/v2/Models/Volume.php b/src/BlockStorage/v2/Models/Volume.php
index 55e886b6e..7e377f678 100644
--- a/src/BlockStorage/v2/Models/Volume.php
+++ b/src/BlockStorage/v2/Models/Volume.php
@@ -110,6 +110,8 @@ public function retrieve()
}
/**
+ * {@inheritdoc}
+ *
* @param array $userOptions {@see \OpenStack\BlockStorage\v2\Api::postVolumes}
*/
public function create(array $userOptions): Creatable
diff --git a/src/BlockStorage/v2/Models/VolumeType.php b/src/BlockStorage/v2/Models/VolumeType.php
index c54425e2f..d85ecb937 100644
--- a/src/BlockStorage/v2/Models/VolumeType.php
+++ b/src/BlockStorage/v2/Models/VolumeType.php
@@ -25,6 +25,8 @@ class VolumeType extends OperatorResource implements Listable, Creatable, Update
protected $resourcesKey = 'volume_types';
/**
+ * {@inheritdoc}
+ *
* @param array $userOptions {@see \OpenStack\BlockStorage\v2\Api::postTypes}
*/
public function create(array $userOptions): Creatable
diff --git a/src/BlockStorage/v2/Service.php b/src/BlockStorage/v2/Service.php
index 5df79b550..b731d2c2d 100644
--- a/src/BlockStorage/v2/Service.php
+++ b/src/BlockStorage/v2/Service.php
@@ -31,6 +31,7 @@ public function createVolume(array $userOptions): Volume
*
* @param bool $detail if set to TRUE, more information will be returned
* @param array $userOptions {@see Api::getVolumes}
+ * @return \Generator
*/
public function listVolumes(bool $detail = false, array $userOptions = []): \Generator
{
@@ -58,6 +59,9 @@ public function createVolumeType(array $userOptions): VolumeType
return $this->model(VolumeType::class)->create($userOptions);
}
+ /**
+ * @return \Generator
+ */
public function listVolumeTypes(): \Generator
{
return $this->model(VolumeType::class)->enumerate($this->api->getTypes(), []);
@@ -79,6 +83,9 @@ public function createSnapshot(array $userOptions): Snapshot
return $this->model(Snapshot::class)->create($userOptions);
}
+ /**
+ * @return \Generator
+ */
public function listSnapshots(bool $detail = false, array $userOptions = []): \Generator
{
$def = (true === $detail) ? $this->api->getSnapshotsDetail() : $this->api->getSnapshots();
diff --git a/src/Common/Api/AbstractParams.php b/src/Common/Api/AbstractParams.php
index 02546062c..7b7b2c775 100644
--- a/src/Common/Api/AbstractParams.php
+++ b/src/Common/Api/AbstractParams.php
@@ -85,6 +85,7 @@ public function sortDir(): array
return [
'type' => self::STRING_TYPE,
'location' => self::QUERY,
+ 'sentAs' => 'sort_dir',
'description' => 'Sorts by one or more sets of attribute and sort direction combinations.',
'enum' => ['asc', 'desc'],
];
@@ -95,6 +96,7 @@ public function sortKey(): array
return [
'type' => self::STRING_TYPE,
'location' => self::QUERY,
+ 'sentAs' => 'sort_key',
'description' => 'Sorts by one or more sets of attribute and sort direction combinations.',
];
}
diff --git a/src/Common/Resource/AbstractResource.php b/src/Common/Resource/AbstractResource.php
index 2dcf5632f..75f2b1bae 100644
--- a/src/Common/Resource/AbstractResource.php
+++ b/src/Common/Resource/AbstractResource.php
@@ -55,7 +55,7 @@ public function populateFromResponse(ResponseInterface $response)
/**
* Populates the current resource from a data array.
*
- * @return mixed|void
+ * @return self
*/
public function populateFromArray(array $array)
{
diff --git a/src/Common/Resource/Creatable.php b/src/Common/Resource/Creatable.php
index 80ac7570d..d07280b09 100644
--- a/src/Common/Resource/Creatable.php
+++ b/src/Common/Resource/Creatable.php
@@ -12,7 +12,7 @@ interface Creatable
/**
* Create a new resource according to the configuration set in the options.
*
- * @return self
+ * @return static
*/
public function create(array $userOptions): Creatable;
}
diff --git a/src/Common/Resource/Listable.php b/src/Common/Resource/Listable.php
index 9b8744ee7..a19499e3d 100644
--- a/src/Common/Resource/Listable.php
+++ b/src/Common/Resource/Listable.php
@@ -22,7 +22,7 @@ interface Listable
* @param array $userVals The user values
* @param callable $mapFn an optional callback that will be executed on every resource iteration
*
- * @returns void
+ * @returns \Generator
*/
public function enumerate(array $def, array $userVals = [], callable $mapFn = null);
}
diff --git a/src/Common/Resource/OperatorResource.php b/src/Common/Resource/OperatorResource.php
index 35cf31864..11414e28e 100644
--- a/src/Common/Resource/OperatorResource.php
+++ b/src/Common/Resource/OperatorResource.php
@@ -68,7 +68,9 @@ private function getResourcesKey(): string
}
/**
- * {@inheritdoc}
+ * Creates a generator for enumerating over a collection of resources returned by the request.
+ *
+ * @returns \Generator
*/
public function enumerate(array $def, array $userVals = [], callable $mapFn = null): \Generator
{
@@ -101,6 +103,11 @@ public function enumerate(array $def, array $userVals = [], callable $mapFn = nu
return $iterator();
}
+ /**
+ * Extracts multiple instances of the current resource from a response.
+ *
+ * @return array
+ */
public function extractMultipleInstances(ResponseInterface $response, string $key = null): array
{
$key = $key ?: $this->getResourcesKey();
diff --git a/src/Common/Resource/ResourceInterface.php b/src/Common/Resource/ResourceInterface.php
index ae3249dd0..346ec2674 100644
--- a/src/Common/Resource/ResourceInterface.php
+++ b/src/Common/Resource/ResourceInterface.php
@@ -15,21 +15,23 @@ interface ResourceInterface
* All models which represent an API resource should be able to be populated
* from a {@see ResponseInterface} object.
*
+ * @param \Psr\Http\Message\ResponseInterface $response
* @return self
*/
public function populateFromResponse(ResponseInterface $response);
/**
- * @return mixed
+ * @return self
*/
public function populateFromArray(array $data);
/**
- * @param string $name the name of the model class
+ * @template T of \OpenStack\Common\Resource\ResourceInterface
+ * @param class-string $class the name of the model class
* @param mixed $data either a {@see ResponseInterface} or data array that will populate the newly
* created model class
*
- * @return \OpenStack\Common\Resource\ResourceInterface
+ * @return T
*/
public function model(string $class, $data = null): ResourceInterface;
}
diff --git a/src/Compute/v2/Models/Keypair.php b/src/Compute/v2/Models/Keypair.php
index 065052e2c..61c178659 100644
--- a/src/Compute/v2/Models/Keypair.php
+++ b/src/Compute/v2/Models/Keypair.php
@@ -75,6 +75,9 @@ public function retrieve()
$this->populateFromResponse($response);
}
+ /**
+ * {@inheritdoc}
+ */
public function create(array $userOptions): Creatable
{
$response = $this->execute($this->api->postKeypair(), $userOptions);
diff --git a/src/Compute/v2/Models/Server.php b/src/Compute/v2/Models/Server.php
index e2390fd43..85ab5c353 100644
--- a/src/Compute/v2/Models/Server.php
+++ b/src/Compute/v2/Models/Server.php
@@ -394,6 +394,8 @@ public function listAddresses(array $options = []): array
/**
* Returns Generator for InterfaceAttachment.
+ *
+ * @return \Generator
*/
public function listInterfaceAttachments(array $options = []): \Generator
{
@@ -541,6 +543,8 @@ public function parseMetadata(ResponseInterface $response): array
/**
* Returns Generator for SecurityGroups.
+ *
+ * @return \Generator
*/
public function listSecurityGroups(): \Generator
{
@@ -549,6 +553,8 @@ public function listSecurityGroups(): \Generator
/**
* Returns Generator for VolumeAttachment.
+ *
+ * @return \Generator
*/
public function listVolumeAttachments(): \Generator
{
diff --git a/src/Compute/v2/Service.php b/src/Compute/v2/Service.php
index a67e33eb3..3d39c3de1 100644
--- a/src/Compute/v2/Service.php
+++ b/src/Compute/v2/Service.php
@@ -41,6 +41,7 @@ public function createServer(array $options): Server
* the ID, name and links attributes are returned, saving bandwidth.
* @param array $options {@see \OpenStack\Compute\v2\Api::getServers}
* @param callable $mapFn a callable function that will be invoked on every iteration of the list
+ * @return \Generator
*/
public function listServers(bool $detailed = false, array $options = [], callable $mapFn = null): \Generator
{
@@ -73,6 +74,7 @@ public function getServer(array $options = []): Server
* @param array $options {@see \OpenStack\Compute\v2\Api::getFlavors}
* @param callable $mapFn a callable function that will be invoked on every iteration of the list
* @param bool $detailed set to true to fetch flavors' details
+ * @return \Generator
*/
public function listFlavors(array $options = [], callable $mapFn = null, bool $detailed = false): \Generator
{
@@ -112,6 +114,7 @@ public function createFlavor(array $options = []): Flavor
*
* @param array $options {@see \OpenStack\Compute\v2\Api::getImages}
* @param callable $mapFn a callable function that will be invoked on every iteration of the list
+ * @return \Generator
*/
public function listImages(array $options = [], callable $mapFn = null): \Generator
{
@@ -139,6 +142,7 @@ public function getImage(array $options = []): Image
*
* @param array $options {@see \OpenStack\Compute\v2\Api::getKeyPairs}
* @param callable $mapFn a callable function that will be invoked on every iteration of the list
+ * @return \Generator
*/
public function listKeypairs(array $options = [], callable $mapFn = null): \Generator
{
@@ -193,6 +197,7 @@ public function getHypervisorStatistics(): HypervisorStatistic
* the ID, name and links attributes are returned, saving bandwidth.
* @param array $options {@see \OpenStack\Compute\v2\Api::getHypervisors}
* @param callable $mapFn a callable function that will be invoked on every iteration of the list
+ * @return \Generator
*/
public function listHypervisors(bool $detailed = false, array $options = [], callable $mapFn = null): \Generator
{
@@ -216,6 +221,7 @@ public function getHypervisor(array $options = []): Hypervisor
*
* @param array $options {@see \OpenStack\Compute\v2\Api::getHosts}
* @param callable $mapFn a callable function that will be invoked on every iteration of the list
+ * @return \Generator
*/
public function listHosts(array $options = [], callable $mapFn = null): \Generator
{
@@ -245,6 +251,7 @@ public function getHost(array $options = []): Host
*
* @param array $options {@see \OpenStack\Compute\v2\Api::getAvailabilityZones}
* @param callable $mapFn a callable function that will be invoked on every iteration of the list
+ * @return \Generator
*/
public function listAvailabilityZones(array $options = [], callable $mapFn = null): \Generator
{
diff --git a/src/Identity/v3/Models/Domain.php b/src/Identity/v3/Models/Domain.php
index 9118d38f9..83263ef99 100644
--- a/src/Identity/v3/Models/Domain.php
+++ b/src/Identity/v3/Models/Domain.php
@@ -75,6 +75,7 @@ public function delete()
/**
* @param array $options {@see \OpenStack\Identity\v3\Api::getUserRoles}
+ * @return \Generator
*/
public function listUserRoles(array $options = []): \Generator
{
@@ -115,6 +116,7 @@ public function revokeUserRole(array $options = [])
/**
* @param array $options {@see \OpenStack\Identity\v3\Api::getGroupRoles}
+ * @return \Generator
*/
public function listGroupRoles(array $options = []): \Generator
{
diff --git a/src/Identity/v3/Models/Group.php b/src/Identity/v3/Models/Group.php
index 8bfee36b3..2854a92aa 100644
--- a/src/Identity/v3/Models/Group.php
+++ b/src/Identity/v3/Models/Group.php
@@ -77,6 +77,7 @@ public function delete()
/**
* @param array $options {@see \OpenStack\Identity\v3\Api::getGroupUsers}
+ * @return \Generator
*/
public function listUsers(array $options = []): \Generator
{
diff --git a/src/Identity/v3/Models/Project.php b/src/Identity/v3/Models/Project.php
index 62041c69e..68beb3ce8 100644
--- a/src/Identity/v3/Models/Project.php
+++ b/src/Identity/v3/Models/Project.php
@@ -87,6 +87,7 @@ public function delete()
/**
* @param array $options {@see \OpenStack\Identity\v3\Api::getProjectUserRoles}
+ * @return \Generator
*/
public function listUserRoles(array $options = []): \Generator
{
@@ -127,6 +128,7 @@ public function revokeUserRole(array $options)
/**
* @param array $options {@see \OpenStack\Identity\v3\Api::getProjectGroupRoles}
+ * @return \Generator
*/
public function listGroupRoles(array $options = []): \Generator
{
diff --git a/src/Identity/v3/Models/User.php b/src/Identity/v3/Models/User.php
index a4e87a0f0..c094a6513 100644
--- a/src/Identity/v3/Models/User.php
+++ b/src/Identity/v3/Models/User.php
@@ -86,6 +86,9 @@ public function delete()
$this->execute($this->api->deleteUser(), ['id' => $this->id]);
}
+ /**
+ * @return \Generator
+ */
public function listGroups(): \Generator
{
$options['id'] = $this->id;
@@ -93,6 +96,9 @@ public function listGroups(): \Generator
return $this->model(Group::class)->enumerate($this->api->getUserGroups(), $options);
}
+ /**
+ * @return \Generator
+ */
public function listProjects(): \Generator
{
return $this->model(Project::class)->enumerate($this->api->getUserProjects(), ['id' => $this->id]);
diff --git a/src/Identity/v3/Service.php b/src/Identity/v3/Service.php
index cbca4395f..8d77b1284 100644
--- a/src/Identity/v3/Service.php
+++ b/src/Identity/v3/Service.php
@@ -128,6 +128,7 @@ public function createService(array $options): Models\Service
* will need to use retrieve() to pull in the full state of the remote resource from the API.
*
* @param array $options {@see \OpenStack\Identity\v3\Api::getServices}
+ * @return \Generator
*/
public function listServices(array $options = []): \Generator
{
@@ -172,6 +173,7 @@ public function getEndpoint(string $id): Models\Endpoint
* will need to use retrieve() to pull in the full state of the remote resource from the API.
*
* @param array $options {@see \OpenStack\Identity\v3\Api::getEndpoints}
+ * @return \Generator
*/
public function listEndpoints(array $options = []): \Generator
{
@@ -194,6 +196,7 @@ public function createDomain(array $options): Models\Domain
* will need to use retrieve() to pull in the full state of the remote resource from the API.
*
* @param array $options {@see \OpenStack\Identity\v3\Api::getDomains}
+ * @return \Generator
*/
public function listDomains(array $options = []): \Generator
{
@@ -227,6 +230,7 @@ public function createProject(array $options): Models\Project
* will need to use retrieve() to pull in the full state of the remote resource from the API.
*
* @param array $options {@see \OpenStack\Identity\v3\Api::getProjects}
+ * @return \Generator
*/
public function listProjects(array $options = []): \Generator
{
@@ -260,6 +264,7 @@ public function createUser(array $options): Models\User
* will need to use retrieve() to pull in the full state of the remote resource from the API.
*
* @param array $options {@see \OpenStack\Identity\v3\Api::getUsers}
+ * @return \Generator
*/
public function listUsers(array $options = []): \Generator
{
@@ -293,6 +298,7 @@ public function createGroup(array $options): Models\Group
* will need to use retrieve() to pull in the full state of the remote resource from the API.
*
* @param array $options {@see \OpenStack\Identity\v3\Api::getGroups}
+ * @return \Generator
*/
public function listGroups(array $options = []): \Generator
{
@@ -324,6 +330,8 @@ public function createCredential(array $options): Models\Credential
* Returns a generator which will yield a collection of credential objects. The elements which generators yield can
* be accessed using a foreach loop. Often the API will not return the full state of the resource in collections;
* you will need to use retrieve() to pull in the full state of the remote resource from the API.
+ *
+ * @return \Generator
*/
public function listCredentials(): \Generator
{
@@ -367,6 +375,7 @@ public function createRole(array $options): Models\Role
* will need to use retrieve() to pull in the full state of the remote resource from the API.
*
* @param array $options {@see \OpenStack\Identity\v3\Api::getRoles}
+ * @return \Generator
*/
public function listRoles(array $options = []): \Generator
{
@@ -379,6 +388,7 @@ public function listRoles(array $options = []): \Generator
* collections; you will need to use retrieve() to pull in the full state of the remote resource from the API.
*
* @param array $options {@see \OpenStack\Identity\v3\Api::getRoleAssignments}
+ * @return \Generator
*/
public function listRoleAssignments(array $options = []): \Generator
{
@@ -401,6 +411,7 @@ public function createPolicy(array $options): Models\Policy
* will need to use retrieve() to pull in the full state of the remote resource from the API.
*
* @param array $options {@see \OpenStack\Identity\v3\Api::getPolicies}
+ * @return \Generator
*/
public function listPolicies(array $options = []): \Generator
{
diff --git a/src/Images/v2/Models/Image.php b/src/Images/v2/Models/Image.php
index 8c0e88628..6cf172cfd 100644
--- a/src/Images/v2/Models/Image.php
+++ b/src/Images/v2/Models/Image.php
@@ -115,6 +115,9 @@ public function populateFromArray(array $data): self
return $this;
}
+ /**
+ * {@inheritdoc}
+ */
public function create(array $data): Creatable
{
$response = $this->execute($this->api->postImages(), $data);
@@ -213,6 +216,9 @@ public function addMember($memberId): Member
return $this->model(Member::class, ['imageId' => $this->id, 'id' => $memberId])->create([]);
}
+ /**
+ * @return \Generator
+ */
public function listMembers(): \Generator
{
return $this->model(Member::class)->enumerate($this->api->getImageMembers(), ['imageId' => $this->id]);
diff --git a/src/Images/v2/Models/Member.php b/src/Images/v2/Models/Member.php
index c3cb00b7b..4b6c6dbb7 100644
--- a/src/Images/v2/Models/Member.php
+++ b/src/Images/v2/Models/Member.php
@@ -54,6 +54,9 @@ protected function getAliases(): array
];
}
+ /**
+ * {@inheritdoc}
+ */
public function create(array $userOptions): Creatable
{
$response = $this->executeWithState($this->api->postImageMembers());
diff --git a/src/Images/v2/Service.php b/src/Images/v2/Service.php
index 9c977cf25..bcb8f4349 100644
--- a/src/Images/v2/Service.php
+++ b/src/Images/v2/Service.php
@@ -17,6 +17,9 @@ public function createImage(array $data): Image
return $this->model(Image::class)->create($data);
}
+ /**
+ * @return \Generator
+ */
public function listImages(array $data = []): \Generator
{
return $this->model(Image::class)->enumerate($this->api->getImages(), $data);
diff --git a/src/Metric/v1/Gnocchi/Models/Resource.php b/src/Metric/v1/Gnocchi/Models/Resource.php
index 33c39d89a..c6041dcd3 100644
--- a/src/Metric/v1/Gnocchi/Models/Resource.php
+++ b/src/Metric/v1/Gnocchi/Models/Resource.php
@@ -138,6 +138,7 @@ public function getMetricMeasures(array $options = []): array
/**
* @param array $options {@see \OpenStack\Metric\v1\Gnocchi\Api::getResourceMetrics}
+ * @return \Generator
*/
public function listResourceMetrics(array $options = []): \Generator
{
diff --git a/src/Metric/v1/Gnocchi/Service.php b/src/Metric/v1/Gnocchi/Service.php
index c44dfafb5..6e418b146 100644
--- a/src/Metric/v1/Gnocchi/Service.php
+++ b/src/Metric/v1/Gnocchi/Service.php
@@ -18,6 +18,7 @@ class Service extends AbstractService
{
/**
* Retrieves a collection of \OpenStack\Metric\v1\Gnocchi\Models\ResourceType type in a generator format.
+ * @return \Generator
*/
public function listResourceTypes(): \Generator
{
@@ -28,6 +29,7 @@ public function listResourceTypes(): \Generator
* Retrieves a collection of \OpenStack\Metric\v1\Gnocchi\Models\Resource type in a generator format.
*
* @param array $options {@see \OpenStack\Metric\v1\Gnocchi\Api::getResources}
+ * @return \Generator
*/
public function listResources(array $options = []): \Generator
{
@@ -55,6 +57,7 @@ public function getResource(array $options = []): Resource
* Retrieves a collection of \OpenStack\Metric\v1\Gnocchi\Models\Resource type in a generator format.
*
* @param array $options {@see \OpenStack\Metric\v1\Gnocchi\Api::searchResources}
+ * @return \Generator
*/
public function searchResources(array $options = []): \Generator
{
@@ -94,6 +97,7 @@ public function getMetric(string $id): Metric
* Retrieves a collection of Metric type in a generator format.
*
* @param array $options {@see \OpenStack\Metric\v1\Gnocchi\Api::getMetrics}
+ * @return \Generator
*/
public function listMetrics(array $options = []): \Generator
{
diff --git a/src/Networking/v2/Extensions/Layer3/Models/FloatingIp.php b/src/Networking/v2/Extensions/Layer3/Models/FloatingIp.php
index 07dc0ddba..048b942b2 100644
--- a/src/Networking/v2/Extensions/Layer3/Models/FloatingIp.php
+++ b/src/Networking/v2/Extensions/Layer3/Models/FloatingIp.php
@@ -51,6 +51,9 @@ class FloatingIp extends OperatorResource implements Listable, Creatable, Retrie
protected $resourceKey = 'floatingip';
protected $resourcesKey = 'floatingips';
+ /**
+ * {@inheritdoc}
+ */
public function create(array $userOptions): Creatable
{
$response = $this->execute($this->api->postFloatingIps(), $userOptions);
diff --git a/src/Networking/v2/Extensions/Layer3/Models/Router.php b/src/Networking/v2/Extensions/Layer3/Models/Router.php
index f3e701756..63e89bbe4 100644
--- a/src/Networking/v2/Extensions/Layer3/Models/Router.php
+++ b/src/Networking/v2/Extensions/Layer3/Models/Router.php
@@ -57,6 +57,9 @@ protected function getAliases(): array
];
}
+ /**
+ * {@inheritdoc}
+ */
public function create(array $userOptions): Creatable
{
$response = $this->execute($this->api->postRouters(), $userOptions);
diff --git a/src/Networking/v2/Extensions/Layer3/Service.php b/src/Networking/v2/Extensions/Layer3/Service.php
index 9f9b04de1..c033c4b7f 100644
--- a/src/Networking/v2/Extensions/Layer3/Service.php
+++ b/src/Networking/v2/Extensions/Layer3/Service.php
@@ -31,6 +31,9 @@ public function getFloatingIp($id): FloatingIp
return $this->floatingIp(['id' => $id]);
}
+ /**
+ * @return \Generator
+ */
public function listFloatingIps(array $options = []): \Generator
{
return $this->floatingIp()->enumerate($this->api->getFloatingIps(), $options);
@@ -46,6 +49,9 @@ public function getRouter($id): Router
return $this->router(['id' => $id]);
}
+ /**
+ * @return \Generator
+ */
public function listRouters(array $options = []): \Generator
{
return $this->router()->enumerate($this->api->getRouters(), $options);
diff --git a/src/Networking/v2/Extensions/SecurityGroups/Service.php b/src/Networking/v2/Extensions/SecurityGroups/Service.php
index cf10b733b..088efd152 100644
--- a/src/Networking/v2/Extensions/SecurityGroups/Service.php
+++ b/src/Networking/v2/Extensions/SecurityGroups/Service.php
@@ -21,6 +21,10 @@ private function securityGroupRule(array $info = []): SecurityGroupRule
return $this->model(SecurityGroupRule::class, $info);
}
+ /**
+ * @param array $options
+ * @return \Generator
+ */
public function listSecurityGroups(array $options = []): \Generator
{
return $this->securityGroup()->enumerate($this->api->getSecurityGroups(), $options);
@@ -36,6 +40,9 @@ public function getSecurityGroup(string $id): SecurityGroup
return $this->securityGroup(['id' => $id]);
}
+ /**
+ * @return \Generator
+ */
public function listSecurityGroupRules(): \Generator
{
return $this->securityGroupRule()->enumerate($this->api->getSecurityRules());
diff --git a/src/Networking/v2/Service.php b/src/Networking/v2/Service.php
index 2e1f7169d..e99c6176a 100644
--- a/src/Networking/v2/Service.php
+++ b/src/Networking/v2/Service.php
@@ -57,6 +57,7 @@ public function getNetwork(string $id): Network
* List networks.
*
* @param array $options {@see \OpenStack\Networking\v2\Api::getNetworks}
+ * @return \Generator
*/
public function listNetworks(array $options = []): \Generator
{
@@ -99,6 +100,7 @@ public function getSubnet(string $id): Subnet
* List subnets.
*
* @param array $options {@see \OpenStack\Networking\v2\Api::getSubnets}
+ * @return \Generator
*/
public function listSubnets(array $options = []): \Generator
{
@@ -141,6 +143,7 @@ public function getPort(string $id): Port
* List ports.
*
* @param array $options {@see \OpenStack\Networking\v2\Api::getPorts}
+ * @return \Generator
*/
public function listPorts(array $options = []): \Generator
{
@@ -149,6 +152,8 @@ public function listPorts(array $options = []): \Generator
/**
* Lists quotas for projects with non-default quota values.
+ *
+ * @return \Generator
*/
public function listQuotas(): \Generator
{
@@ -180,6 +185,8 @@ public function getDefaultQuota(string $tenantId): Quota
/**
* Lists loadbalancers for projects.
+ *
+ * @return \Generator
*/
public function listLoadBalancers(): \Generator
{
@@ -206,6 +213,8 @@ public function createLoadBalancer(array $options): LoadBalancer
/**
* Lists loadbalancer listeners.
+ *
+ * @return \Generator
*/
public function listLoadBalancerListeners(): \Generator
{
@@ -232,6 +241,8 @@ public function createLoadBalancerListener(array $options): LoadBalancerListener
/**
* Lists loadbalancer pools.
+ *
+ * @return \Generator
*/
public function listLoadBalancerPools(): \Generator
{
@@ -258,6 +269,8 @@ public function createLoadBalancerPool(array $options): LoadBalancerPool
/**
* Lists loadbalancer members.
+ *
+ * @return \Generator
*/
public function listLoadBalancerMembers(string $poolId): \Generator
{
@@ -284,6 +297,8 @@ public function createLoadBalancerMember(array $options): LoadBalancerMember
/**
* Lists loadbalancer healthmonitors.
+ *
+ * @return \Generator
*/
public function listLoadBalancerHealthMonitors(): \Generator
{
diff --git a/src/ObjectStore/v1/Models/Container.php b/src/ObjectStore/v1/Models/Container.php
index 4736d2a1e..6501bfd90 100644
--- a/src/ObjectStore/v1/Models/Container.php
+++ b/src/ObjectStore/v1/Models/Container.php
@@ -57,6 +57,7 @@ public function populateFromResponse(ResponseInterface $response): self
*
* @param array $options {@see \OpenStack\ObjectStore\v1\Api::getContainer}
* @param callable|null $mapFn allows a function to be mapped over each element
+ * @return \Generator
*/
public function listObjects(array $options = [], callable $mapFn = null): \Generator
{
@@ -82,9 +83,9 @@ public function retrieve()
}
/**
- * @param array $data {@see \OpenStack\ObjectStore\v1\Api::putContainer}
+ * {@inheritdoc}
*
- * @return $this
+ * @param array $data {@see \OpenStack\ObjectStore\v1\Api::putContainer}
*/
public function create(array $data): Creatable
{
diff --git a/src/ObjectStore/v1/Models/StorageObject.php b/src/ObjectStore/v1/Models/StorageObject.php
index be4f2c8c1..d639a0cd9 100644
--- a/src/ObjectStore/v1/Models/StorageObject.php
+++ b/src/ObjectStore/v1/Models/StorageObject.php
@@ -97,9 +97,9 @@ public function getPublicUri(): Uri
}
/**
- * @param array $data {@see \OpenStack\ObjectStore\v1\Api::putObject}
+ * {@inheritdoc}
*
- * @return $this
+ * @param array $data {@see \OpenStack\ObjectStore\v1\Api::putObject}
*/
public function create(array $data): Creatable
{
diff --git a/src/ObjectStore/v1/Service.php b/src/ObjectStore/v1/Service.php
index 0f41da3bd..ce029479f 100644
--- a/src/ObjectStore/v1/Service.php
+++ b/src/ObjectStore/v1/Service.php
@@ -27,6 +27,7 @@ public function getAccount(): Account
*
* @param array $options {@see \OpenStack\ObjectStore\v1\Api::getAccount}
* @param callable|null $mapFn allows a function to be mapped over each element in the collection
+ * @return \Generator
*/
public function listContainers(array $options = [], callable $mapFn = null): \Generator
{
diff --git a/tests/integration/BlockStorage/v2/CoreTest.php b/tests/integration/BlockStorage/v2/CoreTest.php
index 9063e80f3..352e07441 100644
--- a/tests/integration/BlockStorage/v2/CoreTest.php
+++ b/tests/integration/BlockStorage/v2/CoreTest.php
@@ -1,6 +1,6 @@
volumeTypes();
$this->logger->info('-> Snapshots');
$this->snapshots();
+ $this->logger->info('-> Snapshot list');
+ $this->snapshotList();
$this->outputTimeTaken();
}
public function volumes()
{
- $this->logStep('-> Volumes tests');
+ $this->logStep('Creating volume type');
$volumeType = $this->getService()->createVolumeType(['name' => $this->randomStr()]);
$replacements = [
'{description}' => $this->randomStr(),
- "'{size}'" => 1,
- '{name}' => $this->randomStr(),
- '{volumeType}' => $volumeType->id,
- '{key1}' => $this->randomStr(),
- '{val1}' => $this->randomStr(),
+ "'{size}'" => 1,
+ '{name}' => $this->randomStr(),
+ '{volumeType}' => $volumeType->id,
+ '{key1}' => $this->randomStr(),
+ '{val1}' => $this->randomStr(),
];
$this->logStep('Creating volume');
@@ -70,7 +72,7 @@ public function volumes()
$replacements += [
'{newName}' => $this->randomStr(),
- '{newDescription}' => $this->randomStr()
+ '{newDescription}' => $this->randomStr(),
];
$this->logStep('Updating volume');
@@ -82,6 +84,7 @@ public function volumes()
/** @var \Generator $volumes */
require_once $this->sampleFile($replacements, 'volumes/list.php');
+ $volume = $this->getService()->getVolume($volumeId);
$volume->waitUntil('available');
$this->logStep('Deleting volume');
@@ -135,8 +138,8 @@ public function snapshots()
$volume->waitUntil('available', 60);
$replacements = [
- '{volumeId}' => $volume->id,
- '{name}' => $this->randomStr(),
+ '{volumeId}' => $volume->id,
+ '{name}' => $this->randomStr(),
'{description}' => $this->randomStr(),
];
@@ -183,6 +186,9 @@ public function snapshots()
$snapshot->waitUntil('available', 60);
+ $this->logStep('Listing snapshots');
+ require_once $this->sampleFile($replacements, 'snapshots/list.php');
+
$this->logStep('Deleting snapshot');
require_once $this->sampleFile($replacements, 'snapshots/delete.php');
$snapshot->waitUntilDeleted();
@@ -190,4 +196,58 @@ public function snapshots()
$this->logStep('Deleting volume');
$volume->delete();
}
+
+ public function snapshotList()
+ {
+ $this->logStep('Creating volume');
+ $volume = $this->getService()->createVolume(['name' => $this->randomStr(), 'size' => 1]);
+ $volume->waitUntil('available', 60);
+
+ $names = ['b' . $this->randomStr(), 'a' . $this->randomStr(), 'd' . $this->randomStr(), 'c' . $this->randomStr()];
+ $createdSnapshots = [];
+ foreach ($names as $name) {
+ $this->logStep('Creating snapshot ' . $name);
+ $snapshot = $this->getService()->createSnapshot([
+ 'volumeId' => $volume->id,
+ 'name' => $name,
+ ]);
+
+ self::assertInstanceOf(Snapshot::class, $snapshot);
+
+ $createdSnapshots[] = $snapshot;
+ $snapshot->waitUntil('available', 60);
+ }
+
+ try {
+ $replacements = [
+ '{sortKey}' => 'display_name',
+ '{sortDir}' => 'asc',
+ ];
+
+ $this->logStep('Listing snapshots');
+ require_once $this->sampleFile($replacements, 'snapshots/list.php');
+
+ $this->logStep('Listing snapshots sorted asc');
+ /** @var Snapshot $snapshot */
+ require_once $this->sampleFile($replacements, 'snapshots/list_sorted.php');
+ self::assertInstanceOf(Snapshot::class, $snapshot);
+ self::assertEquals($names[2], $snapshot->name);
+
+ $this->logStep('Listing snapshots sorted desc');
+ $replacements['{sortDir}'] = 'desc';
+ /** @var Snapshot $snapshot */
+ require_once $this->sampleFile($replacements, 'snapshots/list_sorted.php');
+ self::assertInstanceOf(Snapshot::class, $snapshot);
+ self::assertEquals($names[1], $snapshot->name);
+ } finally {
+ foreach ($createdSnapshots as $snapshot) {
+ $this->logStep('Deleting snapshot ' . $snapshot->name);
+ $snapshot->delete();
+ $snapshot->waitUntilDeleted();
+ }
+
+ $this->logStep('Deleting volume');
+ $volume->delete();
+ }
+ }
}
diff --git a/tests/integration/Images/v2/CoreTest.php b/tests/integration/Images/v2/CoreTest.php
index bc7f7fbf7..ec3ac642b 100644
--- a/tests/integration/Images/v2/CoreTest.php
+++ b/tests/integration/Images/v2/CoreTest.php
@@ -1,20 +1,39 @@
service) {
+ $this->service = Utils::getOpenStack()->imagesV2();
+ }
+
+ return $this->service;
+ }
+
public function runTests()
{
$this->startTimer();
+ $this->logger->info('-> Images');
$this->images();
+
+ $this->logger->info('-> Members');
$this->members();
+ $this->logger->info('-> Image list');
+ $this->imageList();
+
$this->outputTimeTaken();
}
@@ -97,4 +116,50 @@ public function members()
/** @var Image $image */
require_once $this->sampleFile($replacements, 'images/delete.php');
}
+
+ public function imageList()
+ {
+ $this->logStep('Creating image');
+
+ $postfix = $this->randomStr();
+ $names = ['b' . $postfix, 'a' . $postfix, 'd' . $postfix, 'c' . $postfix];
+ $createdImages = [];
+ foreach ($names as $name) {
+ $this->logStep("Creating image $name");
+ $image = $this->getService()->createImage([
+ 'name' => $name,
+ ]);
+
+ self::assertInstanceOf(Image::class, $image);
+ $createdImages[] = $image;
+ }
+
+
+ $this->logStep('Listing images sorted asc');
+
+ $replacements = [
+ '{sortKey}' => 'name',
+ '{sortDir}' => 'asc',
+ ];
+
+ /** @var \OpenStack\Images\v2\Models\Image $image */
+ require_once $this->sampleFile($replacements, 'images/list_sorted.php');
+ self::assertInstanceOf(Image::class, $image);
+ self::assertEquals($names[2], $image->name);
+
+
+ $this->logStep('Listing images sorted desc');
+
+ $replacements['{sortDir}'] = 'desc';
+ /** @var \OpenStack\Images\v2\Models\Image $image */
+ require_once $this->sampleFile($replacements, 'images/list_sorted.php');
+ self::assertInstanceOf(Image::class, $image);
+ self::assertEquals($names[1], $image->name);
+
+ foreach ($createdImages as $image) {
+ $this->logStep("Deleting image $image->name");
+ $image->delete();
+ }
+ }
+
}