Skip to content

Instantly share code, notes, and snippets.

@jturel
jturel / gist:c001c0548cfe64a5b9950711752cdf7f
Last active February 5, 2020 19:53
Generate Swagger definitions
mkdir -p /tmp/apidoc
chown foreman:foreman /tmp/apidoc
foreman-rake apipie:static_swagger_json OUT=/tmp/apidoc

results in:

[root@sat]# ll /tmp/apidoc
total 27712
@jturel
jturel / gist:dc9e405cb0930e429cf7ce7e76ff238d
Created August 2, 2019 18:03
generate and import a manifest into local candlepin
in the console:
# find library environment of default org
environment_id = Katello::ContentViewEnvironment.first.cp_id
# create the consumer in the environment
consumer = Katello::Resources::Candlepin::Consumer.create(environment_id, {name: "you-will-export-me", type: {"label": "candlepin"}}, [])
# export the consumer's manifest to a .zip
data = Katello::Resources::Candlepin::CandlepinResource.get("/candlepin/consumers/#{consumer['uuid']}/export")