Skip to content

Specify service micro version - #177

Merged
jamiehannaford merged 4 commits into
masterfrom
micro-version
Nov 21, 2017
Merged

jamiehannaford merged 4 commits into
masterfrom
micro-version

Conversation

@haphan

@haphan haphan commented Nov 21, 2017

Copy link
Copy Markdown
Collaborator

By default, for backward compatibility, OpenStack API chooses the minimum supported version.
This also means certain features won't be available until a specified version is set in API calls via header, e.g OpenStack-API-Version: compute 2.17;

This PR allows SDK users to specify micro-version of a given service.

Usage:

$compute = $openstack->computeV2(['microVersion' => '2.27']);

@haphan

haphan commented Nov 21, 2017

Copy link
Copy Markdown
Collaborator Author

@jamiehannaford sorry for bombarding you with PRs

@jamiehannaford jamiehannaford left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall lgtm, just a few minor nits 👍

Comment thread src/Common/Service/Builder.php Outdated
'handler' => $stack,
];

if ($microVersion) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be $serviceType && $microVersion

Comment thread src/Common/Service/Builder.php Outdated
}

private function httpClient(string $baseUrl, HandlerStack $stack): ClientInterface
private function httpClient(string $baseUrl, HandlerStack $stack, string $serviceType, string $microVersion = null): ClientInterface

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$serviceType can also be null right?

Comment thread src/Compute/v2/Params.php
'type' => self::STRING_TYPE,
'sentAs' => 'user_id',
'location' => self::QUERY
];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add a brief description saying that this refines keypairs by ownership

@haphan

haphan commented Nov 21, 2017

Copy link
Copy Markdown
Collaborator Author

Pushed 😃

@jamiehannaford
jamiehannaford merged commit f42dd25 into master Nov 21, 2017
@jamiehannaford

Copy link
Copy Markdown
Contributor

Thanks @haphan!!

@haphan
haphan deleted the micro-version branch November 21, 2017 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants