|
[root@graphite /]# cat /usr/bin/pcurl
|
|
#!/bin/bash
|
|
|
|
ARGS=$@
|
|
|
|
curl -s "http://admin:admin@localhost:8000/pulp/api/v3/${ARGS}/" | python -mjson.tool
|
|
|
|
[root@graphite /]# pcurl repositories/1
|
|
{
|
|
"_created": "2019-03-05T07:34:17.943470Z",
|
|
"_href": "/pulp/api/v3/repositories/1/",
|
|
"_latest_version_href": "/pulp/api/v3/repositories/1/versions/2/",
|
|
"_versions_href": "/pulp/api/v3/repositories/1/versions/",
|
|
"description": "",
|
|
"name": "centosplus74"
|
|
}
|
|
|
|
[root@graphite /]# pcurl remotes/rpm/rpm/5
|
|
{
|
|
"_created": "2019-03-05T07:48:53.156191Z",
|
|
"_href": "/pulp/api/v3/remotes/rpm/rpm/5/",
|
|
"_last_updated": "2019-03-05T07:48:53.156213Z",
|
|
"_type": "rpm.rpm",
|
|
"download_concurrency": 20,
|
|
"name": "centosplus74",
|
|
"policy": "immediate",
|
|
"proxy_url": "",
|
|
"ssl_validation": true,
|
|
"url": "http://vault.centos.org/7.4.1708/centosplus/x86_64/",
|
|
"validate": true
|
|
}
|
|
|
|
# sync task output
|
|
[root@graphite /]# pcurl tasks/9
|
|
{
|
|
"_created": "2019-03-06T05:31:33.335815Z",
|
|
"_href": "/pulp/api/v3/tasks/9/",
|
|
"created_resources": [
|
|
"/pulp/api/v3/repositories/1/versions/2/"
|
|
],
|
|
"error": null,
|
|
"finished_at": "2019-03-06T05:37:40.808040Z",
|
|
"job_id": "eca51881-1b07-43a1-a6ad-bb832b31b7ca",
|
|
"name": "pulp_rpm.app.tasks.synchronizing.synchronize",
|
|
"non_fatal_errors": [],
|
|
"parent": null,
|
|
"progress_reports": [
|
|
{
|
|
"done": 4,
|
|
"message": "Downloading and Parsing Metadata",
|
|
"state": "completed",
|
|
"suffix": "",
|
|
"task": "/pulp/api/v3/tasks/9/",
|
|
"total": 4
|
|
},
|
|
{
|
|
"done": 91,
|
|
"message": "Downloading Artifacts",
|
|
"state": "completed",
|
|
"suffix": "",
|
|
"task": "/pulp/api/v3/tasks/9/",
|
|
"total": 91
|
|
},
|
|
{
|
|
"done": 91,
|
|
"message": "Associating Content",
|
|
"state": "completed",
|
|
"suffix": "",
|
|
"task": "/pulp/api/v3/tasks/9/",
|
|
"total": 91
|
|
}
|
|
],
|
|
"spawned_tasks": [],
|
|
"started_at": "2019-03-06T05:31:33.418256Z",
|
|
"state": "completed",
|
|
"worker": "/pulp/api/v3/workers/3/"
|
|
}
|
|
|
|
[root@graphite /]# pcurl repositories/1/versions/2
|
|
{
|
|
"_created": "2019-03-06T05:31:33.437399Z",
|
|
"_href": "/pulp/api/v3/repositories/1/versions/2/",
|
|
"base_version": null,
|
|
"content_summary": {
|
|
"added": {
|
|
"rpm.package": {
|
|
"count": 91,
|
|
"href": "/pulp/api/v3/content/rpm/packages/?repository_version_added=/pulp/api/v3/repositories/1/versions/2/"
|
|
}
|
|
},
|
|
"present": {
|
|
"rpm.package": {
|
|
"count": 92,
|
|
"href": "/pulp/api/v3/content/rpm/packages/?repository_version=/pulp/api/v3/repositories/1/versions/2/"
|
|
}
|
|
},
|
|
"removed": {}
|
|
},
|
|
"number": 2
|
|
}
|
|
|
|
[root@graphite /]# pcurl publishers/rpm/rpm/2
|
|
{
|
|
"_created": "2019-03-06T05:40:00.118519Z",
|
|
"_href": "/pulp/api/v3/publishers/rpm/rpm/2/",
|
|
"_last_updated": "2019-03-06T05:40:00.118541Z",
|
|
"_type": "rpm.rpm",
|
|
"distributions": [],
|
|
"name": "centosplus74"
|
|
}
|
|
|
|
[root@graphite /]# pcurl publications/2
|
|
{
|
|
"_created": "2019-03-06T05:43:45.551628Z",
|
|
"_href": "/pulp/api/v3/publications/2/",
|
|
"distributions": [
|
|
"http://localhost:8000/pulp/api/v3/distributions/2/"
|
|
],
|
|
"publisher": "/pulp/api/v3/publishers/rpm/rpm/2/",
|
|
"repository_version": "/pulp/api/v3/repositories/1/versions/2/"
|
|
}
|
|
|
|
[root@graphite /]# pcurl distributions
|
|
{
|
|
"count": 1,
|
|
"next": null,
|
|
"previous": null,
|
|
"results": [
|
|
{
|
|
"_created": "2019-03-06T05:45:04.989815Z",
|
|
"_href": "/pulp/api/v3/distributions/2/",
|
|
"base_path": "centos74",
|
|
"base_url": "localhost:8000/pulp/content/centos74",
|
|
"content_guard": null,
|
|
"name": "centosplus74",
|
|
"publication": "/pulp/api/v3/publications/2/",
|
|
"publisher": null,
|
|
"repository": null
|
|
}
|
|
]
|
|
}
|
|
|