Comments (16)
php-opencloud/common:v1.0.4
is now released
from openstack.
Right now, this is not possible to do. We should definitely add this ability though, since it's a fairly standard use case. I imagine you'd pass in options as a new constructor key to the OpenStack
builder. What do you think @haphan?
from openstack.
@jamiehannaford 👍 for having a new constructor key in OpenCloud\Common\Service\Builder
.
Propose PR: php-opencloud/common#3
from openstack.
Hello
How to insert the option verify in this example ?
require 'vendor/autoload.php';
$openstack = new OpenStack\OpenStack([
'authUrl' => '{authUrl}',
'region' => '{region}',
'user' => [
'id' => '{userId}',
'password' => '{password}'
],
'scope' => ['project' => ['id' => '{projectId}']]
]);
$images = $openstack->imagesV2()
->listImages();
foreach ($images as $image) {
}
Thanks
from openstack.
@BorderCloud Updated
$requestOptions = [
'verify' => '/path/to/custom/ca.cert',
'headers' => ['User-Agent' => 'PHP-OPENCLOUD/SDKv1.0'],
];
$params = [
'authUrl' => 'http://172.16.113.139:5000/v3',
'region' => 'RegionOne',
'user' => [
'name' => 'admin',
'password' => '034cdbdb0fd84c5f',
'domain' => ['id' => 'default'],
],
'requestOptions' => $requestOptions,
];
$openstack = new OpenStack\OpenStack($params);
foreach ($openstack->computeV2()->listImages() as $image) {
}
Until @jamiehannaford is going tag php-opencloud/common
, you will have to manually specify php-opencloud/common: dev-master
in your composer.json
Update: correct sample code
from openstack.
@jamiehannaford btw can you also tag php-opencloud/openstack
?
from openstack.
Thanks, I suppose Builder waits a list of parameters in the array because I have now messages like:
- "authUrl" is a required option
- and after, "identityService" must be specified and implement OpenCloud\Common\Auth\IdentityService
Can you give a example with builder ? I am a newbie on openstack...
use OpenCloud\Common\Service\Builder;
// see list of built-in Guzzle request options at GuzzleHttp\RequestOptions
$requestOptions = [
'verify' => '/path/to/custom/ca.cert',
'timeout' => '60'
];
$builder = new Builder([], 'OpenCloud', $requestOptions);
$openstack = new OpenStack\OpenStack([
'authUrl' => '{authUrl}',
'region' => '{region}',
'user' => [
'id' => '{userId}',
'password' => '{password}'
],
'scope' => ['project' => ['id' => '{projectId}']]
], $builder);
$images = $openstack->imagesV2()
->listImages();
foreach ($images as $image) {
}
Thanks
Karima
from openstack.
@haphan @BorderCloud I think we should add requestOptions
to the OpenStack class. That could be fed into the service builder.
from openstack.
@jamiehannaford
I agree that requestOptions
need to pass to OpenStack
since a HTTP client is also created here.
Regarding requestOption
, I think it'd better to directly use array $options['requestOptions']
to OpenStack class. This options will also be fed into Builder
.
from openstack.
what do you think @jamiehannaford
#63
php-opencloud/common#4
from openstack.
@BorderCloud See my updated sample code above. You may need to run composer update php-opencloud/openstack
to fetch latest version.
from openstack.
Ok I have the version Installing php-opencloud/common (v1.0.5)
But I always the message cURL error 7: Permission denied
If I test with a bad file, the message is always the same... Strange...
$requestOptions = [
'verify' => '/var/www/html/demo/NotExistFile.pem', // or 'NotExistFile.pem'
'headers' => ['User-Agent' => 'PHP-OPENCLOUD/SDKv1.0']
];
An idea ?
from openstack.
@BorderCloud Looks like environment issue for me. Are you running Centos with SELINUX enabled? Reference: guzzle/guzzle#1001
When an invalid pem file is supplied, this is what I got:
Fatal error: Uncaught InvalidArgumentException: SSL CA bundle not found: /not/valid/ca.pem in /app/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:331
from openstack.
Ok without SELinux I have now the message
Client error: `POST https://keystone.....:5000/v3/auth/tokens` resulted in a `401 Unauthorized` response:
{"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}
A problem in the lib or in the config ?
from openstack.
Check your openstack crendential.
On Thursday, 23 June 2016, Karima Rafes [email protected] wrote:
Ok without SELinux I have now the message
Client error:
POST https://keystone.....:5000/v3/auth/tokens
resulted in a401 Unauthorized
response:
{"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}A problem in the lib or in the config ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#62 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAwIsnoxSS0oW6CPVC4PKDXNdopSVDYBks5qOmTvgaJpZM4I5Iuv
.
from openstack.
Issued resolved.
from openstack.
Related Issues (20)
- Feature Request - Add app credentials HOT 1
- Feature request - List projects by tags
- Support object_storage_url override
- Documentation bug for createVolume method
- Documentation bug for security groups HOT 1
- How to retrieve a part of an object by defining a range? HOT 1
- How to get used_ips of network
- ENH REQUEST: Return image ID when creating server image
- ENH REQUEST: Filter Image List HOT 1
- DOCS: Delete Image docs are incorrect or missing information.
- Is this code still being maintained? HOT 13
- failed: Call to undefined function GuzzleHttp\Promise\all()
- The current state of the project HOT 1
- The createLargeObject() does not work correctly for segment count 10 and more
- How to get a public URL using which I can view image in browser? HOT 2
- $compute->getServer return null values HOT 3
- question: can we suspend and un-suspend server? HOT 1
- used password shown on error message HOT 1
- getVolumesAttached to server HOT 2
- [Question, potentially a bug] How to debug requests when creating a server HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openstack.