_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c156000
train
// ReadCharmFromStorage fetches the charm at the specified path from the store // and copies it to a temp directory in dataDir.
{ "resource": "" }
c156001
train
// On windows we cannot remove a file until it has been closed // If this poses an active problem somewhere else it will be refactored in // utils and used everywhere.
{ "resource": "" }
c156002
train
// CharmArchiveEntry retrieves the specified entry from the zip archive.
{ "resource": "" }
c156003
train
// Manifold returns a manifold whose worker wraps an API connection // made as configured.
{ "resource": "" }
c156004
train
// startFunc returns a StartFunc that creates a connection based on the // supplied manifold config and wraps it in a worker.
{ "resource": "" }
c156005
train
// NewFacade wraps NewMetricsManagerAPI for API registration.
{ "resource": "" }
c156006
train
// NewMetricsManagerAPI creates a new API endpoint for calling metrics manager functions.
{ "resource": "" }
c156007
train
// CleanupOldMetrics removes old metrics from the collection. // The single arg params is expected to contain and model uuid. // Even though the call will delete all metrics across models // it serves to validate that the connection has access to at least one model.
{ "resource": "" }
c156008
train
// AddJujuMachineMetrics adds a metric that counts the number of // non-container machines in the current model.
{ "resource": "" }
c156009
train
// SendMetrics will send any unsent metrics onto the metric collection service.
{ "resource": "" }
c156010
train
// NewFacade creates a new LogForwardingAPI. It is used for API registration.
{ "resource": "" }
c156011
train
// NewLogForwardingAPI creates a new server-side logger API end point.
{ "resource": "" }
c156012
train
// GetLastSent is a bulk call that gets the log forwarding "last sent" // record ID for each requested target.
{ "resource": "" }
c156013
train
// SetLastSent is a bulk call that sets the log forwarding "last sent" // record ID for each requested target.
{ "resource": "" }
c156014
train
// NewLastSentTracker implements LogForwardingState.
{ "resource": "" }
c156015
train
// NewMockInstanceMutaterAPI creates a new mock instance
{ "resource": "" }
c156016
train
// WatchMachines indicates an expected call of WatchMachines
{ "resource": "" }
c156017
train
// NewUnitFacadeClient creates a new API client for the resources // portion of the uniter facade.
{ "resource": "" }
c156018
train
// Do implements httprequest.Doer.
{ "resource": "" }
c156019
train
// ReportKeys reports the public SSH host keys for a machine to the // controller. The keys should be in the same format as the sshd host // key files, one entry per key.
{ "resource": "" }
c156020
train
// NewModelConfigAPI creates a new instance of the ModelConfig Facade.
{ "resource": "" }
c156021
train
// ModelGet implements the server-side part of the // model-config CLI command.
{ "resource": "" }
c156022
train
// ModelSet implements the server-side part of the // set-model-config CLI command.
{ "resource": "" }
c156023
train
// ModelUnset implements the server-side part of the // set-model-config CLI command.
{ "resource": "" }
c156024
train
// SetSLALevel sets the sla level on the model.
{ "resource": "" }
c156025
train
// SLALevel returns the current sla level for the model.
{ "resource": "" }
c156026
train
// Sequences returns the model's sequence names and next values.
{ "resource": "" }
c156027
train
// NewMockWorker creates a new mock instance
{ "resource": "" }
c156028
train
// IsValidFieldName returns true if the given name is acceptable for // use as a MongoDB field name.
{ "resource": "" }
c156029
train
// CheckStorable returns an error if the given document - or any of // it's subdocuments - contains field names which are not valid for // storage into MongoDB.
{ "resource": "" }
c156030
train
// Init validates the action ID and any other options.
{ "resource": "" }
c156031
train
// Run issues the API call to get Actions by ID.
{ "resource": "" }
c156032
train
// GetActionResult tries to repeatedly fetch an action until it is // in a completed state and then it returns it. // It waits for a maximum of "wait" before returning with the latest action status.
{ "resource": "" }
c156033
train
// timerLoop loops indefinitely to query the given API, until "wait" times // out, using the "tick" timer to delay the API queries. It writes the // result to the given output.
{ "resource": "" }
c156034
train
// fetchResult queries the given API for the given Action ID prefix, and // makes sure the results are acceptable, returning an error if they are not.
{ "resource": "" }
c156035
train
// ToWire converts the state.MetricBatch into a type // that can be sent over the wire to the collector.
{ "resource": "" }
c156036
train
// Manifold packages a Worker for use in a dependency.Engine.
{ "resource": "" }
c156037
train
// Leases is part of the lease.Store interface.
{ "resource": "" }
c156038
train
// ClaimLease is part of the lease.Store interface.
{ "resource": "" }
c156039
train
// ExtendLease is part of the lease.Store interface.
{ "resource": "" }
c156040
train
// request implements ClaimLease and ExtendLease.
{ "resource": "" }
c156041
train
// ExpireLease is part of the Store interface.
{ "resource": "" }
c156042
train
// PinLease is part of the Store interface.
{ "resource": "" }
c156043
train
// Refresh is part of the Store interface.
{ "resource": "" }
c156044
train
// readEntries reads all lease data for the store's namespace.
{ "resource": "" }
c156045
train
// ClaimLeaseOps returns txn.Ops to write a new lease. The txn.Ops // will fail if the lease document exists, regardless of whether it // has expired.
{ "resource": "" }
c156046
train
// LookupLease returns a lease claim if it exists. // If it doesn't exist, expect to get an mgo.NotFoundError, otherwise expect to get
{ "resource": "" }
c156047
train
// leaseDocId returns the id of the named lease document in the store's // namespace.
{ "resource": "" }
c156048
train
// getAPI returns the API. This allows passing in a test CommitCommandAPI // implementation.
{ "resource": "" }
c156049
train
// SetPassword sets the unit's password.
{ "resource": "" }
c156050
train
// Id implements instances.Instance
{ "resource": "" }
c156051
train
// Status implements instances.Instance
{ "resource": "" }
c156052
train
// Addresses implements instances.Instance
{ "resource": "" }
c156053
train
// Save creates a new record the a Docker resource.
{ "resource": "" }
c156054
train
// Remove removes the Docker resource with the provided ID.
{ "resource": "" }
c156055
train
// Get retrieves the requested stored Docker resource.
{ "resource": "" }
c156056
train
// BlockDevicePath returns the path to a block device, or an error if a path // cannot be determined. The path is based on the hardware ID, if available; // the first value in device.DeviceLinks, if non-empty; otherwise the device // name.
{ "resource": "" }
c156057
train
// Units returns the tags for all units in the application.
{ "resource": "" }
c156058
train
// parseJSONAuthFile parses a file, and extracts the OAuth2 credentials within.
{ "resource": "" }
c156059
train
// UnitChainPredicateFn builds a function which runs the given // predicate over a unit and all of its subordinates. If one unit in // the chain matches, the entire chain matches.
{ "resource": "" }
c156060
train
// BuildPredicate returns a Predicate which will evaluate a machine, // service, or unit against the given patterns.
{ "resource": "" }
c156061
train
// buildApplicationMatcherShims adds matchers for application name, application units and // whether the application is exposed.
{ "resource": "" }
c156062
train
// matchUnit attempts to match a state.Unit to one of // a set of patterns, taking into account subordinate // relationships.
{ "resource": "" }
c156063
train
// matchString matches a string to one of the patterns in // the unit matcher, returning an error if a pattern with // invalid syntax is encountered.
{ "resource": "" }
c156064
train
// NewClientFacade prepares a client-facing facade for work against the API. // It is expected that most client-facing facades will embed a ClientFacade and // will use a FacadeCaller so this function returns both.
{ "resource": "" }
c156065
train
// NewImageManagerAPI creates a new server-side imagemanager API end point.
{ "resource": "" }
c156066
train
// ListImages returns images matching the specified filter.
{ "resource": "" }
c156067
train
// DeleteImages deletes the images matching the specified filter.
{ "resource": "" }
c156068
train
// QueryVerify writes a question to w and waits for an answer to be read from // scanner. It will pass the answer into the verify function. Verify, if // non-nil, should check the answer for validity, returning an error that will // be written out to errOut, or nil if answer is valid. // // This function takes a scan...
{ "resource": "" }
c156069
train
// MatchOptions returns a function that performs a case insensitive comparison // against the given list of options. To make a verification function that // accepts an empty default, include an empty string in the list.
{ "resource": "" }
c156070
train
// FindMatch does a case-insensitive search of the given options and returns the // matching option. Found reports whether s was found in the options.
{ "resource": "" }
c156071
train
// NewMockBranchCommandAPI creates a new mock instance
{ "resource": "" }
c156072
train
// RestoreReader restores the contents of backupFile as backup.
{ "resource": "" }
c156073
train
// Restore performs restore using a backup id corresponding to a backup stored in the server.
{ "resource": "" }
c156074
train
// finishRestore since Restore call will end up with a reset // controller, finish restore will check that the the newly // placed controller has the mark of restore complete. // upstart should have restarted the api server so we reconnect.
{ "resource": "" }
c156075
train
// NewUserdataConfig is supposed to take in an instanceConfig as well as a // cloudinit.cloudConfig and add attributes in the cloudinit structure based on // the values inside instanceConfig and on the series
{ "resource": "" }
c156076
train
// addAgentInfo adds agent-required information to the agent's directory // and returns the agent directory name.
{ "resource": "" }
c156077
train
// SetUbuntuUser creates an "ubuntu" use for unix systems so the juju client // can access the machine using ssh with the configuration we expect. // On precise, the default cloudinit version is too old to support the users // option, so instead rely on the default user being created and adding keys. // It may make sen...
{ "resource": "" }
c156078
train
// GetActionsByName takes an action APIClient and a name and returns a list of // ActionResults.
{ "resource": "" }
c156079
train
// This is a very rudimentary method used to extract common Juju // arguments from the full list passed to the plugin.
{ "resource": "" }
c156080
train
// findPlugins searches the current PATH for executable files that match // JujuPluginPattern.
{ "resource": "" }
c156081
train
// ModelManifold returns a Manifold that encapsulates the instancemutater worker.
{ "resource": "" }
c156082
train
// MachineManifold returns a Manifold that encapsulates the instancemutater worker.
{ "resource": "" }
c156083
train
// Authenticate authenticates the provided entity. // It takes an entityfinder and the tag used to find the entity that requires authentication.
{ "resource": "" }
c156084
train
// manifoldStart creates a runner for the metrics workers, given a base.APICaller.
{ "resource": "" }
c156085
train
// newContainer is where the new physical instance is actually // provisioned, relative to the provided args and spec. Info for that // low-level instance is returned.
{ "resource": "" }
c156086
train
// getContainerSpec builds a container spec from the input container image and // start-up parameters. // Cloud-init config is generated based on the network devices in the default // profile and included in the spec config.
{ "resource": "" }
c156087
train
// getTargetServer checks to see if a valid zone was passed as a placement // directive in the start-up start-up arguments. If so, a server for the // specific node is returned.
{ "resource": "" }
c156088
train
// Manifold returns a status manifold.
{ "resource": "" }
c156089
train
// Validate checks the service's values for correctness.
{ "resource": "" }
c156090
train
// Bootstrap bootstraps the raft cluster, using the given configuration. // // This is only to be called once, at the beginning of the raft cluster's // lifetime, by the bootstrap machine agent.
{ "resource": "" }
c156091
train
// Raft returns the raft.Raft managed by this worker, or // an error if the worker has stopped.
{ "resource": "" }
c156092
train
// LogStore returns the raft.LogStore managed by this worker, or // an error if the worker has stopped.
{ "resource": "" }
c156093
train
// NewRaftConfig makes a raft config struct from the worker config // struct passed in.
{ "resource": "" }
c156094
train
// NewLogStore opens a boltDB logstore in the specified directory. If // the directory doesn't already exist it'll be created.
{ "resource": "" }
c156095
train
// NewSnapshotStore opens a file-based snapshot store in the specified // directory. If the directory doesn't exist it'll be created.
{ "resource": "" }
c156096
train
// WriteUserData generates the cloud-init user-data using the // specified machine and network config for a container, and writes // the serialized form out to a cloud-init file in the directory // specified.
{ "resource": "" }
c156097
train
// WriteCloudInitFile writes the data out to a cloud-init file in the // directory specified, and returns the filename.
{ "resource": "" }
c156098
train
// splitUserHost given a host string of example user@192.168.122.122 // it will return user and 192.168.122.122
{ "resource": "" }
c156099
train
// NewManifestDeployer returns a Deployer that installs bundles from the // supplied BundleReader into charmPath, and which reads and writes its // persistent data into dataPath. // // It works by always writing the full contents of a deployed charm; and, if // another charm was previously deployed, deleting only those...
{ "resource": "" }