Ejemplo n.º 1
0
    def Run(self, args):
        project = properties.VALUES.core.project.Get(required=True)
        object_ref = storage_util.ObjectReference.FromUrl(
            args.INPUT_URI_PREFIX, allow_empty_object=True)

        response = admin_api.Import(project,
                                    object_ref.ToUrl().rstrip('/'),
                                    collection_ids=args.collection_ids)

        if not args.async_:
            operations.WaitForOperation(response)

        return response
Ejemplo n.º 2
0
    def Run(self, args):
        project = properties.VALUES.core.project.Get(required=True)
        object_ref = storage_util.ObjectReference.FromUrl(
            args.OUTPUT_URI_PREFIX, allow_empty_object=True)

        response = admin_api.Export(
            project,
            # use join and filter to avoid trailing '/'.
            object_ref.ToUrl().rstrip('/'),
            collection_ids=args.collection_ids)

        if not args. async:
            operations.WaitForOperation(response)

        return response