MCPcopy Index your code
hub / github.com/cloudfoundry/cli / UploadBitsPackage

Method UploadBitsPackage

api/cloudcontroller/ccv3/package.go:73–83  ·  view source on GitHub ↗

UploadBitsPackage uploads the newResources and a list of existing resources to the cloud controller. An updated package is returned. The function will act differently given the following Readers: - io.ReadSeeker: Will function properly on retry. - io.Reader: Will return a ccerror.PipeSeekError on re

(pkg resources.Package, matchedResources []Resource, newResources io.Reader, newResourcesLength int64)

Source from the content-addressed store, hash-verified

71// Note: In order to determine if package creation is successful, poll the
72// Package's state field for more information.
73func (client *Client) UploadBitsPackage(pkg resources.Package, matchedResources []Resource, newResources io.Reader, newResourcesLength int64) (resources.Package, Warnings, error) {
74 if matchedResources == nil {
75 return resources.Package{}, nil, ccerror.NilObjectError{Object: "matchedResources"}
76 }
77
78 if newResources == nil {
79 return client.uploadExistingResourcesOnly(pkg.GUID, matchedResources)
80 }
81
82 return client.uploadNewAndExistingResources(pkg.GUID, matchedResources, newResources, newResourcesLength)
83}
84
85// UploadPackage uploads a file to a given package's Upload resource. Note:
86// fileToUpload is read entirely into memory prior to sending data to CC.

Callers

nothing calls this directly

Tested by

no test coverage detected