Jeff Bradberry
30a3e3e172
Deal with lack of permissions
2020-06-09 13:54:05 -04:00
Jeff Bradberry
01d575f833
Enable the remaining top-level exportable resources
...
and rearrange the import/export methods a bit.
2020-06-09 13:54:05 -04:00
Jeff Bradberry
e0f6af4700
Enable the export of several relation field types
2020-06-09 13:54:05 -04:00
Jeff Bradberry
3860c7597f
Move the import logic into methods on the ApiV2 class
2020-06-09 13:54:05 -04:00
Jeff Bradberry
e4146e9bc7
Move the export logic onto methods on the ApiV2 class
...
making it easier to invoke programmatically.
2020-06-09 13:54:05 -04:00
Jeff Bradberry
19c92a7055
Enable notification templates
2020-06-09 13:54:05 -04:00
Jeff Bradberry
6a9add4fe3
Deal somewhat reasonably with missing fields as part of the natural key
...
- JobTemplate.organization has recently been added, we need to support
with and without
- WorkflowJobTemplateNode is shortly going to get an identifier field,
and we will need to support both with and without
2020-06-09 13:54:05 -04:00
Jeff Bradberry
ad574eb896
Enable credential export
2020-06-09 13:54:05 -04:00
Jeff Bradberry
55f79a4569
Fix a couple of flaws
...
- The dependency ordering may spit out page types that weren't in the import data set. Make sure to be able to map those to resources anyway.
- freeze() needs to be able to deal with nullable foreign keys.
2020-06-09 13:54:05 -04:00
Jeff Bradberry
d20fa03034
Create new Import.dependent_resources method
...
that yields up resource names, even ones that aren't explicitly in the
import data, in dependency order.
2020-06-09 13:54:05 -04:00
Jeff Bradberry
868aafb263
Filter out managed credential types
...
since we cannot patch them upon import.
2020-06-09 13:54:05 -04:00
Jeff Bradberry
3f204659a8
Temporarily disable export of resources that may not work yet
2020-06-09 13:54:05 -04:00
Jeff Bradberry
ea5b810e87
Sort the asset groups to be imported by their dependency relationships
2020-06-09 13:54:04 -04:00
Jeff Bradberry
2c00d42ced
Only use a default password if an import user doesn't already exist
2020-06-09 13:54:04 -04:00
Jeff Bradberry
d191edcaf1
Fix a Python 2 syntax error
...
it doesn't like multiple **kwargs, apparently.
2020-06-09 13:54:04 -04:00
Jeff Bradberry
65e16dc7ae
Get and assign the related objects
2020-06-09 13:54:04 -04:00
Jeff Bradberry
95b22bf05b
Begin to deal with existing matching assets
...
by using a registry allowing the lookup of Page objects by (frozen)
natural keys.
2020-06-09 13:54:04 -04:00
Jeff Bradberry
21e36ad19a
Add the calculated natural key to the export data for each asset
2020-06-09 13:54:04 -04:00
Jeff Bradberry
f53920d3bf
Begin changing Import to work with the structure created by Export
2020-06-09 13:54:04 -04:00
Jeff Bradberry
372570ce8e
Extract out get_natural_key as a standalone function
2020-06-09 13:54:04 -04:00
Jeff Bradberry
6f28361bf5
Make serialize_asset use Pages to a greater extent
2020-06-09 13:54:04 -04:00
Jeff Bradberry
0877e5305c
Modify get_natural_key to work on Pages
2020-06-09 13:54:04 -04:00
Jeff Bradberry
e4383c505f
Make more use of the functionality of Page in get_assets
...
and related methods. Also, rename get_resource_options -> get_options
and enhance_asset -> serialize_asset.
2020-06-09 13:54:04 -04:00
Jeff Bradberry
fb066eb52e
Fold the other methods doing API calls into get_assets()
2020-06-09 13:54:04 -04:00
Jeff Bradberry
6162ff0439
Start to record the role membership
...
but not really, since it still isn't fully capturing the role content_object
2020-06-09 13:54:04 -04:00
Jeff Bradberry
dfe34563aa
Resolve the natural keys of assets we've already collected
2020-06-09 13:54:04 -04:00
Jeff Bradberry
37cbf7691b
Split out separate methods for the OPTIONS call and massaging each asset dict
2020-06-09 13:54:04 -04:00
Jeff Bradberry
9280198b0f
Use a list of exportable resources to build up the parser
...
Also, handle an implicit export of everything.
2020-06-09 13:54:04 -04:00
Jeff Bradberry
2127f3c96d
Add organizations as a resource type to export
2020-06-09 13:54:04 -04:00
Jeff Bradberry
9f7fecf8da
Add basic import command
2020-06-09 13:54:04 -04:00
Jeff Bradberry
c1a07ff00b
Limit export output to only those fields needed to create the resource
2020-06-09 13:54:04 -04:00
Jeff Bradberry
f21d6b1fc4
Actually query the API for the user or users requested
2020-06-09 13:54:04 -04:00
Jeff Bradberry
4312395a3a
Normalize the requested resource into a pk
...
using the pk_or_name helper function. Also, authenticate to the API.
2020-06-09 13:54:04 -04:00
Jeff Bradberry
c1f6fec532
Add skeleton of a custom 'export' resource
...
This only takes a flag for users at the moment, and does nothing in
particular with it.
2020-06-09 13:54:04 -04:00
Shane McDonald
2bbbb04499
Bump version to 12.0.0
2020-06-09 12:19:17 -04:00
Ryan Petrello
0c6b7fdb59
don't use symlinks for awxkit VERSION
...
as much as I'd like this to just work, certain versions of pip just
don't support it -_-
see: https://github.com/ansible/awx/issues/7107
see: https://github.com/pypa/pip/issues/7555
so unfortunately, we just have to track these as two distinct files and
just keep them in sync
2020-05-21 12:10:33 -04:00
Ryan Petrello
18607107a7
remove the deprecated extra_credentials endpoints
2020-04-30 10:22:02 -04:00
Elyézer Rezende
5c91f66316
Keep awxkit's requirements on the setup.py
...
awxkit's setup.py was making use of pip internal structures to parse the
requirements.txt file. This is not a good thing as they may change,
actually that just happened.
To avoid this in the future, move the list of requirements to setup.py
and make requirements.txt list `.` as the only item. This way we keep a
single place to update requirements in the future and avoid accessing
pip's internals.
2020-04-29 14:47:21 -04:00
Francois Herbert
d0384799fd
Add ability to monitor jobs and workflow_jobs via awx cli, fixes #6165
...
Signed-off-by: Francois Herbert <francois@herbert.org.nz>
Fixup linting
Remove timeout option, not really required and it's making the api test fail
2020-04-27 15:09:16 -04:00
Christian Adams
a899a147e1
Fix new flake8 from pyflakes 2.2.0 release
2020-04-20 09:50:50 -04:00
AlanCoding
b90a296d41
Document and align the env var for OAuth token
2020-04-07 10:00:02 -04:00
Elijah DeLee
8e07269738
make awxkit pass through identifier for wfjtn
...
We need this to be able to create workflow job template nodes with identifier
2020-04-06 11:26:56 -04:00
Ryan Petrello
32627ce51a
promote AWX CLI installation instructions to the global INSTALL.md
...
a few users have had trouble finding these instructions, so let's move
them into the top level installation docs
2020-03-30 11:46:10 -04:00
Ryan Petrello
ea54815e6b
fix a bug that broke awx config
...
see: https://github.com/ansible/tower/issues/4206
2020-03-27 17:07:48 -04:00
softwarefactory-project-zuul[bot]
ee4dcd2055
Merge pull request #6403 from jbradberry/awxkit-from-json-connection
...
Add a connection kwarg to Page.from_json
Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
2020-03-25 15:33:37 +00:00
softwarefactory-project-zuul[bot]
0f7a4b384b
Merge pull request #6386 from jbradberry/awxkit-api-endpoints
...
Awxkit api endpoints
Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
2020-03-25 15:33:32 +00:00
Jeff Bradberry
91135f638f
Add a connection kwarg to Page.from_json
...
if you don't reuse the connection when doing this, you lose your
authentication.
2020-03-24 15:27:51 -04:00
AlanCoding
5e595caf5e
Add workflow node identifier
...
Generate new modules WFJT and WFJT node
Touch up generated syntax, test new modules
Add utility method in awxkit
Fix some issues with non-name identifier in
AWX collection module_utils
Update workflow docs for workflow node identifier
Test and fix WFJT modules survey_spec
Plug in survey spec for the new module
Handle survey spec idempotency and test
add associations for node connections
Handle node credential prompts as well
Add indexes for new identifier field
Test with unicode dragon in name
2020-03-23 22:00:00 -04:00
Jeff Bradberry
e3ea4e2398
Register the resource copy endpoints as awxkit page types
2020-03-23 15:19:48 -04:00
Jeff Bradberry
e4e2d48f53
Register some missing related endpoints in awxkit
...
- the newer varieties of notification templates
- organization workflow job templates
- credential owner users and owner teams
this allows the endpoints to get wrapped in appropriate Page types,
not just the Base page type.
2020-03-23 15:18:47 -04:00