def show_package_releases(namespace, package_name): reponame = repo_name(namespace, package_name) media_type = getvalues().get('media_type', None) result = cnr.api.impl.registry.show_package_releases(reponame, media_type=media_type, package_class=Package) return jsonify(result)
def delete_package(namespace, package_name, release, media_type): reponame = repo_name(namespace, package_name) result = cnr.api.impl.registry.delete_package(reponame, release, media_type, package_class=Package) return jsonify(result)
def show_package(namespace, package_name, release, media_type): reponame = repo_name(namespace, package_name) result = cnr.api.impl.registry.show_package(reponame, release, media_type, channel_class=Channel, package_class=Package) return jsonify(result)
def add_channel_release(namespace, package_name, channel_name, release): reponame = repo_name(namespace, package_name) result = cnr.api.impl.registry.add_channel_release(reponame, channel_name, release, channel_class=Channel, package_class=Package) return jsonify(result)
def build_tar(namespace, package_name, release, media_type): reponame = repo_name(namespace, package_name) k = _build(reponame, release, media_type) resp = current_app.make_response(k.build_tar()) resp.mimetype = 'application/tar' resp.headers['Content-Disposition'] = 'filename="%s_%s.tar.gz"' % ( k.name.replace("/", "_"), k.version) return resp
def pull_json(namespace, package_name, release, media_type): reponame = repo_name(namespace, package_name) data = cnr.api.impl.registry.pull(reponame, release, media_type, Package, blob_class=Blob) return _pull(data, json_format=True)
def pull(namespace, package_name, release, media_type): reponame = repo_name(namespace, package_name) data = cnr.api.impl.registry.pull(reponame, release, media_type, Package, blob_class=Blob) json_format = request.args.get('format', None) == 'json' return _pull(data, json_format=json_format)
def push(namespace, package_name): reponame = repo_name(namespace, package_name) values = getvalues() release = values['release'] media_type = values.get('media_type', DEFAULT_MEDIA_TYPE) force = (values.get('force', 'false') == 'true') metadata = values.get('metadata', None) blob = Blob(reponame, values['blob']) result = cnr.api.impl.registry.push(reponame, release, media_type, blob, force, Package, metadata=metadata) return jsonify(result)
def build(namespace, package_name, release, media_type): reponame = repo_name(namespace, package_name) current_app.logger.info("generate %s", namespace, package_name) k = _build(reponame, release, media_type) return jsonify(k.build())
def tree(namespace, package_name, release, media_type): reponame = repo_name(namespace, package_name) r = kpm.api.impl.builder.tree( reponame, endpoint=current_app.config['KPM_REGISTRY_HOST']) return jsonify(r)
def show_file(namespace, package_name, filepath): reponame = repo_name(namespace, package_name) return kpm.api.impl.builder.show_file( reponame, filepath, endpoint=current_app.config['KPM_REGISTRY_HOST'])
def blobs_json(namespace, package_name, digest): reponame = repo_name(namespace, package_name) data = cnr.api.impl.registry.pull_blob(reponame, digest, blob_class=Blob) return _pull(data, json_format=True)
def blobs(namespace, package_name, digest): reponame = repo_name(namespace, package_name) data = cnr.api.impl.registry.pull_blob(reponame, digest, blob_class=Blob) json_format = request.args.get('format', None) == 'json' return _pull(data, json_format=json_format)
def delete_channel(namespace, package_name, channel_name): reponame = repo_name(namespace, package_name) result = cnr.api.impl.registry.delete_channel(reponame, channel_name, channel_class=Channel) return jsonify(result)
def show_channel(namespace, package_name, channel_name): reponame = repo_name(namespace, package_name) result = cnr.api.impl.registry.show_channel(reponame, channel_name, Channel) return jsonify(result)
def list_channels(namespace, package_name): reponame = repo_name(namespace, package_name) result = cnr.api.impl.registry.list_channels(reponame, Channel) resp = current_app.make_response(json.dumps(result)) resp.mimetype = 'application/json' return resp
def show_package_release_manifests(namespace, package_name, release): reponame = repo_name(namespace, package_name) result = cnr.api.impl.registry.show_package_manifests( reponame, release, package_class=Package) return jsonify(result)