Update apiclient.base and reuse new functional

Module apiclient.base has several updates in oslo, so we need to sync
latest code to have ability to reuse new functional.

Updates in oslo which related to usage of apiclient.base in heatclient:
- I491f9b54c7074546cf738c6150666bfcc3966a78
- I1db6c12a1f798de7f7fafd0c34fb0ef523610153

Related to bp common-client-library-2

Change-Id: I509d6efb0c8eef87ba2e4aa02ebb44ba149a9860
Remove None for dict.get()

Because If no default value is specified it defaults to None already.

Change-Id: I1ca522c7eebb2171d1a3efd35680ce42b89237b5
Do not use the '+' operation dict_items()

This operation is undefined in Python3, list() must be called first.

Change-Id: I07a9b81a117dfd38e04e1d92533522036f8b0f9f
"version" section should be required in template

Adding the version checking to keep place with heat.

Change-Id: Ib2f0b55c3c9e8b0a8f26e972b37a979d8d703f7c
Closes-Bug: #1273980
Expand get_file using to template scope

So we can use get_file in outputs section and parameters section
except resources section. For example, we can use get_file to set
default value for some parameters.

Closes-Bug: #1284493
Change-Id: If584ea108b437c28713925af68691c019e64e1fc
Merge ""version" section should be required in template"
Merge "Expand get_file using to template scope"
Merge "Remove None for dict.get()"
Merge "Update apiclient.base and reuse new functional"
Merge "Do not use the '+' operation dict_items()"
Enable --help for each command

Now heat stack-create --help outputs same with heat --help. It should
output the help message for stack-create instead of the global one.

Change-Id: I1b451ddb4ecba3bb3294ff3219a5ecad394ada9e
Python3: fix test_stack_list_with_args()

The expected_url in test_stack_list_with_args() does not always match the URL
actually used in the code. This patch fixes this issue by:
- using urlutils.urlencode() in both the code and the tests, so that changes in
 the urlencode() implementation do not affect the tests;
- setting the PYTHONHASHSEED environment variable to 0 when running the tests,
  so that randomisation is disabled and urlutils.urlencode() has predictable
  results.

Change-Id: I5b50bad98f5c237cdc12e4ab75f21917ca0ef30d
Rename --timeout global option and make it work

The --timeout option doesn't work for standalone use-cases when
you specify no-client-auth, and it's also confusing since it's
easily misinterpreted as an option related to the heat timeouts
provided to stack-create and in future stack-update.

So take this opportunity to rename the option to --api-timeout,
which hopefully more accurately reflects it's purpose, and don't
pass a default (just let requests use the global default socket
timeout) as it seems relatively unlikely users will wait for 10
minutes before pressing Ctrl-C on interactive shell requests.

Change-Id: I52480f0d128735bf5f312fc88f4078f27717baf2
Partial-Bug: #1290456
Remove unused versions define in template_format.py

Remove unused 'HEAT_VERSIONS' and 'CFN_VERSIONS' define in
template_format.py.

Change-Id: I32202662ff62bc3e57b3af73b4163d2378887901
Deprecate create/adopt --create-timeout in favor of --timeout

Replace the --create-timeout option with a more generic and intuitive
--timeout option, which can also later be used for update.

Since users may be using this option and it does currently work, leave
the old -c/--create-timeout option for now, but mark deprecated in the
usage and output a warning message if users use it.  To make this
warning visible the default loglevel is changed to WARNING.

Note neither timeout contains an integer default now, we rely on the
server-side default (which is 60mins anyway) as this make the fallback
to support the previous option easier and potentially to provide an
easier way to solve heat bug #1290603.

Partial-Bug: #1290456
Related-Bug: #1290603
Change-Id: Ia8c8d61b259ffa1f8a59d29a3e7fa7d9c128984f
Add timeout option to stack-update

The API spec says the PUT which handles stack-update accepts a
timeout_mins argument, so add CLI support for it, making the
interface consistent with create/adopt.  Note this argument
currently isn't respected by heat, ref bug #1290603

Change-Id: Ie8d51540d0d93be51966e60601fd02d635cdae09
Closes-Bug: #1290456
Related-Bug: #1290603
Merge "Remove unused versions define in template_format.py"
Merge "Python3: fix test_stack_list_with_args()"