Leverage the new cliff command class attribute (_description)
to get the help of a command, this allows us to mark strings
for translation. We could not do this before since the help
was grabbed from the docstring.
This also depends on a new release of cliff and a bump to the
minimum level in osc's requirements.
Closes-Bug: 1636209
Depends-On: Id915f6aa7d95a0ff3dc6e2ceaac5decb3f3bf0da
Change-Id: I8673080bb5625e8e3c499feaefd42dfc7121e96f
None of the help messages for the object commands
are marked for translation. This patch adds the
necessary support.
Co-Authored-By: Steve Martinelli <s.martinelli@gmail.com>
Change-Id: Ibf472d8f7d5ab6c876f60cddcab8833b28f042e0
Option "--name" can be used to set as the object name of
the file to be uploaded in the container. Similar to option
"--object-name" in command "swift upload". Added unit test case
to ensure an exception is raised when using option "--name" for
uploading multiple objects.
Change-Id: Ied7827841f6ca1cf9d4b48e304cbe5d62eda38ab
Closes-Bug: #1607972
Convert to using ClientManager and OpenStackShell from osc-lib.
* Change all internal uses of ClientManager private attributes that are
now public in osc-lib's ClientManager. Leave back-compat copies in
place in OSC's clientManager so we don't break plugins.
* Put some work-arounds in place for changes in osc-lib that we need until
a new release makes it through the g-r and u-c change process.
* Add a test for Unicode decoding of argv in shell.main() to parallel
the one in osc-lib.
Change-Id: I85289740d4ca081f2aca8c9b40ec422ad25d302c
Previously each command logs take_action parameters explicitly
by using @utils.log_method decorator or log.debug().
Some commands have no logging.
This commit calls a logger in the base class and
drops all logging definition from individual commands.
Closes-Bug: #1532294
Change-Id: I43cd0290a4353c68c075bade9571c940733da1be
1) Change metadata to appear under a common 'properties' key, and
use the utility to format them, this applied to object, account
and container.
2) Clean up container and object output, which were setting the
x-container-meta-owner property, but this is metadata only for
the container, so it's pointless to have, removed it.
3) Container show was showing read/write ACLs and sync stuff, but
these are not being returned by my swift by default, so I moved
these to be checks, so we don't clutter the output.
Change-Id: Ife7521fe9c2724035b06963c118bd6016ba2f5b5
add docs and command support to set and unset metadata of objects
that are stored in an object store (swift).
Closes-Bug: #1501945
Change-Id: If838a4b3343b6ddb97cd4bd1cb63f0ba1c1a00a1
add the command `openstack account show` that lists details
about the object store account that the user authenticated
against.
Partial-Bug: #1501943
Change-Id: I1246dafee812b63a41d43be4e3598224364a2c11
this patch adds support for creating/updating and removing
properties (nee: metadata) for object store accounts.
Partial-Bug: #1501943
Change-Id: I3ed70a5d8bd8920fedb79adc60cdc602261d5eef
Instead of duplicating the same log statement throughout
the code, the same logic can be provided by a shared decorator
that abstracts away the logging capability and unifies it behind
a common function instead.
Change-Id: Icc63bced7347c8bbf0299a4c5821425a10892a79
Setting default versions in parsed args makes it so OCC
cannot tell if the argument was parsed, an environment
variable was set or it is just defaulted. In order to
set api versions from OCC, it will have to be defaulted
after processing OCC.
Closes-Bug: #1453229
Change-Id: I4d065919397b783f3bdd4022c986c0234a7a16e6
User should be able to specify the endpoint type through
a CLI optional argument/ENV variable setting. We will name this new
optional argument: --os-endpoint-type (Env: OS_ENDPOINT_TYPE) and
based on the value given, the service API will use that specific
endpoint type. Possible values: public, admin, internal.
DocImpact
Closes-Bug: #1454392
Change-Id: Ife3d4e46b44c0ddcd712b1130e27e362545a9a29
try and add some consistency with the show and delete commands.
replace 'show x' with 'display x'
change 'delete a y' with just 'delete y'
Change-Id: I47dfa8ee23ac5c41b355796415eb515155832f65
Anything that needs a service catalog can get it directly from
auth_ref.service_catalog, no need to carry the extra attribute.
ClientManager.get_endpoint_for_service_type() reamins the proper
method to get an endpoint for clients that still need one directly.
Change-Id: I809091c9c71d08f29606d7fd8b500898ff2cb8ae
1) Can't create instance of swiftclient. Since we now create
an API instance, creating a swiftclient instance won't work.
Trying to do any object related command fails.
2) Listing objects in a container fails, we depend on the
data returned in a specific way, during the API transition
this must have slipped through.
Needs regression/funcitonal tests to mame sure this doesn't
happen again.
Change-Id: I69079a0dc9f32b84e6f9307729d3dbbba549ac5e
api.object_store.APIv1 now contains the formerly top-level functions
implementing the object-store REST client. This replaces the old-style
ObjectClientv1 that is no longer necessary.
Change-Id: I7d8fea326b214481e7d6b24119bd41777c6aa968
Some objects can be saved as 'dirname/filename' which causes the
existing support to fail. The correct behaviour should be to
create the directories needed.
Change-Id: I71c61bc3b0f76a3e6d2703bd45508f9d6483546e
This replaces the restapi requests wrapper with the one from Keystone client so
we can take advantage of the auth plugins.
As a first step only the v2 and v3 token and password plugins are supported.
This maintainis no changes to the command options or environment variables.
The next steps will include reworking the other API client interfaces to
fully utilize the single auth session.
Blueprint: ksc-session-auth
Change-Id: I47ec63291e4c3cf36c8061299a4764f60b36ab89
This is step 1 toward using Keystone client's session.Session as the
primary session/requests interface in OSC.
* Move the session create into ClientManager and rename 'restapi' attribute to 'session'
* Set up ClientManager and session loggers
* Fix container and object command references to restapi/api
Change-Id: I013d81520b336c7a6422cd22c05d1d65655e64f8
Add commands to upload an object to a container, and to delete
an object from a container.
Change-Id: I37c02315495bba5abe612733d1109a3d4ce256a1
implements: bp swift-client
Previously the API_NAME was 'object-store' which caused all sorts
of failures when running swift commands
Change-Id: I448ca10f7d173024313722246e63cf23fd71117c
Closes-Bug: #1343658
There are files containing string format arguments inside
logging messages. Using logging function parameters should
be preferred.
Change-Id: Ic749ac9eb55564ed631d57055a5a4dfc3aebd169
Prepare to use the (soon to be) common Session from keystoneclient
* Rework RESTApi to eventually be a subclass of keystoneclient.Session
Change-Id: I68e610f8b19a3f6267a93f7bf3de54a228be68aa
Allows client libraries to have complete access to the rest of the
OSC ClientManager. In addition, extension libraries can define
global options (for API version options/env vars) and define
versioned API entry points similar to the in-repo commands.
The changes to ClientManager exposed some issues in the existing
object api tests that needed to be cleaned up.
Change-Id: Ic9662edf34c5dd130a2f1a69d2454adefc1f8a95