Skip to content

Commit

Permalink
Merge branch 'master' into resume-suspend-server
Browse files Browse the repository at this point in the history
  • Loading branch information
haphan committed Oct 11, 2020
2 parents 8f629c9 + 73b1616 commit 8e40593
Show file tree
Hide file tree
Showing 150 changed files with 337 additions and 801 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Expand Up @@ -2,15 +2,17 @@ language: php

sudo: false

dist: bionic

cache:
directories:
- $HOME/.composer/cache

matrix:
include:
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4
- php: nightly
allow_failures:
- php: nightly
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -239,7 +239,7 @@ Additionally, integration tests require image called `cirros` exists.
You interact with integration tests through a runner script:

```bash
php ./tests/integration/run.php
php ./tests/integration/run.php [-s=BlockStorage|Compute|Identity|Images|Networking|ObjectStore] [--debug=1|2]
```

It supports these command-line flags:
Expand Down
31 changes: 25 additions & 6 deletions README.md
Expand Up @@ -7,26 +7,45 @@
`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
OpenStack services, and versions of services, are supported.

## Links

* [Official documentation](https://php-openstack-sdk.readthedocs.io/en/latest/)
* [Reference documentation](http://refdocs.os.php-opencloud.com)
* [Contributing guide](/CONTRIBUTING.md)
* [Code of Conduct](/CODE_OF_CONDUCT.md)

## Getting help

## 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 | :white_check_mark: |
|Red Hat OpenStack | Need sponsor! |
|OVH OpenStack | Need sponsor! |
|SUSE OpenStack | Need sponsor! |
|Canonical 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

| Version | Status | PHP Version | End of life |
| Version | Status | PHP Version | Support until |
| --------- | --------------------------- | ------------- | ----------------------- |
| `^3.0` | Latest | `>=7.0` | March 2020 |
| `^2.0` | Maintained (Bug fixes only) | `>=7.0,<7.2` | March 2018 |
| `^3.1` | Latest | `>=7.2.5` | Oct 2023 |
| `^3.0` | Bug fixed only | `>=7.0` | Oct 2020 |
| `^2.0` | EOL (Bug fixes only) | `>=7.0,<7.2` | March 2018 |


## Upgrade from 2.x to 3.x

Expand Down
5 changes: 3 additions & 2 deletions composer.json
Expand Up @@ -33,8 +33,9 @@
}
},
"require": {
"php": "~7.0",
"guzzlehttp/guzzle": "^6.1",
"php": "^7.2.5",
"guzzlehttp/guzzle": "^7.0",
"guzzlehttp/uri-template": "0.2",
"justinrainbow/json-schema": "^5.2"
},
"require-dev": {
Expand Down
10 changes: 5 additions & 5 deletions doc/services/block-storage/v2/volume-types.rst
Expand Up @@ -3,7 +3,7 @@ Volume Types

Listing volume types
--------------------
.. sample:: block_storage/v2/volume_types/list.php
.. sample:: blockstoragev2/volume_types/list.php
.. refdoc:: OpenStack/BlockStorage/v2/Service.html#method_listVolumeTypes

Each iteration will return a :php:class:`VolumeType` instance <OpenStack/BlockStorage/v2/Models/VolumeType.html>.
Expand All @@ -17,7 +17,7 @@ Create volume type
The only attributes that are required when creating a volume are a name. The simplest example
would therefore be this:

.. sample:: block_storage/v2/volume_types/create.php
.. sample:: blockstoragev2/volume_types/create.php
.. refdoc:: OpenStack/BlockStorage/v2/Service.html#method_createVolumeType


Expand All @@ -27,7 +27,7 @@ Retrieve details of a volume type
When retrieving a volume type, sometimes you only want to operate on it - say to update or delete it. If this is the
case, then there is no need to perform an initial GET request to the API:

.. sample:: block_storage/v2/volume_types/get.php
.. sample:: blockstoragev2/volume_types/get.php

If, however, you *do* want to retrieve all the details of a remote volume type from the API, you just call:

Expand All @@ -46,7 +46,7 @@ Update a volume type
The first step when updating a volume type is modifying the attributes you want updated. By default, only a volume
type's name can be edited.

.. sample:: block_storage/v2/volume_types/update.php
.. sample:: blockstoragev2/volume_types/update.php
.. refdoc:: OpenStack/BlockStorage/v2/Models/VolumeType.html#method_update


Expand All @@ -55,5 +55,5 @@ Delete volume type

To permanently delete a volume type:

.. sample:: block_storage/v2/volume_types/delete.php
.. sample:: blockstoragev2/volume_types/delete.php
.. refdoc:: OpenStack/BlockStorage/v2/Models/VolumeType.html#method_delete
18 changes: 9 additions & 9 deletions doc/services/block-storage/v2/volumes.rst
Expand Up @@ -4,7 +4,7 @@ Volumes
List volumes
------------

.. sample:: block_storage/v2/volumes/list.php
.. sample:: blockstoragev2/volumes/list.php
.. refdoc:: OpenStack/BlockStorage/v2/Service.html#method_listVolumes

Each iteration will return a php:class:`Volume` instance <OpenStack/BlockStorage/v2/Models/Volume.html>.
Expand All @@ -17,15 +17,15 @@ Detailed information
By default, only the ``id``, ``links`` and ``name`` attributes are returned. To return *all* information
for a flavor, you must enable detailed information, like so:

.. sample:: block_storage/v2/volumes/list_detail.php
.. sample:: blockstoragev2/volumes/list_detail.php

Create volume
-------------

The only attributes that are required when creating a volume are a size in GiB. The simplest example
would therefore be this:

.. sample:: block_storage/v2/volumes/create.php
.. sample:: blockstoragev2/volumes/create.php

You can further configure your new volume, however, by following the below sections, which instruct you how to add
specific functionality.
Expand All @@ -35,17 +35,17 @@ specific functionality.
Create from image
~~~~~~~~~~~~~~~~~

.. sample:: block_storage/v2/volumes/create_from_image.php
.. sample:: blockstoragev2/volumes/create_from_image.php

Create from snapshot
~~~~~~~~~~~~~~~~~~~~

.. sample:: block_storage/v2/volumes/create_from_snapshot.php
.. sample:: blockstoragev2/volumes/create_from_snapshot.php

Create from source volume
~~~~~~~~~~~~~~~~~~~~~~~~~

.. sample:: block_storage/v2/volumes/create_from_source_volume.php
.. sample:: blockstoragev2/volumes/create_from_source_volume.php


Retrieve volume details
Expand All @@ -54,7 +54,7 @@ Retrieve volume details
When retrieving a volume, sometimes you only want to operate on it - say to update or delete it. If this is the case,
then there is no need to perform an initial GET request to the API:

.. sample:: block_storage/v2/volumes/get.php
.. sample:: blockstoragev2/volumes/get.php

If, however, you *do* want to retrieve all the details of a remote volume from the API, you just call:

Expand All @@ -73,13 +73,13 @@ Update volume
The first step when updating a volume is modifying the attributes you want updated. By default, only a volume's name
and description can be edited.

.. sample:: block_storage/v2/volumes/update.php
.. sample:: blockstoragev2/volumes/update.php
.. refdoc:: OpenStack/BlockStorage/v2/Models/Volume.html#method_update

Delete volume
-------------

To permanently delete a volume:

.. sample:: block_storage/v2/volumes/delete.php
.. sample:: blockstoragev2/volumes/delete.php
.. refdoc:: OpenStack/BlockStorage/v2/Models/Volume.html#method_delete
8 changes: 4 additions & 4 deletions doc/services/object-store/v1/account.rst
Expand Up @@ -6,13 +6,13 @@ Show account details

To work with an Object Store account, you must first retrieve an account object like so:

.. sample:: object_store/v1/account/get.php
.. sample:: objectstore/v1/account/get.php
.. refdoc:: OpenStack/ObjectStore/v1/Service.html#method_getAccount

Get account metadata
--------------------

.. sample:: object_store/v1/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
Expand Down Expand Up @@ -43,7 +43,7 @@ the metadata of the account will now be:

To merge metadata, you must run:

.. sample:: object_store/v1/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
Expand Down Expand Up @@ -75,5 +75,5 @@ the metadata of the account will now be:

To reset metadata, you must run:

.. sample:: object_store/v1/account/merge_metadata.php
.. sample:: objectstore/v1/account/merge_metadata.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/Account.html#method_mergeMetadata
12 changes: 6 additions & 6 deletions doc/services/object-store/v1/containers.rst
Expand Up @@ -4,7 +4,7 @@ Containers
Show details for a container
----------------------------

.. sample:: object_store/v1/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
Expand All @@ -25,7 +25,7 @@ and all of the local properties will match those of the remote resource.
List containers
---------------

.. sample:: object_store/v1/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.
Expand All @@ -46,7 +46,7 @@ container.
Delete container
----------------

.. sample:: object_store/v1/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
Expand All @@ -55,7 +55,7 @@ inside, the operation will fail.
Get metadata
------------

.. sample:: object_store/v1/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
Expand All @@ -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:: object_store/v1/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
Expand Down Expand Up @@ -95,7 +95,7 @@ the metadata of the account will now be:
Merge new metadata values with existing
---------------------------------------

.. sample:: object_store/v1/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
Expand Down
22 changes: 11 additions & 11 deletions doc/services/object-store/v1/objects.rst
Expand Up @@ -4,7 +4,7 @@ Objects
Show details for an object
--------------------------

.. sample:: object_store/v1/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
Expand All @@ -26,7 +26,7 @@ of the object's metadata, will not download the object's content. To do this, se
Download an object
------------------

.. sample:: object_store/v1/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
Expand All @@ -38,7 +38,7 @@ consult `Guzzle's docs`_.
List objects
------------

.. sample:: object_store/v1/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.
Expand All @@ -61,13 +61,13 @@ Create an object

When creating an object, you can upload its content according to a string representation:

.. sample:: object_store/v1/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:: object_store/v1/objects/create_from_stream.php
.. sample:: objectstore/v1/objects/create_from_stream.php

Create a large object (over 5GB)
--------------------------------
Expand All @@ -81,25 +81,25 @@ uploading, this is what happens under the hood:

To upload a DLO, you need to call:

.. sample:: object_store/v1/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:: object_store/v1/objects/copy.php
.. sample:: objectstore/v1/objects/copy.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/StorageObject.html#method_copy

Delete object
-------------

.. sample:: object_store/v1/objects/delete.php
.. sample:: objectstore/v1/objects/delete.php
.. refdoc:: OpenStack/ObjectStore/v1/Models/StorageObject.html#method_delete

Get metadata
------------

.. sample:: object_store/v1/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
Expand All @@ -109,7 +109,7 @@ correspond to the values set either when the object was created, or when a previ
Replace all metadata with new values
------------------------------------

.. sample:: object_store/v1/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
Expand Down Expand Up @@ -139,7 +139,7 @@ the metadata of the account will now be:
Merge new metadata values with existing
---------------------------------------

.. sample:: object_store/v1/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
Expand Down

0 comments on commit 8e40593

Please sign in to comment.