_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c5200
train
// NewCertificate creates a new Certificate for the given cert and key.
{ "resource": "" }
c5201
train
// Validate ensures that the cert is valid.
{ "resource": "" }
c5202
train
// WriteCertPEM writes the cert's x.509 PEM data to the given writer.
{ "resource": "" }
c5203
train
// WriteKeyPEM writes the key's x.509 PEM data to the given writer.
{ "resource": "" }
c5204
train
// Fingerprint returns the cert's LXD fingerprint.
{ "resource": "" }
c5205
train
// X509 returns the x.509 certificate.
{ "resource": "" }
c5206
train
// AsCreateRequest creates a payload for the LXD API, suitable for posting the // client certificate to an LXD server.
{ "resource": "" }
c5207
train
// stateStepsFor253 returns upgrade steps for Juju 2.5.3 that manipulate state directly.
{ "resource": "" }
c5208
train
// SetPodSpec sets the pod spec for the given application tag. // An error will be returned if the specified application is not alive.
{ "resource": "" }
c5209
train
// PodSpec returns the pod spec for the given application tag.
{ "resource": "" }
c5210
train
// addNetworkDevice adds an entry to the VirtualMachineConfigSpec's // DeviceChange list, to create a NIC device connecting the machine // to the specified network.
{ "resource": "" }
c5211
train
// VerifyMAC verifies that the MAC is valid for VMWare.
{ "resource": "" }
c5212
train
// computeResourceNetworks returns the networks available to the compute // resource, and the config info for the distributed virtual portgroup // networks. Networks are returned with the distributed virtual portgroups // first, then standard switch networks, and then finally opaque networks.
{ "resource": "" }
c5213
train
// Init captures machineId's to show from CL args.
{ "resource": "" }
c5214
train
// DiscoverService returns an interface to a service appropriate // for the current system
{ "resource": "" }
c5215
train
// VersionInitSystem returns an init system name based on the provided // series. If one cannot be identified a NotFound error is returned.
{ "resource": "" }
c5216
train
// DiscoverInitSystemScript returns the shell script to use when // discovering the local init system. The script is quite specific to // bash, so it includes an explicit bash shbang.
{ "resource": "" }
c5217
train
// newShellSelectCommand creates a bash case statement with clause for // each of the linux init systems. The body of each clause comes from // calling the provided handler with the init system name. If the // handler does not support the args then it returns a false "ok" value.
{ "resource": "" }
c5218
train
// ContainerManagerConfig mocks base method
{ "resource": "" }
c5219
train
// HostChangesForContainer indicates an expected call of HostChangesForContainer
{ "resource": "" }
c5220
train
// Machines mocks base method
{ "resource": "" }
c5221
train
// ResolveFilename returns the filename used by the command.
{ "resource": "" }
c5222
train
// UnknownOrigin returns a new backups origin with unknown values.
{ "resource": "" }
c5223
train
// NewMetadata returns a new Metadata for a state backup archive. Only // the start time and the version are set.
{ "resource": "" }
c5224
train
// NewMetadataState composes a new backup metadata with its origin // values set. The model UUID comes from state. The hostname is // retrieved from the OS.
{ "resource": "" }
c5225
train
// MarkComplete populates the remaining metadata values. The default // checksum format is used.
{ "resource": "" }
c5226
train
// NewMetadataJSONReader extracts a new metadata from the JSON file.
{ "resource": "" }
c5227
train
// BuildMetadata generates the metadata for a backup archive file.
{ "resource": "" }
c5228
train
// ControllerInfo implements ExternalController.
{ "resource": "" }
c5229
train
// Add creates or updates an external controller record.
{ "resource": "" }
c5230
train
// Remove removes an external controller record with the given controller UUID.
{ "resource": "" }
c5231
train
// Controller retrieves an ExternalController with a given controller UUID.
{ "resource": "" }
c5232
train
// ControllerForModel retrieves an ExternalController with a given model UUID.
{ "resource": "" }
c5233
train
// WatchController returns a notify watcher that watches for changes to the // external controller with the specified controller UUID.
{ "resource": "" }
c5234
train
// NewMacaroonCache returns a cache containing macaroons which are removed // after the macaroons' expiry time.
{ "resource": "" }
c5235
train
// Upsert inserts or updates a macaroon slice in the cache.
{ "resource": "" }
c5236
train
// Get returns a macaroon slice from the cache, and a bool indicating // if the slice for the key was found.
{ "resource": "" }
c5237
train
// NewImageMetadataAPI returns a image metadata api for the root api endpoint // that the environment command returns.
{ "resource": "" }
c5238
train
// NewMockFacade creates a new mock instance
{ "resource": "" }
c5239
train
// FinishUpgradeSeries indicates an expected call of FinishUpgradeSeries
{ "resource": "" }
c5240
train
// MachineStatus mocks base method
{ "resource": "" }
c5241
train
// SetMachineStatus mocks base method
{ "resource": "" }
c5242
train
// StartUnitCompletion mocks base method
{ "resource": "" }
c5243
train
// TargetSeries mocks base method
{ "resource": "" }
c5244
train
// UnitsCompleted mocks base method
{ "resource": "" }
c5245
train
// UnpinMachineApplications indicates an expected call of UnpinMachineApplications
{ "resource": "" }
c5246
train
// Infof mocks base method
{ "resource": "" }
c5247
train
// Infof indicates an expected call of Infof
{ "resource": "" }
c5248
train
// NewMockAgentService creates a new mock instance
{ "resource": "" }
c5249
train
// Running mocks base method
{ "resource": "" }
c5250
train
// Running indicates an expected call of Running
{ "resource": "" }
c5251
train
// NewMockServiceAccess creates a new mock instance
{ "resource": "" }
c5252
train
// DiscoverService mocks base method
{ "resource": "" }
c5253
train
// DiscoverService indicates an expected call of DiscoverService
{ "resource": "" }
c5254
train
// ListServices mocks base method
{ "resource": "" }
c5255
train
// ListServices indicates an expected call of ListServices
{ "resource": "" }
c5256
train
// NewMockUpgrader creates a new mock instance
{ "resource": "" }
c5257
train
// PerformUpgrade mocks base method
{ "resource": "" }
c5258
train
// PerformUpgrade indicates an expected call of PerformUpgrade
{ "resource": "" }
c5259
train
// get retrieves the resource info and data from the cache. If only // the info is found then the returned reader will be nil. If no cache // is in use then errors.NotFound is returned.
{ "resource": "" }
c5260
train
// set stores the resource info and data in the cache, // if there is one. If no cache is in use then this is a no-op. Note // that the returned reader may or may not be the same one that was // passed in.
{ "resource": "" }
c5261
train
// Archive writes the executable files found in the given directory in // gzipped tar format to w.
{ "resource": "" }
c5262
train
// archiveAndSHA256 calls Archive with the provided arguments, // and returns a hex-encoded SHA256 hash of the resulting // archive.
{ "resource": "" }
c5263
train
// copyFile writes the contents of the given file to w.
{ "resource": "" }
c5264
train
// tarHeader returns a tar file header given the file's stat // information.
{ "resource": "" }
c5265
train
// closeErrorCheck means that we can ensure that // Close errors do not get lost even when we defer them,
{ "resource": "" }
c5266
train
// ExistingJujudLocation returns the directory to // a jujud executable in the path.
{ "resource": "" }
c5267
train
// bundleTools bundles all the current juju tools in gzipped tar // format to the given writer. If forceVersion is not nil and the // file isn't an official build, a FORCE-VERSION file is included in // the tools bundle so it will lie about its current version number.
{ "resource": "" }
c5268
train
// JujudVersion returns the Jujud version at the specified location, // and whether it is an official binary.
{ "resource": "" }
c5269
train
// AgentConf returns the data that defines an init service config // for the identified agent.
{ "resource": "" }
c5270
train
// ShutdownAfterConf builds a service conf that will cause the host to // shut down after the named service stops.
{ "resource": "" }
c5271
train
// instInfo returns the instance info for the given id // and instance. If inst is nil, it returns a not-found error.
{ "resource": "" }
c5272
train
// Reset implements PeriodicTimer.
{ "resource": "" }
c5273
train
// InitiateMongoServer checks for an existing mongo configuration. // If no existing configuration is found one is created using Initiate.
{ "resource": "" }
c5274
train
// attemptInitiateMongoServer attempts to initiate the replica set.
{ "resource": "" }
c5275
train
// resetReplicaSet re-initiates replica-set using the new controller // values, this is required after a mongo restore. // In case of failure returns error.
{ "resource": "" }
c5276
train
// tagUserCredentials is a convenience function that extracts the // tag user and apipassword, required to access mongodb.
{ "resource": "" }
c5277
train
// newDialInfo returns mgo.DialInfo with the given address using the minimal // possible setup.
{ "resource": "" }
c5278
train
// updateMachineAddresses will update the machine doc to the current addresses
{ "resource": "" }
c5279
train
// connectToDB tries to connect to the newly restored controller.
{ "resource": "" }
c5280
train
// updateAllMachines finds all machines and resets the stored state address // in each of them. The address does not include the port. // It is too late to go back and errors in a couple of agents have // better chance of being fixed by the user, if we were to fail // we risk an inconsistent controller because of one u...
{ "resource": "" }
c5281
train
// setAgentAddressScript generates an ssh script argument to update state addresses.
{ "resource": "" }
c5282
train
// runMachineUpdate connects via ssh to the machine and runs the update script.
{ "resource": "" }
c5283
train
// runViaSSH runs script in the remote machine with address addr.
{ "resource": "" }
c5284
train
// ParsePlacement attempts to parse the specified string and create a // corresponding Placement structure. // // If the placement directive is non-empty and missing a scope, // ErrPlacementScopeMissing will be returned as well as a Placement // with an empty Scope field.
{ "resource": "" }
c5285
train
// MustParsePlacement attempts to parse the specified string and create // a corresponding Placement structure, panicking if an error occurs.
{ "resource": "" }
c5286
train
// SetMinUnits changes the number of minimum units required by the application.
{ "resource": "" }
c5287
train
// doesMinUnitsExits checks if the minUnits doc exists in the database.
{ "resource": "" }
c5288
train
// minUnitsRemoveOp returns the operation required to remove the minimum // units document from MongoDB.
{ "resource": "" }
c5289
train
// EnsureMinUnits adds new units if the application's MinUnits value is greater // than the number of alive units.
{ "resource": "" }
c5290
train
// aliveUnitsCount returns the number a alive units for the application.
{ "resource": "" }
c5291
train
// ensureMinUnitsOps returns the operations required to add a unit for the // application in MongoDB and the name for the new unit. The resulting transaction // will be aborted if the application document changes when running the operations.
{ "resource": "" }
c5292
train
// AutoConfigureContainerNetworking tries to set up best container networking available // for the specific model if user hasn't set anything.
{ "resource": "" }
c5293
train
// NewFacade returns a singular-controller API facade, backed by the supplied // state, so long as the authorizer represents a controller machine.
{ "resource": "" }
c5294
train
// addPackageSourceCmds is a helper function that returns the corresponding // runcmds to apply the package source settings on a CentOS machine.
{ "resource": "" }
c5295
train
// removeStringFromSlice is a helper function which removes a given string from // the given slice, if it exists it returns the slice, be it modified or unmodified
{ "resource": "" }
c5296
train
// machineName returns the InstanceId, unless DisplayName is set.
{ "resource": "" }
c5297
train
// NewDestroyCommand returns a command used to destroy a model.
{ "resource": "" }
c5298
train
// DestroyContainer implements container.Manager.
{ "resource": "" }
c5299
train
// CreateContainer implements container.Manager.
{ "resource": "" }