id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
154,200 | juju/juju | apiserver/facades/client/application/application.go | CharmConfig | func (api *APIv8) CharmConfig(args params.Entities) (params.ApplicationGetConfigResults, error) {
return api.GetConfig(args)
} | go | func (api *APIv8) CharmConfig(args params.Entities) (params.ApplicationGetConfigResults, error) {
return api.GetConfig(args)
} | [
"func",
"(",
"api",
"*",
"APIv8",
")",
"CharmConfig",
"(",
"args",
"params",
".",
"Entities",
")",
"(",
"params",
".",
"ApplicationGetConfigResults",
",",
"error",
")",
"{",
"return",
"api",
".",
"GetConfig",
"(",
"args",
")",
"\n",
"}"
] | // CharmConfig is a shim to GetConfig on APIv5. It returns only charm config.
// Version 8 and below accept params.Entities, where later versions must accept
// a model generation | [
"CharmConfig",
"is",
"a",
"shim",
"to",
"GetConfig",
"on",
"APIv5",
".",
"It",
"returns",
"only",
"charm",
"config",
".",
"Version",
"8",
"and",
"below",
"accept",
"params",
".",
"Entities",
"where",
"later",
"versions",
"must",
"accept",
"a",
"model",
"ge... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/client/application/application.go#L2032-L2034 |
154,201 | juju/juju | apiserver/facades/client/application/application.go | CharmConfig | func (api *APIBase) CharmConfig(args params.ApplicationGetArgs) (params.ApplicationGetConfigResults, error) {
if err := api.checkCanRead(); err != nil {
return params.ApplicationGetConfigResults{}, err
}
results := params.ApplicationGetConfigResults{
Results: make([]params.ConfigResult, len(args.Args)),
}
for ... | go | func (api *APIBase) CharmConfig(args params.ApplicationGetArgs) (params.ApplicationGetConfigResults, error) {
if err := api.checkCanRead(); err != nil {
return params.ApplicationGetConfigResults{}, err
}
results := params.ApplicationGetConfigResults{
Results: make([]params.ConfigResult, len(args.Args)),
}
for ... | [
"func",
"(",
"api",
"*",
"APIBase",
")",
"CharmConfig",
"(",
"args",
"params",
".",
"ApplicationGetArgs",
")",
"(",
"params",
".",
"ApplicationGetConfigResults",
",",
"error",
")",
"{",
"if",
"err",
":=",
"api",
".",
"checkCanRead",
"(",
")",
";",
"err",
... | // CharmConfig returns charm config for the input list of applications and
// model generations. | [
"CharmConfig",
"returns",
"charm",
"config",
"for",
"the",
"input",
"list",
"of",
"applications",
"and",
"model",
"generations",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/client/application/application.go#L2038-L2051 |
154,202 | juju/juju | apiserver/facades/client/application/application.go | GetConfig | func (api *APIBase) GetConfig(args params.Entities) (params.ApplicationGetConfigResults, error) {
if err := api.checkCanRead(); err != nil {
return params.ApplicationGetConfigResults{}, err
}
results := params.ApplicationGetConfigResults{
Results: make([]params.ConfigResult, len(args.Entities)),
}
for i, arg :... | go | func (api *APIBase) GetConfig(args params.Entities) (params.ApplicationGetConfigResults, error) {
if err := api.checkCanRead(); err != nil {
return params.ApplicationGetConfigResults{}, err
}
results := params.ApplicationGetConfigResults{
Results: make([]params.ConfigResult, len(args.Entities)),
}
for i, arg :... | [
"func",
"(",
"api",
"*",
"APIBase",
")",
"GetConfig",
"(",
"args",
"params",
".",
"Entities",
")",
"(",
"params",
".",
"ApplicationGetConfigResults",
",",
"error",
")",
"{",
"if",
"err",
":=",
"api",
".",
"checkCanRead",
"(",
")",
";",
"err",
"!=",
"ni... | // GetConfig returns the charm config for each of the input applications. | [
"GetConfig",
"returns",
"the",
"charm",
"config",
"for",
"each",
"of",
"the",
"input",
"applications",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/client/application/application.go#L2054-L2079 |
154,203 | juju/juju | apiserver/facades/client/application/application.go | SetApplicationsConfig | func (api *APIBase) SetApplicationsConfig(args params.ApplicationConfigSetArgs) (params.ErrorResults, error) {
var result params.ErrorResults
if err := api.checkCanWrite(); err != nil {
return result, errors.Trace(err)
}
if err := api.check.ChangeAllowed(); err != nil {
return result, errors.Trace(err)
}
resu... | go | func (api *APIBase) SetApplicationsConfig(args params.ApplicationConfigSetArgs) (params.ErrorResults, error) {
var result params.ErrorResults
if err := api.checkCanWrite(); err != nil {
return result, errors.Trace(err)
}
if err := api.check.ChangeAllowed(); err != nil {
return result, errors.Trace(err)
}
resu... | [
"func",
"(",
"api",
"*",
"APIBase",
")",
"SetApplicationsConfig",
"(",
"args",
"params",
".",
"ApplicationConfigSetArgs",
")",
"(",
"params",
".",
"ErrorResults",
",",
"error",
")",
"{",
"var",
"result",
"params",
".",
"ErrorResults",
"\n",
"if",
"err",
":="... | // SetApplicationsConfig implements the server side of Application.SetApplicationsConfig.
// It does not unset values that are set to an empty string.
// Unset should be used for that. | [
"SetApplicationsConfig",
"implements",
"the",
"server",
"side",
"of",
"Application",
".",
"SetApplicationsConfig",
".",
"It",
"does",
"not",
"unset",
"values",
"that",
"are",
"set",
"to",
"an",
"empty",
"string",
".",
"Unset",
"should",
"be",
"used",
"for",
"t... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/client/application/application.go#L2103-L2117 |
154,204 | juju/juju | apiserver/facades/client/application/application.go | ResolveUnitErrors | func (api *APIBase) ResolveUnitErrors(p params.UnitsResolved) (params.ErrorResults, error) {
if p.All {
unitsWithErrors, err := api.backend.UnitsInError()
if err != nil {
return params.ErrorResults{}, errors.Trace(err)
}
for _, u := range unitsWithErrors {
if err := u.Resolve(p.Retry); err != nil {
r... | go | func (api *APIBase) ResolveUnitErrors(p params.UnitsResolved) (params.ErrorResults, error) {
if p.All {
unitsWithErrors, err := api.backend.UnitsInError()
if err != nil {
return params.ErrorResults{}, errors.Trace(err)
}
for _, u := range unitsWithErrors {
if err := u.Resolve(p.Retry); err != nil {
r... | [
"func",
"(",
"api",
"*",
"APIBase",
")",
"ResolveUnitErrors",
"(",
"p",
"params",
".",
"UnitsResolved",
")",
"(",
"params",
".",
"ErrorResults",
",",
"error",
")",
"{",
"if",
"p",
".",
"All",
"{",
"unitsWithErrors",
",",
"err",
":=",
"api",
".",
"backe... | // ResolveUnitErrors marks errors on the specified units as resolved. | [
"ResolveUnitErrors",
"marks",
"errors",
"on",
"the",
"specified",
"units",
"as",
"resolved",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/client/application/application.go#L2235-L2272 |
154,205 | juju/juju | apiserver/facades/client/application/application.go | ApplicationsInfo | func (api *APIBase) ApplicationsInfo(in params.Entities) (params.ApplicationInfoResults, error) {
out := make([]params.ApplicationInfoResult, len(in.Entities))
for i, one := range in.Entities {
tag, err := names.ParseApplicationTag(one.Tag)
if err != nil {
out[i].Error = common.ServerError(err)
continue
}... | go | func (api *APIBase) ApplicationsInfo(in params.Entities) (params.ApplicationInfoResults, error) {
out := make([]params.ApplicationInfoResult, len(in.Entities))
for i, one := range in.Entities {
tag, err := names.ParseApplicationTag(one.Tag)
if err != nil {
out[i].Error = common.ServerError(err)
continue
}... | [
"func",
"(",
"api",
"*",
"APIBase",
")",
"ApplicationsInfo",
"(",
"in",
"params",
".",
"Entities",
")",
"(",
"params",
".",
"ApplicationInfoResults",
",",
"error",
")",
"{",
"out",
":=",
"make",
"(",
"[",
"]",
"params",
".",
"ApplicationInfoResult",
",",
... | // ApplicationsInfo returns applications information. | [
"ApplicationsInfo",
"returns",
"applications",
"information",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/client/application/application.go#L2278-L2317 |
154,206 | juju/juju | worker/actionpruner/worker.go | New | func New(conf pruner.Config) (worker.Worker, error) {
if err := conf.Validate(); err != nil {
return nil, errors.Trace(err)
}
w := &Worker{
pruner.New(conf),
}
err := catacomb.Invoke(catacomb.Plan{
Site: w.Catacomb(),
Work: w.loop,
})
return w, errors.Trace(err)
} | go | func New(conf pruner.Config) (worker.Worker, error) {
if err := conf.Validate(); err != nil {
return nil, errors.Trace(err)
}
w := &Worker{
pruner.New(conf),
}
err := catacomb.Invoke(catacomb.Plan{
Site: w.Catacomb(),
Work: w.loop,
})
return w, errors.Trace(err)
} | [
"func",
"New",
"(",
"conf",
"pruner",
".",
"Config",
")",
"(",
"worker",
".",
"Worker",
",",
"error",
")",
"{",
"if",
"err",
":=",
"conf",
".",
"Validate",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"Trace",
"(",... | // New creates a new action pruner worker | [
"New",
"creates",
"a",
"new",
"action",
"pruner",
"worker"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/worker/actionpruner/worker.go#L35-L50 |
154,207 | juju/juju | apiserver/facades/agent/storageprovisioner/storageprovisioner.go | WatchBlockDevices | func (s *StorageProvisionerAPIv3) WatchBlockDevices(args params.Entities) (params.NotifyWatchResults, error) {
canAccess, err := s.getBlockDevicesAuthFunc()
if err != nil {
return params.NotifyWatchResults{}, common.ServerError(common.ErrPerm)
}
results := params.NotifyWatchResults{
Results: make([]params.Notif... | go | func (s *StorageProvisionerAPIv3) WatchBlockDevices(args params.Entities) (params.NotifyWatchResults, error) {
canAccess, err := s.getBlockDevicesAuthFunc()
if err != nil {
return params.NotifyWatchResults{}, common.ServerError(common.ErrPerm)
}
results := params.NotifyWatchResults{
Results: make([]params.Notif... | [
"func",
"(",
"s",
"*",
"StorageProvisionerAPIv3",
")",
"WatchBlockDevices",
"(",
"args",
"params",
".",
"Entities",
")",
"(",
"params",
".",
"NotifyWatchResults",
",",
"error",
")",
"{",
"canAccess",
",",
"err",
":=",
"s",
".",
"getBlockDevicesAuthFunc",
"(",
... | // WatchBlockDevices watches for changes to the specified machines' block devices. | [
"WatchBlockDevices",
"watches",
"for",
"changes",
"to",
"the",
"specified",
"machines",
"block",
"devices",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/agent/storageprovisioner/storageprovisioner.go#L242-L275 |
154,208 | juju/juju | apiserver/facades/agent/storageprovisioner/storageprovisioner.go | WatchVolumes | func (s *StorageProvisionerAPIv3) WatchVolumes(args params.Entities) (params.StringsWatchResults, error) {
return s.watchStorageEntities(args, s.sb.WatchModelVolumes, s.sb.WatchMachineVolumes, nil)
} | go | func (s *StorageProvisionerAPIv3) WatchVolumes(args params.Entities) (params.StringsWatchResults, error) {
return s.watchStorageEntities(args, s.sb.WatchModelVolumes, s.sb.WatchMachineVolumes, nil)
} | [
"func",
"(",
"s",
"*",
"StorageProvisionerAPIv3",
")",
"WatchVolumes",
"(",
"args",
"params",
".",
"Entities",
")",
"(",
"params",
".",
"StringsWatchResults",
",",
"error",
")",
"{",
"return",
"s",
".",
"watchStorageEntities",
"(",
"args",
",",
"s",
".",
"... | // WatchVolumes watches for changes to volumes scoped to the
// entity with the tag passed to NewState. | [
"WatchVolumes",
"watches",
"for",
"changes",
"to",
"volumes",
"scoped",
"to",
"the",
"entity",
"with",
"the",
"tag",
"passed",
"to",
"NewState",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/agent/storageprovisioner/storageprovisioner.go#L318-L320 |
154,209 | juju/juju | apiserver/facades/agent/storageprovisioner/storageprovisioner.go | WatchFilesystems | func (s *StorageProvisionerAPIv3) WatchFilesystems(args params.Entities) (params.StringsWatchResults, error) {
w := filesystemwatcher.Watchers{s.sb}
return s.watchStorageEntities(args,
w.WatchModelManagedFilesystems,
w.WatchMachineManagedFilesystems,
w.WatchUnitManagedFilesystems)
} | go | func (s *StorageProvisionerAPIv3) WatchFilesystems(args params.Entities) (params.StringsWatchResults, error) {
w := filesystemwatcher.Watchers{s.sb}
return s.watchStorageEntities(args,
w.WatchModelManagedFilesystems,
w.WatchMachineManagedFilesystems,
w.WatchUnitManagedFilesystems)
} | [
"func",
"(",
"s",
"*",
"StorageProvisionerAPIv3",
")",
"WatchFilesystems",
"(",
"args",
"params",
".",
"Entities",
")",
"(",
"params",
".",
"StringsWatchResults",
",",
"error",
")",
"{",
"w",
":=",
"filesystemwatcher",
".",
"Watchers",
"{",
"s",
".",
"sb",
... | // WatchFilesystems watches for changes to filesystems scoped
// to the entity with the tag passed to NewState. | [
"WatchFilesystems",
"watches",
"for",
"changes",
"to",
"filesystems",
"scoped",
"to",
"the",
"entity",
"with",
"the",
"tag",
"passed",
"to",
"NewState",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/agent/storageprovisioner/storageprovisioner.go#L324-L330 |
154,210 | juju/juju | apiserver/facades/agent/storageprovisioner/storageprovisioner.go | WatchVolumeAttachments | func (s *StorageProvisionerAPIv3) WatchVolumeAttachments(args params.Entities) (params.MachineStorageIdsWatchResults, error) {
return s.watchAttachments(
args,
s.sb.WatchModelVolumeAttachments,
s.sb.WatchMachineVolumeAttachments,
s.sb.WatchUnitVolumeAttachments,
storagecommon.ParseVolumeAttachmentIds,
)
} | go | func (s *StorageProvisionerAPIv3) WatchVolumeAttachments(args params.Entities) (params.MachineStorageIdsWatchResults, error) {
return s.watchAttachments(
args,
s.sb.WatchModelVolumeAttachments,
s.sb.WatchMachineVolumeAttachments,
s.sb.WatchUnitVolumeAttachments,
storagecommon.ParseVolumeAttachmentIds,
)
} | [
"func",
"(",
"s",
"*",
"StorageProvisionerAPIv3",
")",
"WatchVolumeAttachments",
"(",
"args",
"params",
".",
"Entities",
")",
"(",
"params",
".",
"MachineStorageIdsWatchResults",
",",
"error",
")",
"{",
"return",
"s",
".",
"watchAttachments",
"(",
"args",
",",
... | // WatchVolumeAttachments watches for changes to volume attachments scoped to
// the entity with the tag passed to NewState. | [
"WatchVolumeAttachments",
"watches",
"for",
"changes",
"to",
"volume",
"attachments",
"scoped",
"to",
"the",
"entity",
"with",
"the",
"tag",
"passed",
"to",
"NewState",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/agent/storageprovisioner/storageprovisioner.go#L383-L391 |
154,211 | juju/juju | apiserver/facades/agent/storageprovisioner/storageprovisioner.go | WatchFilesystemAttachments | func (s *StorageProvisionerAPIv3) WatchFilesystemAttachments(args params.Entities) (params.MachineStorageIdsWatchResults, error) {
w := filesystemwatcher.Watchers{s.sb}
return s.watchAttachments(
args,
w.WatchModelManagedFilesystemAttachments,
w.WatchMachineManagedFilesystemAttachments,
w.WatchUnitManagedFile... | go | func (s *StorageProvisionerAPIv3) WatchFilesystemAttachments(args params.Entities) (params.MachineStorageIdsWatchResults, error) {
w := filesystemwatcher.Watchers{s.sb}
return s.watchAttachments(
args,
w.WatchModelManagedFilesystemAttachments,
w.WatchMachineManagedFilesystemAttachments,
w.WatchUnitManagedFile... | [
"func",
"(",
"s",
"*",
"StorageProvisionerAPIv3",
")",
"WatchFilesystemAttachments",
"(",
"args",
"params",
".",
"Entities",
")",
"(",
"params",
".",
"MachineStorageIdsWatchResults",
",",
"error",
")",
"{",
"w",
":=",
"filesystemwatcher",
".",
"Watchers",
"{",
"... | // WatchFilesystemAttachments watches for changes to filesystem attachments
// scoped to the entity with the tag passed to NewState. | [
"WatchFilesystemAttachments",
"watches",
"for",
"changes",
"to",
"filesystem",
"attachments",
"scoped",
"to",
"the",
"entity",
"with",
"the",
"tag",
"passed",
"to",
"NewState",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/agent/storageprovisioner/storageprovisioner.go#L395-L404 |
154,212 | juju/juju | apiserver/facades/agent/storageprovisioner/storageprovisioner.go | Volumes | func (s *StorageProvisionerAPIv3) Volumes(args params.Entities) (params.VolumeResults, error) {
canAccess, err := s.getStorageEntityAuthFunc()
if err != nil {
return params.VolumeResults{}, common.ServerError(common.ErrPerm)
}
results := params.VolumeResults{
Results: make([]params.VolumeResult, len(args.Entiti... | go | func (s *StorageProvisionerAPIv3) Volumes(args params.Entities) (params.VolumeResults, error) {
canAccess, err := s.getStorageEntityAuthFunc()
if err != nil {
return params.VolumeResults{}, common.ServerError(common.ErrPerm)
}
results := params.VolumeResults{
Results: make([]params.VolumeResult, len(args.Entiti... | [
"func",
"(",
"s",
"*",
"StorageProvisionerAPIv3",
")",
"Volumes",
"(",
"args",
"params",
".",
"Entities",
")",
"(",
"params",
".",
"VolumeResults",
",",
"error",
")",
"{",
"canAccess",
",",
"err",
":=",
"s",
".",
"getStorageEntityAuthFunc",
"(",
")",
"\n",... | // Volumes returns details of volumes with the specified tags. | [
"Volumes",
"returns",
"details",
"of",
"volumes",
"with",
"the",
"specified",
"tags",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/agent/storageprovisioner/storageprovisioner.go#L535-L567 |
154,213 | juju/juju | apiserver/facades/agent/storageprovisioner/storageprovisioner.go | VolumeAttachmentPlans | func (s *StorageProvisionerAPIv3) VolumeAttachmentPlans(args params.MachineStorageIds) (params.VolumeAttachmentPlanResults, error) {
// NOTE(gsamfira): Containers will probably not be a concern for this at the moment
// revisit this if containers should be treated
canAccess, err := s.getMachineAuthFunc()
if err != ... | go | func (s *StorageProvisionerAPIv3) VolumeAttachmentPlans(args params.MachineStorageIds) (params.VolumeAttachmentPlanResults, error) {
// NOTE(gsamfira): Containers will probably not be a concern for this at the moment
// revisit this if containers should be treated
canAccess, err := s.getMachineAuthFunc()
if err != ... | [
"func",
"(",
"s",
"*",
"StorageProvisionerAPIv3",
")",
"VolumeAttachmentPlans",
"(",
"args",
"params",
".",
"MachineStorageIds",
")",
"(",
"params",
".",
"VolumeAttachmentPlanResults",
",",
"error",
")",
"{",
"// NOTE(gsamfira): Containers will probably not be a concern for... | // VolumeAttachmentPlans returns details of volume attachment plans with the specified IDs. | [
"VolumeAttachmentPlans",
"returns",
"details",
"of",
"volume",
"attachment",
"plans",
"with",
"the",
"specified",
"IDs",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/agent/storageprovisioner/storageprovisioner.go#L605-L633 |
154,214 | juju/juju | apiserver/facades/agent/storageprovisioner/storageprovisioner.go | VolumeBlockDevices | func (s *StorageProvisionerAPIv3) VolumeBlockDevices(args params.MachineStorageIds) (params.BlockDeviceResults, error) {
canAccess, err := s.getAttachmentAuthFunc()
if err != nil {
return params.BlockDeviceResults{}, common.ServerError(common.ErrPerm)
}
results := params.BlockDeviceResults{
Results: make([]para... | go | func (s *StorageProvisionerAPIv3) VolumeBlockDevices(args params.MachineStorageIds) (params.BlockDeviceResults, error) {
canAccess, err := s.getAttachmentAuthFunc()
if err != nil {
return params.BlockDeviceResults{}, common.ServerError(common.ErrPerm)
}
results := params.BlockDeviceResults{
Results: make([]para... | [
"func",
"(",
"s",
"*",
"StorageProvisionerAPIv3",
")",
"VolumeBlockDevices",
"(",
"args",
"params",
".",
"MachineStorageIds",
")",
"(",
"params",
".",
"BlockDeviceResults",
",",
"error",
")",
"{",
"canAccess",
",",
"err",
":=",
"s",
".",
"getAttachmentAuthFunc",... | // VolumeBlockDevices returns details of the block devices corresponding to the
// volume attachments with the specified IDs. | [
"VolumeBlockDevices",
"returns",
"details",
"of",
"the",
"block",
"devices",
"corresponding",
"to",
"the",
"volume",
"attachments",
"with",
"the",
"specified",
"IDs",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/agent/storageprovisioner/storageprovisioner.go#L666-L692 |
154,215 | juju/juju | apiserver/facades/agent/storageprovisioner/storageprovisioner.go | RemoveVolumeParams | func (s *StorageProvisionerAPIv4) RemoveVolumeParams(args params.Entities) (params.RemoveVolumeParamsResults, error) {
canAccess, err := s.getStorageEntityAuthFunc()
if err != nil {
return params.RemoveVolumeParamsResults{}, err
}
results := params.RemoveVolumeParamsResults{
Results: make([]params.RemoveVolumeP... | go | func (s *StorageProvisionerAPIv4) RemoveVolumeParams(args params.Entities) (params.RemoveVolumeParamsResults, error) {
canAccess, err := s.getStorageEntityAuthFunc()
if err != nil {
return params.RemoveVolumeParamsResults{}, err
}
results := params.RemoveVolumeParamsResults{
Results: make([]params.RemoveVolumeP... | [
"func",
"(",
"s",
"*",
"StorageProvisionerAPIv4",
")",
"RemoveVolumeParams",
"(",
"args",
"params",
".",
"Entities",
")",
"(",
"params",
".",
"RemoveVolumeParamsResults",
",",
"error",
")",
"{",
"canAccess",
",",
"err",
":=",
"s",
".",
"getStorageEntityAuthFunc"... | // RemoveVolumeParams returns the parameters for destroying
// or releasing the volumes with the specified tags. | [
"RemoveVolumeParams",
"returns",
"the",
"parameters",
"for",
"destroying",
"or",
"releasing",
"the",
"volumes",
"with",
"the",
"specified",
"tags",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/agent/storageprovisioner/storageprovisioner.go#L821-L873 |
154,216 | juju/juju | apiserver/facades/agent/storageprovisioner/storageprovisioner.go | FilesystemParams | func (s *StorageProvisionerAPIv3) FilesystemParams(args params.Entities) (params.FilesystemParamsResults, error) {
canAccess, err := s.getStorageEntityAuthFunc()
if err != nil {
return params.FilesystemParamsResults{}, err
}
modelConfig, err := s.st.ModelConfig()
if err != nil {
return params.FilesystemParamsR... | go | func (s *StorageProvisionerAPIv3) FilesystemParams(args params.Entities) (params.FilesystemParamsResults, error) {
canAccess, err := s.getStorageEntityAuthFunc()
if err != nil {
return params.FilesystemParamsResults{}, err
}
modelConfig, err := s.st.ModelConfig()
if err != nil {
return params.FilesystemParamsR... | [
"func",
"(",
"s",
"*",
"StorageProvisionerAPIv3",
")",
"FilesystemParams",
"(",
"args",
"params",
".",
"Entities",
")",
"(",
"params",
".",
"FilesystemParamsResults",
",",
"error",
")",
"{",
"canAccess",
",",
"err",
":=",
"s",
".",
"getStorageEntityAuthFunc",
... | // FilesystemParams returns the parameters for creating the filesystems
// with the specified tags. | [
"FilesystemParams",
"returns",
"the",
"parameters",
"for",
"creating",
"the",
"filesystems",
"with",
"the",
"specified",
"tags",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/agent/storageprovisioner/storageprovisioner.go#L877-L931 |
154,217 | juju/juju | apiserver/facades/agent/storageprovisioner/storageprovisioner.go | RemoveFilesystemParams | func (s *StorageProvisionerAPIv4) RemoveFilesystemParams(args params.Entities) (params.RemoveFilesystemParamsResults, error) {
canAccess, err := s.getStorageEntityAuthFunc()
if err != nil {
return params.RemoveFilesystemParamsResults{}, err
}
results := params.RemoveFilesystemParamsResults{
Results: make([]para... | go | func (s *StorageProvisionerAPIv4) RemoveFilesystemParams(args params.Entities) (params.RemoveFilesystemParamsResults, error) {
canAccess, err := s.getStorageEntityAuthFunc()
if err != nil {
return params.RemoveFilesystemParamsResults{}, err
}
results := params.RemoveFilesystemParamsResults{
Results: make([]para... | [
"func",
"(",
"s",
"*",
"StorageProvisionerAPIv4",
")",
"RemoveFilesystemParams",
"(",
"args",
"params",
".",
"Entities",
")",
"(",
"params",
".",
"RemoveFilesystemParamsResults",
",",
"error",
")",
"{",
"canAccess",
",",
"err",
":=",
"s",
".",
"getStorageEntityA... | // RemoveFilesystemParams returns the parameters for destroying or
// releasing the filesystems with the specified tags. | [
"RemoveFilesystemParams",
"returns",
"the",
"parameters",
"for",
"destroying",
"or",
"releasing",
"the",
"filesystems",
"with",
"the",
"specified",
"tags",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/agent/storageprovisioner/storageprovisioner.go#L935-L987 |
154,218 | juju/juju | apiserver/facades/agent/storageprovisioner/storageprovisioner.go | AttachmentLife | func (s *StorageProvisionerAPIv3) AttachmentLife(args params.MachineStorageIds) (params.LifeResults, error) {
canAccess, err := s.getAttachmentAuthFunc()
if err != nil {
return params.LifeResults{}, err
}
results := params.LifeResults{
Results: make([]params.LifeResult, len(args.Ids)),
}
one := func(arg param... | go | func (s *StorageProvisionerAPIv3) AttachmentLife(args params.MachineStorageIds) (params.LifeResults, error) {
canAccess, err := s.getAttachmentAuthFunc()
if err != nil {
return params.LifeResults{}, err
}
results := params.LifeResults{
Results: make([]params.LifeResult, len(args.Ids)),
}
one := func(arg param... | [
"func",
"(",
"s",
"*",
"StorageProvisionerAPIv3",
")",
"AttachmentLife",
"(",
"args",
"params",
".",
"MachineStorageIds",
")",
"(",
"params",
".",
"LifeResults",
",",
"error",
")",
"{",
"canAccess",
",",
"err",
":=",
"s",
".",
"getAttachmentAuthFunc",
"(",
"... | // AttachmentLife returns the lifecycle state of each specified machine
// storage attachment. | [
"AttachmentLife",
"returns",
"the",
"lifecycle",
"state",
"of",
"each",
"specified",
"machine",
"storage",
"attachment",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/agent/storageprovisioner/storageprovisioner.go#L1486-L1530 |
154,219 | juju/juju | apiserver/facades/agent/storageprovisioner/storageprovisioner.go | Remove | func (s *StorageProvisionerAPIv3) Remove(args params.Entities) (params.ErrorResults, error) {
canAccess, err := s.getStorageEntityAuthFunc()
if err != nil {
return params.ErrorResults{}, err
}
results := params.ErrorResults{
Results: make([]params.ErrorResult, len(args.Entities)),
}
one := func(arg params.Ent... | go | func (s *StorageProvisionerAPIv3) Remove(args params.Entities) (params.ErrorResults, error) {
canAccess, err := s.getStorageEntityAuthFunc()
if err != nil {
return params.ErrorResults{}, err
}
results := params.ErrorResults{
Results: make([]params.ErrorResult, len(args.Entities)),
}
one := func(arg params.Ent... | [
"func",
"(",
"s",
"*",
"StorageProvisionerAPIv3",
")",
"Remove",
"(",
"args",
"params",
".",
"Entities",
")",
"(",
"params",
".",
"ErrorResults",
",",
"error",
")",
"{",
"canAccess",
",",
"err",
":=",
"s",
".",
"getStorageEntityAuthFunc",
"(",
")",
"\n",
... | // Remove removes volumes and filesystems from state. | [
"Remove",
"removes",
"volumes",
"and",
"filesystems",
"from",
"state",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/agent/storageprovisioner/storageprovisioner.go#L1533-L1565 |
154,220 | juju/juju | apiserver/facades/agent/storageprovisioner/storageprovisioner.go | RemoveAttachment | func (s *StorageProvisionerAPIv3) RemoveAttachment(args params.MachineStorageIds) (params.ErrorResults, error) {
canAccess, err := s.getAttachmentAuthFunc()
if err != nil {
return params.ErrorResults{}, err
}
results := params.ErrorResults{
Results: make([]params.ErrorResult, len(args.Ids)),
}
removeAttachmen... | go | func (s *StorageProvisionerAPIv3) RemoveAttachment(args params.MachineStorageIds) (params.ErrorResults, error) {
canAccess, err := s.getAttachmentAuthFunc()
if err != nil {
return params.ErrorResults{}, err
}
results := params.ErrorResults{
Results: make([]params.ErrorResult, len(args.Ids)),
}
removeAttachmen... | [
"func",
"(",
"s",
"*",
"StorageProvisionerAPIv3",
")",
"RemoveAttachment",
"(",
"args",
"params",
".",
"MachineStorageIds",
")",
"(",
"params",
".",
"ErrorResults",
",",
"error",
")",
"{",
"canAccess",
",",
"err",
":=",
"s",
".",
"getAttachmentAuthFunc",
"(",
... | // RemoveAttachments removes the specified machine storage attachments
// from state. | [
"RemoveAttachments",
"removes",
"the",
"specified",
"machine",
"storage",
"attachments",
"from",
"state",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/agent/storageprovisioner/storageprovisioner.go#L1569-L1607 |
154,221 | juju/juju | api/firewaller/firewaller.go | NewClient | func NewClient(caller base.APICaller) (*Client, error) {
modelTag, isModel := caller.ModelTag()
if !isModel {
return nil, errors.New("expected model specific API connection")
}
facadeCaller := base.NewFacadeCaller(caller, firewallerFacade)
return &Client{
facade: facadeCaller,
ModelWatcher: common.NewM... | go | func NewClient(caller base.APICaller) (*Client, error) {
modelTag, isModel := caller.ModelTag()
if !isModel {
return nil, errors.New("expected model specific API connection")
}
facadeCaller := base.NewFacadeCaller(caller, firewallerFacade)
return &Client{
facade: facadeCaller,
ModelWatcher: common.NewM... | [
"func",
"NewClient",
"(",
"caller",
"base",
".",
"APICaller",
")",
"(",
"*",
"Client",
",",
"error",
")",
"{",
"modelTag",
",",
"isModel",
":=",
"caller",
".",
"ModelTag",
"(",
")",
"\n",
"if",
"!",
"isModel",
"{",
"return",
"nil",
",",
"errors",
"."... | // NewClient creates a new client-side Firewaller API facade. | [
"NewClient",
"creates",
"a",
"new",
"client",
"-",
"side",
"Firewaller",
"API",
"facade",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/api/firewaller/firewaller.go#L31-L42 |
154,222 | juju/juju | api/firewaller/firewaller.go | ModelTag | func (c *Client) ModelTag() (names.ModelTag, bool) {
return c.facade.RawAPICaller().ModelTag()
} | go | func (c *Client) ModelTag() (names.ModelTag, bool) {
return c.facade.RawAPICaller().ModelTag()
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"ModelTag",
"(",
")",
"(",
"names",
".",
"ModelTag",
",",
"bool",
")",
"{",
"return",
"c",
".",
"facade",
".",
"RawAPICaller",
"(",
")",
".",
"ModelTag",
"(",
")",
"\n",
"}"
] | // ModelTag returns the current model's tag. | [
"ModelTag",
"returns",
"the",
"current",
"model",
"s",
"tag",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/api/firewaller/firewaller.go#L51-L53 |
154,223 | juju/juju | api/firewaller/firewaller.go | life | func (c *Client) life(tag names.Tag) (params.Life, error) {
return common.OneLife(c.facade, tag)
} | go | func (c *Client) life(tag names.Tag) (params.Life, error) {
return common.OneLife(c.facade, tag)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"life",
"(",
"tag",
"names",
".",
"Tag",
")",
"(",
"params",
".",
"Life",
",",
"error",
")",
"{",
"return",
"common",
".",
"OneLife",
"(",
"c",
".",
"facade",
",",
"tag",
")",
"\n",
"}"
] | // life requests the life cycle of the given entity from the server. | [
"life",
"requests",
"the",
"life",
"cycle",
"of",
"the",
"given",
"entity",
"from",
"the",
"server",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/api/firewaller/firewaller.go#L56-L58 |
154,224 | juju/juju | api/firewaller/firewaller.go | WatchOpenedPorts | func (c *Client) WatchOpenedPorts() (watcher.StringsWatcher, error) {
modelTag, ok := c.ModelTag()
if !ok {
return nil, errors.New("API connection is controller-only (should never happen)")
}
var results params.StringsWatchResults
args := params.Entities{
Entities: []params.Entity{{Tag: modelTag.String()}},
}... | go | func (c *Client) WatchOpenedPorts() (watcher.StringsWatcher, error) {
modelTag, ok := c.ModelTag()
if !ok {
return nil, errors.New("API connection is controller-only (should never happen)")
}
var results params.StringsWatchResults
args := params.Entities{
Entities: []params.Entity{{Tag: modelTag.String()}},
}... | [
"func",
"(",
"c",
"*",
"Client",
")",
"WatchOpenedPorts",
"(",
")",
"(",
"watcher",
".",
"StringsWatcher",
",",
"error",
")",
"{",
"modelTag",
",",
"ok",
":=",
"c",
".",
"ModelTag",
"(",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
",",
"error... | // WatchOpenedPorts returns a StringsWatcher that notifies of
// changes to the opened ports for the current model. | [
"WatchOpenedPorts",
"returns",
"a",
"StringsWatcher",
"that",
"notifies",
"of",
"changes",
"to",
"the",
"opened",
"ports",
"for",
"the",
"current",
"model",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/api/firewaller/firewaller.go#L105-L126 |
154,225 | juju/juju | api/firewaller/firewaller.go | Relation | func (c *Client) Relation(tag names.RelationTag) (*Relation, error) {
life, err := c.life(tag)
if err != nil {
return nil, err
}
return &Relation{
tag: tag,
life: life,
}, nil
} | go | func (c *Client) Relation(tag names.RelationTag) (*Relation, error) {
life, err := c.life(tag)
if err != nil {
return nil, err
}
return &Relation{
tag: tag,
life: life,
}, nil
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"Relation",
"(",
"tag",
"names",
".",
"RelationTag",
")",
"(",
"*",
"Relation",
",",
"error",
")",
"{",
"life",
",",
"err",
":=",
"c",
".",
"life",
"(",
"tag",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"ret... | // Relation provides access to methods of a state.Relation through the
// facade. | [
"Relation",
"provides",
"access",
"to",
"methods",
"of",
"a",
"state",
".",
"Relation",
"through",
"the",
"facade",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/api/firewaller/firewaller.go#L130-L139 |
154,226 | juju/juju | api/firewaller/firewaller.go | ControllerAPIInfoForModel | func (c *Client) ControllerAPIInfoForModel(modelUUID string) (*api.Info, error) {
modelTag := names.NewModelTag(modelUUID)
args := params.Entities{[]params.Entity{{Tag: modelTag.String()}}}
var results params.ControllerAPIInfoResults
err := c.facade.FacadeCall("ControllerAPIInfoForModels", args, &results)
if err !... | go | func (c *Client) ControllerAPIInfoForModel(modelUUID string) (*api.Info, error) {
modelTag := names.NewModelTag(modelUUID)
args := params.Entities{[]params.Entity{{Tag: modelTag.String()}}}
var results params.ControllerAPIInfoResults
err := c.facade.FacadeCall("ControllerAPIInfoForModels", args, &results)
if err !... | [
"func",
"(",
"c",
"*",
"Client",
")",
"ControllerAPIInfoForModel",
"(",
"modelUUID",
"string",
")",
"(",
"*",
"api",
".",
"Info",
",",
"error",
")",
"{",
"modelTag",
":=",
"names",
".",
"NewModelTag",
"(",
"modelUUID",
")",
"\n",
"args",
":=",
"params",
... | // ControllerAPIInfoForModels returns the controller api connection details for the specified model. | [
"ControllerAPIInfoForModels",
"returns",
"the",
"controller",
"api",
"connection",
"details",
"for",
"the",
"specified",
"model",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/api/firewaller/firewaller.go#L186-L206 |
154,227 | juju/juju | api/firewaller/firewaller.go | MacaroonForRelation | func (c *Client) MacaroonForRelation(relationKey string) (*macaroon.Macaroon, error) {
relationTag := names.NewRelationTag(relationKey)
args := params.Entities{[]params.Entity{{Tag: relationTag.String()}}}
var results params.MacaroonResults
err := c.facade.FacadeCall("MacaroonForRelations", args, &results)
if err ... | go | func (c *Client) MacaroonForRelation(relationKey string) (*macaroon.Macaroon, error) {
relationTag := names.NewRelationTag(relationKey)
args := params.Entities{[]params.Entity{{Tag: relationTag.String()}}}
var results params.MacaroonResults
err := c.facade.FacadeCall("MacaroonForRelations", args, &results)
if err ... | [
"func",
"(",
"c",
"*",
"Client",
")",
"MacaroonForRelation",
"(",
"relationKey",
"string",
")",
"(",
"*",
"macaroon",
".",
"Macaroon",
",",
"error",
")",
"{",
"relationTag",
":=",
"names",
".",
"NewRelationTag",
"(",
"relationKey",
")",
"\n",
"args",
":=",... | // MacaroonForRelation returns the macaroon to use when publishing changes for the relation. | [
"MacaroonForRelation",
"returns",
"the",
"macaroon",
"to",
"use",
"when",
"publishing",
"changes",
"for",
"the",
"relation",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/api/firewaller/firewaller.go#L209-L225 |
154,228 | juju/juju | api/firewaller/firewaller.go | SetRelationStatus | func (c *Client) SetRelationStatus(relationKey string, status relation.Status, message string) error {
relationTag := names.NewRelationTag(relationKey)
args := params.SetStatus{Entities: []params.EntityStatusArgs{
{Tag: relationTag.String(), Status: status.String(), Info: message},
}}
var results params.ErrorRes... | go | func (c *Client) SetRelationStatus(relationKey string, status relation.Status, message string) error {
relationTag := names.NewRelationTag(relationKey)
args := params.SetStatus{Entities: []params.EntityStatusArgs{
{Tag: relationTag.String(), Status: status.String(), Info: message},
}}
var results params.ErrorRes... | [
"func",
"(",
"c",
"*",
"Client",
")",
"SetRelationStatus",
"(",
"relationKey",
"string",
",",
"status",
"relation",
".",
"Status",
",",
"message",
"string",
")",
"error",
"{",
"relationTag",
":=",
"names",
".",
"NewRelationTag",
"(",
"relationKey",
")",
"\n"... | // SetRelationStatus sets the status for a given relation. | [
"SetRelationStatus",
"sets",
"the",
"status",
"for",
"a",
"given",
"relation",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/api/firewaller/firewaller.go#L228-L240 |
154,229 | juju/juju | api/firewaller/firewaller.go | FirewallRules | func (c *Client) FirewallRules(knownServices ...string) ([]params.FirewallRule, error) {
args := params.KnownServiceArgs{
KnownServices: make([]params.KnownServiceValue, len(knownServices)),
}
for i, s := range knownServices {
args.KnownServices[i] = params.KnownServiceValue(s)
}
var results params.ListFirewa... | go | func (c *Client) FirewallRules(knownServices ...string) ([]params.FirewallRule, error) {
args := params.KnownServiceArgs{
KnownServices: make([]params.KnownServiceValue, len(knownServices)),
}
for i, s := range knownServices {
args.KnownServices[i] = params.KnownServiceValue(s)
}
var results params.ListFirewa... | [
"func",
"(",
"c",
"*",
"Client",
")",
"FirewallRules",
"(",
"knownServices",
"...",
"string",
")",
"(",
"[",
"]",
"params",
".",
"FirewallRule",
",",
"error",
")",
"{",
"args",
":=",
"params",
".",
"KnownServiceArgs",
"{",
"KnownServices",
":",
"make",
"... | // FirewallRules returns the firewall rules for the specified known service names. | [
"FirewallRules",
"returns",
"the",
"firewall",
"rules",
"for",
"the",
"specified",
"known",
"service",
"names",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/api/firewaller/firewaller.go#L243-L257 |
154,230 | juju/juju | cert/cert.go | Verify | func Verify(srvCertPEM, caCertPEM string, when time.Time) error {
caCert, err := cert.ParseCert(caCertPEM)
if err != nil {
return errors.Annotate(err, "cannot parse CA certificate")
}
srvCert, err := cert.ParseCert(srvCertPEM)
if err != nil {
return errors.Annotate(err, "cannot parse server certificate")
}
p... | go | func Verify(srvCertPEM, caCertPEM string, when time.Time) error {
caCert, err := cert.ParseCert(caCertPEM)
if err != nil {
return errors.Annotate(err, "cannot parse CA certificate")
}
srvCert, err := cert.ParseCert(srvCertPEM)
if err != nil {
return errors.Annotate(err, "cannot parse server certificate")
}
p... | [
"func",
"Verify",
"(",
"srvCertPEM",
",",
"caCertPEM",
"string",
",",
"when",
"time",
".",
"Time",
")",
"error",
"{",
"caCert",
",",
"err",
":=",
"cert",
".",
"ParseCert",
"(",
"caCertPEM",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"errors",
... | // Verify verifies that the given server certificate is valid with
// respect to the given CA certificate at the given time. | [
"Verify",
"verifies",
"that",
"the",
"given",
"server",
"certificate",
"is",
"valid",
"with",
"respect",
"to",
"the",
"given",
"CA",
"certificate",
"at",
"the",
"given",
"time",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/cert/cert.go#L19-L36 |
154,231 | juju/juju | provider/azure/environ.go | newEnviron | func newEnviron(
provider *azureEnvironProvider,
cloud environs.CloudSpec,
cfg *config.Config,
) (*azureEnviron, error) {
// The Azure storage code wants the endpoint host only, not the URL.
storageEndpointURL, err := url.Parse(cloud.StorageEndpoint)
if err != nil {
return nil, errors.Annotate(err, "parsing st... | go | func newEnviron(
provider *azureEnvironProvider,
cloud environs.CloudSpec,
cfg *config.Config,
) (*azureEnviron, error) {
// The Azure storage code wants the endpoint host only, not the URL.
storageEndpointURL, err := url.Parse(cloud.StorageEndpoint)
if err != nil {
return nil, errors.Annotate(err, "parsing st... | [
"func",
"newEnviron",
"(",
"provider",
"*",
"azureEnvironProvider",
",",
"cloud",
"environs",
".",
"CloudSpec",
",",
"cfg",
"*",
"config",
".",
"Config",
",",
")",
"(",
"*",
"azureEnviron",
",",
"error",
")",
"{",
"// The Azure storage code wants the endpoint host... | // newEnviron creates a new azureEnviron. | [
"newEnviron",
"creates",
"a",
"new",
"azureEnviron",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/azure/environ.go#L128-L171 |
154,232 | juju/juju | provider/azure/environ.go | initResourceGroup | func (env *azureEnviron) initResourceGroup(ctx context.ProviderCallContext, controllerUUID string, controller bool) error {
resourceGroupsClient := resources.GroupsClient{env.resources}
env.mu.Lock()
tags := tags.ResourceTags(
names.NewModelTag(env.config.Config.UUID()),
names.NewControllerTag(controllerUUID),
... | go | func (env *azureEnviron) initResourceGroup(ctx context.ProviderCallContext, controllerUUID string, controller bool) error {
resourceGroupsClient := resources.GroupsClient{env.resources}
env.mu.Lock()
tags := tags.ResourceTags(
names.NewModelTag(env.config.Config.UUID()),
names.NewControllerTag(controllerUUID),
... | [
"func",
"(",
"env",
"*",
"azureEnviron",
")",
"initResourceGroup",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
",",
"controllerUUID",
"string",
",",
"controller",
"bool",
")",
"error",
"{",
"resourceGroupsClient",
":=",
"resources",
".",
"GroupsClient",
"{"... | // initResourceGroup creates a resource group for this environment. | [
"initResourceGroup",
"creates",
"a",
"resource",
"group",
"for",
"this",
"environment",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/azure/environ.go#L254-L292 |
154,233 | juju/juju | provider/azure/environ.go | Config | func (env *azureEnviron) Config() *config.Config {
env.mu.Lock()
defer env.mu.Unlock()
return env.config.Config
} | go | func (env *azureEnviron) Config() *config.Config {
env.mu.Lock()
defer env.mu.Unlock()
return env.config.Config
} | [
"func",
"(",
"env",
"*",
"azureEnviron",
")",
"Config",
"(",
")",
"*",
"config",
".",
"Config",
"{",
"env",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"env",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"return",
"env",
".",
"config",
".",
"... | // Config is specified in the Environ interface. | [
"Config",
"is",
"specified",
"in",
"the",
"Environ",
"interface",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/azure/environ.go#L343-L347 |
154,234 | juju/juju | provider/azure/environ.go | waitCommonResourcesCreated | func (env *azureEnviron) waitCommonResourcesCreated() error {
env.mu.Lock()
defer env.mu.Unlock()
if env.commonResourcesCreated {
return nil
}
deployment, err := env.waitCommonResourcesCreatedLocked()
if err != nil {
return errors.Trace(err)
}
env.commonResourcesCreated = true
if deployment != nil {
// C... | go | func (env *azureEnviron) waitCommonResourcesCreated() error {
env.mu.Lock()
defer env.mu.Unlock()
if env.commonResourcesCreated {
return nil
}
deployment, err := env.waitCommonResourcesCreatedLocked()
if err != nil {
return errors.Trace(err)
}
env.commonResourcesCreated = true
if deployment != nil {
// C... | [
"func",
"(",
"env",
"*",
"azureEnviron",
")",
"waitCommonResourcesCreated",
"(",
")",
"error",
"{",
"env",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"env",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"if",
"env",
".",
"commonResourcesCreated",
"{"... | // waitCommonResourcesCreated waits for the "common" deployment to complete. | [
"waitCommonResourcesCreated",
"waits",
"for",
"the",
"common",
"deployment",
"to",
"complete",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/azure/environ.go#L849-L888 |
154,235 | juju/juju | provider/azure/environ.go | newStorageProfile | func newStorageProfile(
vmName string,
maybeStorageAccount *storage.Account,
storageAccountType string,
instanceSpec *instances.InstanceSpec,
) (*compute.StorageProfile, error) {
logger.Debugf("creating storage profile for %q", vmName)
urnParts := strings.SplitN(instanceSpec.Image.Id, ":", 4)
if len(urnParts) !... | go | func newStorageProfile(
vmName string,
maybeStorageAccount *storage.Account,
storageAccountType string,
instanceSpec *instances.InstanceSpec,
) (*compute.StorageProfile, error) {
logger.Debugf("creating storage profile for %q", vmName)
urnParts := strings.SplitN(instanceSpec.Image.Id, ":", 4)
if len(urnParts) !... | [
"func",
"newStorageProfile",
"(",
"vmName",
"string",
",",
"maybeStorageAccount",
"*",
"storage",
".",
"Account",
",",
"storageAccountType",
"string",
",",
"instanceSpec",
"*",
"instances",
".",
"InstanceSpec",
",",
")",
"(",
"*",
"compute",
".",
"StorageProfile",... | // newStorageProfile creates the storage profile for a virtual machine,
// based on the series and chosen instance spec. | [
"newStorageProfile",
"creates",
"the",
"storage",
"profile",
"for",
"a",
"virtual",
"machine",
"based",
"on",
"the",
"series",
"and",
"chosen",
"instance",
"spec",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/azure/environ.go#L995-L1042 |
154,236 | juju/juju | provider/azure/environ.go | cancelDeployment | func (env *azureEnviron) cancelDeployment(ctx context.ProviderCallContext, sdkCtx stdcontext.Context, name string) error {
deploymentsClient := resources.DeploymentsClient{env.resources}
logger.Debugf("- canceling deployment %q", name)
cancelResult, err := deploymentsClient.Cancel(sdkCtx, env.resourceGroup, name)
i... | go | func (env *azureEnviron) cancelDeployment(ctx context.ProviderCallContext, sdkCtx stdcontext.Context, name string) error {
deploymentsClient := resources.DeploymentsClient{env.resources}
logger.Debugf("- canceling deployment %q", name)
cancelResult, err := deploymentsClient.Cancel(sdkCtx, env.resourceGroup, name)
i... | [
"func",
"(",
"env",
"*",
"azureEnviron",
")",
"cancelDeployment",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
",",
"sdkCtx",
"stdcontext",
".",
"Context",
",",
"name",
"string",
")",
"error",
"{",
"deploymentsClient",
":=",
"resources",
".",
"DeploymentsC... | // cancelDeployment cancels a template deployment. | [
"cancelDeployment",
"cancels",
"a",
"template",
"deployment",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/azure/environ.go#L1212-L1234 |
154,237 | juju/juju | provider/azure/environ.go | Instances | func (env *azureEnviron) Instances(ctx context.ProviderCallContext, ids []instance.Id) ([]instances.Instance, error) {
return env.instances(ctx, env.resourceGroup, ids, true /* refresh addresses */)
} | go | func (env *azureEnviron) Instances(ctx context.ProviderCallContext, ids []instance.Id) ([]instances.Instance, error) {
return env.instances(ctx, env.resourceGroup, ids, true /* refresh addresses */)
} | [
"func",
"(",
"env",
"*",
"azureEnviron",
")",
"Instances",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
",",
"ids",
"[",
"]",
"instance",
".",
"Id",
")",
"(",
"[",
"]",
"instances",
".",
"Instance",
",",
"error",
")",
"{",
"return",
"env",
".",
... | // Instances is specified in the Environ interface. | [
"Instances",
"is",
"specified",
"in",
"the",
"Environ",
"interface",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/azure/environ.go#L1388-L1390 |
154,238 | juju/juju | provider/azure/environ.go | AllInstances | func (env *azureEnviron) AllInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) {
return env.allInstances(ctx, env.resourceGroup, true /* refresh addresses */, false /* all instances */)
} | go | func (env *azureEnviron) AllInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) {
return env.allInstances(ctx, env.resourceGroup, true /* refresh addresses */, false /* all instances */)
} | [
"func",
"(",
"env",
"*",
"azureEnviron",
")",
"AllInstances",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
")",
"(",
"[",
"]",
"instances",
".",
"Instance",
",",
"error",
")",
"{",
"return",
"env",
".",
"allInstances",
"(",
"ctx",
",",
"env",
".",
... | // AllInstances is specified in the InstanceBroker interface. | [
"AllInstances",
"is",
"specified",
"in",
"the",
"InstanceBroker",
"interface",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/azure/environ.go#L1531-L1533 |
154,239 | juju/juju | provider/azure/environ.go | allInstances | func (env *azureEnviron) allInstances(
ctx context.ProviderCallContext,
resourceGroup string,
refreshAddresses bool,
controllerOnly bool,
) ([]instances.Instance, error) {
deploymentsClient := resources.DeploymentsClient{env.resources}
sdkCtx := stdcontext.Background()
deploymentsResult, err := deploymentsClient... | go | func (env *azureEnviron) allInstances(
ctx context.ProviderCallContext,
resourceGroup string,
refreshAddresses bool,
controllerOnly bool,
) ([]instances.Instance, error) {
deploymentsClient := resources.DeploymentsClient{env.resources}
sdkCtx := stdcontext.Background()
deploymentsResult, err := deploymentsClient... | [
"func",
"(",
"env",
"*",
"azureEnviron",
")",
"allInstances",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
",",
"resourceGroup",
"string",
",",
"refreshAddresses",
"bool",
",",
"controllerOnly",
"bool",
",",
")",
"(",
"[",
"]",
"instances",
".",
"Instanc... | // allInstances returns all of the instances in the given resource group,
// and optionally ensures that each instance's addresses are up-to-date. | [
"allInstances",
"returns",
"all",
"of",
"the",
"instances",
"in",
"the",
"given",
"resource",
"group",
"and",
"optionally",
"ensures",
"that",
"each",
"instance",
"s",
"addresses",
"are",
"up",
"-",
"to",
"-",
"date",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/azure/environ.go#L1537-L1600 |
154,240 | juju/juju | provider/azure/environ.go | Destroy | func (env *azureEnviron) Destroy(ctx context.ProviderCallContext) error {
logger.Debugf("destroying model %q", env.envName)
logger.Debugf("- deleting resource group %q", env.resourceGroup)
sdkCtx := stdcontext.Background()
if err := env.deleteResourceGroup(ctx, sdkCtx, env.resourceGroup); err != nil {
return erro... | go | func (env *azureEnviron) Destroy(ctx context.ProviderCallContext) error {
logger.Debugf("destroying model %q", env.envName)
logger.Debugf("- deleting resource group %q", env.resourceGroup)
sdkCtx := stdcontext.Background()
if err := env.deleteResourceGroup(ctx, sdkCtx, env.resourceGroup); err != nil {
return erro... | [
"func",
"(",
"env",
"*",
"azureEnviron",
")",
"Destroy",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
")",
"error",
"{",
"logger",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"env",
".",
"envName",
")",
"\n",
"logger",
".",
"Debugf",
"(",
"\"",
"\"",
... | // Destroy is specified in the Environ interface. | [
"Destroy",
"is",
"specified",
"in",
"the",
"Environ",
"interface",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/azure/environ.go#L1623-L1634 |
154,241 | juju/juju | provider/azure/environ.go | DestroyController | func (env *azureEnviron) DestroyController(ctx context.ProviderCallContext, controllerUUID string) error {
logger.Debugf("destroying model %q", env.envName)
logger.Debugf("- deleting resource groups")
if err := env.deleteControllerManagedResourceGroups(ctx, controllerUUID); err != nil {
return errors.Trace(err)
}... | go | func (env *azureEnviron) DestroyController(ctx context.ProviderCallContext, controllerUUID string) error {
logger.Debugf("destroying model %q", env.envName)
logger.Debugf("- deleting resource groups")
if err := env.deleteControllerManagedResourceGroups(ctx, controllerUUID); err != nil {
return errors.Trace(err)
}... | [
"func",
"(",
"env",
"*",
"azureEnviron",
")",
"DestroyController",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
",",
"controllerUUID",
"string",
")",
"error",
"{",
"logger",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"env",
".",
"envName",
")",
"\n",
"logg... | // DestroyController is specified in the Environ interface. | [
"DestroyController",
"is",
"specified",
"in",
"the",
"Environ",
"interface",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/azure/environ.go#L1637-L1647 |
154,242 | juju/juju | provider/azure/environ.go | resourceGroupName | func resourceGroupName(modelTag names.ModelTag, modelName string) string {
return fmt.Sprintf("juju-%s-%s", modelName, resourceName(modelTag))
} | go | func resourceGroupName(modelTag names.ModelTag, modelName string) string {
return fmt.Sprintf("juju-%s-%s", modelName, resourceName(modelTag))
} | [
"func",
"resourceGroupName",
"(",
"modelTag",
"names",
".",
"ModelTag",
",",
"modelName",
"string",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"modelName",
",",
"resourceName",
"(",
"modelTag",
")",
")",
"\n",
"}"
] | // resourceGroupName returns the name of the environment's resource group. | [
"resourceGroupName",
"returns",
"the",
"name",
"of",
"the",
"environment",
"s",
"resource",
"group",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/azure/environ.go#L1738-L1740 |
154,243 | juju/juju | provider/azure/environ.go | getInstanceTypes | func (env *azureEnviron) getInstanceTypes(ctx context.ProviderCallContext) (map[string]instances.InstanceType, error) {
env.mu.Lock()
defer env.mu.Unlock()
instanceTypes, err := env.getInstanceTypesLocked(ctx)
if err != nil {
return nil, errors.Annotate(err, "getting instance types")
}
return instanceTypes, nil... | go | func (env *azureEnviron) getInstanceTypes(ctx context.ProviderCallContext) (map[string]instances.InstanceType, error) {
env.mu.Lock()
defer env.mu.Unlock()
instanceTypes, err := env.getInstanceTypesLocked(ctx)
if err != nil {
return nil, errors.Annotate(err, "getting instance types")
}
return instanceTypes, nil... | [
"func",
"(",
"env",
"*",
"azureEnviron",
")",
"getInstanceTypes",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
")",
"(",
"map",
"[",
"string",
"]",
"instances",
".",
"InstanceType",
",",
"error",
")",
"{",
"env",
".",
"mu",
".",
"Lock",
"(",
")",
... | // getInstanceTypes gets the instance types available for the configured
// location, keyed by name. | [
"getInstanceTypes",
"gets",
"the",
"instance",
"types",
"available",
"for",
"the",
"configured",
"location",
"keyed",
"by",
"name",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/azure/environ.go#L1753-L1761 |
154,244 | juju/juju | provider/azure/environ.go | getInstanceTypesLocked | func (env *azureEnviron) getInstanceTypesLocked(ctx context.ProviderCallContext) (map[string]instances.InstanceType, error) {
if env.instanceTypes != nil {
return env.instanceTypes, nil
}
location := env.location
client := compute.VirtualMachineSizesClient{env.compute}
result, err := client.List(stdcontext.Bac... | go | func (env *azureEnviron) getInstanceTypesLocked(ctx context.ProviderCallContext) (map[string]instances.InstanceType, error) {
if env.instanceTypes != nil {
return env.instanceTypes, nil
}
location := env.location
client := compute.VirtualMachineSizesClient{env.compute}
result, err := client.List(stdcontext.Bac... | [
"func",
"(",
"env",
"*",
"azureEnviron",
")",
"getInstanceTypesLocked",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
")",
"(",
"map",
"[",
"string",
"]",
"instances",
".",
"InstanceType",
",",
"error",
")",
"{",
"if",
"env",
".",
"instanceTypes",
"!=",... | // getInstanceTypesLocked returns the instance types for Azure, by listing the
// role sizes available to the subscription. | [
"getInstanceTypesLocked",
"returns",
"the",
"instance",
"types",
"for",
"Azure",
"by",
"listing",
"the",
"role",
"sizes",
"available",
"to",
"the",
"subscription",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/azure/environ.go#L1765-L1790 |
154,245 | juju/juju | provider/azure/environ.go | maybeGetStorageClient | func (env *azureEnviron) maybeGetStorageClient() (internalazurestorage.Client, *storage.Account, error) {
storageClient, storageAccount, err := env.getStorageClient()
if errors.IsNotFound(err) {
// Only models created prior to Juju 2.3 will have a storage
// account. Juju 2.3 onwards exclusively uses managed disk... | go | func (env *azureEnviron) maybeGetStorageClient() (internalazurestorage.Client, *storage.Account, error) {
storageClient, storageAccount, err := env.getStorageClient()
if errors.IsNotFound(err) {
// Only models created prior to Juju 2.3 will have a storage
// account. Juju 2.3 onwards exclusively uses managed disk... | [
"func",
"(",
"env",
"*",
"azureEnviron",
")",
"maybeGetStorageClient",
"(",
")",
"(",
"internalazurestorage",
".",
"Client",
",",
"*",
"storage",
".",
"Account",
",",
"error",
")",
"{",
"storageClient",
",",
"storageAccount",
",",
"err",
":=",
"env",
".",
... | // maybeGetStorageClient returns the environment's storage client if it
// has one, and nil if it does not. | [
"maybeGetStorageClient",
"returns",
"the",
"environment",
"s",
"storage",
"client",
"if",
"it",
"has",
"one",
"and",
"nil",
"if",
"it",
"does",
"not",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/azure/environ.go#L1794-L1807 |
154,246 | juju/juju | provider/azure/environ.go | getStorageClient | func (env *azureEnviron) getStorageClient() (internalazurestorage.Client, *storage.Account, error) {
env.mu.Lock()
defer env.mu.Unlock()
storageAccount, err := env.getStorageAccountLocked()
if err != nil {
return nil, nil, errors.Annotate(err, "getting storage account")
}
storageAccountKey, err := env.getStorag... | go | func (env *azureEnviron) getStorageClient() (internalazurestorage.Client, *storage.Account, error) {
env.mu.Lock()
defer env.mu.Unlock()
storageAccount, err := env.getStorageAccountLocked()
if err != nil {
return nil, nil, errors.Annotate(err, "getting storage account")
}
storageAccountKey, err := env.getStorag... | [
"func",
"(",
"env",
"*",
"azureEnviron",
")",
"getStorageClient",
"(",
")",
"(",
"internalazurestorage",
".",
"Client",
",",
"*",
"storage",
".",
"Account",
",",
"error",
")",
"{",
"env",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"env",
".",
"... | // getStorageClient queries the storage account key, and uses it to construct
// a new storage client. | [
"getStorageClient",
"queries",
"the",
"storage",
"account",
"key",
"and",
"uses",
"it",
"to",
"construct",
"a",
"new",
"storage",
"client",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/azure/environ.go#L1811-L1834 |
154,247 | juju/juju | provider/azure/environ.go | getStorageAccount | func (env *azureEnviron) getStorageAccount() (*storage.Account, error) {
env.mu.Lock()
defer env.mu.Unlock()
return env.getStorageAccountLocked()
} | go | func (env *azureEnviron) getStorageAccount() (*storage.Account, error) {
env.mu.Lock()
defer env.mu.Unlock()
return env.getStorageAccountLocked()
} | [
"func",
"(",
"env",
"*",
"azureEnviron",
")",
"getStorageAccount",
"(",
")",
"(",
"*",
"storage",
".",
"Account",
",",
"error",
")",
"{",
"env",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"env",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"re... | // getStorageAccount returns the storage account for this environment's
// resource group. | [
"getStorageAccount",
"returns",
"the",
"storage",
"account",
"for",
"this",
"environment",
"s",
"resource",
"group",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/azure/environ.go#L1838-L1842 |
154,248 | juju/juju | provider/azure/environ.go | getStorageAccountKeyLocked | func (env *azureEnviron) getStorageAccountKeyLocked(accountName string, refresh bool) (*storage.AccountKey, error) {
if !refresh && env.storageAccountKey != nil {
return env.storageAccountKey, nil
}
client := storage.AccountsClient{env.storage}
key, err := getStorageAccountKey(client, env.resourceGroup, accountNa... | go | func (env *azureEnviron) getStorageAccountKeyLocked(accountName string, refresh bool) (*storage.AccountKey, error) {
if !refresh && env.storageAccountKey != nil {
return env.storageAccountKey, nil
}
client := storage.AccountsClient{env.storage}
key, err := getStorageAccountKey(client, env.resourceGroup, accountNa... | [
"func",
"(",
"env",
"*",
"azureEnviron",
")",
"getStorageAccountKeyLocked",
"(",
"accountName",
"string",
",",
"refresh",
"bool",
")",
"(",
"*",
"storage",
".",
"AccountKey",
",",
"error",
")",
"{",
"if",
"!",
"refresh",
"&&",
"env",
".",
"storageAccountKey"... | // getStorageAccountKeysLocked returns a storage account key for this
// environment's storage account. If refresh is true, any cached key
// will be refreshed. This method assumes that env.mu is held. | [
"getStorageAccountKeysLocked",
"returns",
"a",
"storage",
"account",
"key",
"for",
"this",
"environment",
"s",
"storage",
"account",
".",
"If",
"refresh",
"is",
"true",
"any",
"cached",
"key",
"will",
"be",
"refreshed",
".",
"This",
"method",
"assumes",
"that",
... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/azure/environ.go#L1870-L1881 |
154,249 | juju/juju | worker/resumer/resumer.go | Validate | func (config Config) Validate() error {
if config.Facade == nil {
return errors.NotValidf("nil Facade")
}
if config.Clock == nil {
return errors.NotValidf("nil Clock")
}
if config.Interval <= 0 {
return errors.NotValidf("non-positive Interval")
}
return nil
} | go | func (config Config) Validate() error {
if config.Facade == nil {
return errors.NotValidf("nil Facade")
}
if config.Clock == nil {
return errors.NotValidf("nil Clock")
}
if config.Interval <= 0 {
return errors.NotValidf("non-positive Interval")
}
return nil
} | [
"func",
"(",
"config",
"Config",
")",
"Validate",
"(",
")",
"error",
"{",
"if",
"config",
".",
"Facade",
"==",
"nil",
"{",
"return",
"errors",
".",
"NotValidf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"config",
".",
"Clock",
"==",
"nil",
"{",
... | // Validate returns an error if config cannot be expected to drive
// a Resumer. | [
"Validate",
"returns",
"an",
"error",
"if",
"config",
"cannot",
"be",
"expected",
"to",
"drive",
"a",
"Resumer",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/worker/resumer/resumer.go#L35-L46 |
154,250 | juju/juju | apiserver/facades/agent/provisioner/machineerror.go | loop | func (w *machineErrorRetry) loop() error {
out := w.out
for {
select {
case <-w.tomb.Dying():
return tomb.ErrDying
// TODO(fwereade): 2016-03-17 lp:1558657
case <-time.After(ErrorRetryWaitDelay):
out = w.out
case out <- struct{}{}:
out = nil
}
}
} | go | func (w *machineErrorRetry) loop() error {
out := w.out
for {
select {
case <-w.tomb.Dying():
return tomb.ErrDying
// TODO(fwereade): 2016-03-17 lp:1558657
case <-time.After(ErrorRetryWaitDelay):
out = w.out
case out <- struct{}{}:
out = nil
}
}
} | [
"func",
"(",
"w",
"*",
"machineErrorRetry",
")",
"loop",
"(",
")",
"error",
"{",
"out",
":=",
"w",
".",
"out",
"\n",
"for",
"{",
"select",
"{",
"case",
"<-",
"w",
".",
"tomb",
".",
"Dying",
"(",
")",
":",
"return",
"tomb",
".",
"ErrDying",
"\n",
... | // The initial implementation of this watcher simply acts as a poller,
// triggering every ErrorRetryWaitDelay minutes. | [
"The",
"initial",
"implementation",
"of",
"this",
"watcher",
"simply",
"acts",
"as",
"a",
"poller",
"triggering",
"every",
"ErrorRetryWaitDelay",
"minutes",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/agent/provisioner/machineerror.go#L66-L79 |
154,251 | juju/juju | cmd/juju/storage/listformatters.go | FormatStorageListForStatusTabular | func FormatStorageListForStatusTabular(writer *ansiterm.TabWriter, s CombinedStorage) error {
w := output.Wrapper{writer}
storagePool, storageSize := getStoragePoolAndSize(s)
units, byUnit := sortStorageInstancesByUnitId(s)
w.Println()
w.Print("Storage Unit", "Storage id", "Type")
if len(storagePool) > 0 {
w.... | go | func FormatStorageListForStatusTabular(writer *ansiterm.TabWriter, s CombinedStorage) error {
w := output.Wrapper{writer}
storagePool, storageSize := getStoragePoolAndSize(s)
units, byUnit := sortStorageInstancesByUnitId(s)
w.Println()
w.Print("Storage Unit", "Storage id", "Type")
if len(storagePool) > 0 {
w.... | [
"func",
"FormatStorageListForStatusTabular",
"(",
"writer",
"*",
"ansiterm",
".",
"TabWriter",
",",
"s",
"CombinedStorage",
")",
"error",
"{",
"w",
":=",
"output",
".",
"Wrapper",
"{",
"writer",
"}",
"\n\n",
"storagePool",
",",
"storageSize",
":=",
"getStoragePo... | // FormatStorageListForStatusTabular writes a tabular summary of storage for status tabular view. | [
"FormatStorageListForStatusTabular",
"writes",
"a",
"tabular",
"summary",
"of",
"storage",
"for",
"status",
"tabular",
"view",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/cmd/juju/storage/listformatters.go#L154-L192 |
154,252 | juju/juju | state/applicationofferuser.go | GetOfferAccess | func (st *State) GetOfferAccess(offerUUID string, user names.UserTag) (permission.Access, error) {
perm, err := st.userPermission(applicationOfferKey(offerUUID), userGlobalKey(userAccessID(user)))
if err != nil {
return "", errors.Trace(err)
}
return perm.access(), nil
} | go | func (st *State) GetOfferAccess(offerUUID string, user names.UserTag) (permission.Access, error) {
perm, err := st.userPermission(applicationOfferKey(offerUUID), userGlobalKey(userAccessID(user)))
if err != nil {
return "", errors.Trace(err)
}
return perm.access(), nil
} | [
"func",
"(",
"st",
"*",
"State",
")",
"GetOfferAccess",
"(",
"offerUUID",
"string",
",",
"user",
"names",
".",
"UserTag",
")",
"(",
"permission",
".",
"Access",
",",
"error",
")",
"{",
"perm",
",",
"err",
":=",
"st",
".",
"userPermission",
"(",
"applic... | // GetOfferAccess gets the access permission for the specified user on an offer. | [
"GetOfferAccess",
"gets",
"the",
"access",
"permission",
"for",
"the",
"specified",
"user",
"on",
"an",
"offer",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/applicationofferuser.go#L17-L23 |
154,253 | juju/juju | state/applicationofferuser.go | GetOfferUsers | func (st *State) GetOfferUsers(offerUUID string) (map[string]permission.Access, error) {
perms, err := st.usersPermissions(applicationOfferKey(offerUUID))
if err != nil {
return nil, errors.Trace(err)
}
result := make(map[string]permission.Access)
for _, p := range perms {
result[userIDFromGlobalKey(p.doc.Subj... | go | func (st *State) GetOfferUsers(offerUUID string) (map[string]permission.Access, error) {
perms, err := st.usersPermissions(applicationOfferKey(offerUUID))
if err != nil {
return nil, errors.Trace(err)
}
result := make(map[string]permission.Access)
for _, p := range perms {
result[userIDFromGlobalKey(p.doc.Subj... | [
"func",
"(",
"st",
"*",
"State",
")",
"GetOfferUsers",
"(",
"offerUUID",
"string",
")",
"(",
"map",
"[",
"string",
"]",
"permission",
".",
"Access",
",",
"error",
")",
"{",
"perms",
",",
"err",
":=",
"st",
".",
"usersPermissions",
"(",
"applicationOfferK... | // GetOfferUsers gets the access permissions on an offer. | [
"GetOfferUsers",
"gets",
"the",
"access",
"permissions",
"on",
"an",
"offer",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/applicationofferuser.go#L26-L36 |
154,254 | juju/juju | state/applicationofferuser.go | CreateOfferAccess | func (st *State) CreateOfferAccess(offer names.ApplicationOfferTag, user names.UserTag, access permission.Access) error {
if err := permission.ValidateOfferAccess(access); err != nil {
return errors.Trace(err)
}
// Local users must exist.
if user.IsLocal() {
_, err := st.User(user)
if err != nil {
if erro... | go | func (st *State) CreateOfferAccess(offer names.ApplicationOfferTag, user names.UserTag, access permission.Access) error {
if err := permission.ValidateOfferAccess(access); err != nil {
return errors.Trace(err)
}
// Local users must exist.
if user.IsLocal() {
_, err := st.User(user)
if err != nil {
if erro... | [
"func",
"(",
"st",
"*",
"State",
")",
"CreateOfferAccess",
"(",
"offer",
"names",
".",
"ApplicationOfferTag",
",",
"user",
"names",
".",
"UserTag",
",",
"access",
"permission",
".",
"Access",
")",
"error",
"{",
"if",
"err",
":=",
"permission",
".",
"Valida... | // CreateOfferAccess creates a new access permission for a user on an offer. | [
"CreateOfferAccess",
"creates",
"a",
"new",
"access",
"permission",
"for",
"a",
"user",
"on",
"an",
"offer",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/applicationofferuser.go#L39-L66 |
154,255 | juju/juju | state/applicationofferuser.go | UpdateOfferAccess | func (st *State) UpdateOfferAccess(offer names.ApplicationOfferTag, user names.UserTag, access permission.Access) error {
if err := permission.ValidateOfferAccess(access); err != nil {
return errors.Trace(err)
}
offerUUID, err := applicationOfferUUID(st, offer.Name)
if err != nil {
return errors.Trace(err)
}
... | go | func (st *State) UpdateOfferAccess(offer names.ApplicationOfferTag, user names.UserTag, access permission.Access) error {
if err := permission.ValidateOfferAccess(access); err != nil {
return errors.Trace(err)
}
offerUUID, err := applicationOfferUUID(st, offer.Name)
if err != nil {
return errors.Trace(err)
}
... | [
"func",
"(",
"st",
"*",
"State",
")",
"UpdateOfferAccess",
"(",
"offer",
"names",
".",
"ApplicationOfferTag",
",",
"user",
"names",
".",
"UserTag",
",",
"access",
"permission",
".",
"Access",
")",
"error",
"{",
"if",
"err",
":=",
"permission",
".",
"Valida... | // UpdateOfferAccess changes the user's access permissions on an offer. | [
"UpdateOfferAccess",
"changes",
"the",
"user",
"s",
"access",
"permissions",
"on",
"an",
"offer",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/applicationofferuser.go#L69-L100 |
154,256 | juju/juju | state/applicationofferuser.go | suspendRevokedRelationsOps | func (st *State) suspendRevokedRelationsOps(offerUUID, userId string) ([]txn.Op, error) {
conns, err := st.OfferConnections(offerUUID)
if err != nil {
return nil, errors.Trace(err)
}
var ops []txn.Op
relIdsToSuspend := make(set.Ints)
for _, oc := range conns {
if oc.UserName() == userId {
rel, err := st.R... | go | func (st *State) suspendRevokedRelationsOps(offerUUID, userId string) ([]txn.Op, error) {
conns, err := st.OfferConnections(offerUUID)
if err != nil {
return nil, errors.Trace(err)
}
var ops []txn.Op
relIdsToSuspend := make(set.Ints)
for _, oc := range conns {
if oc.UserName() == userId {
rel, err := st.R... | [
"func",
"(",
"st",
"*",
"State",
")",
"suspendRevokedRelationsOps",
"(",
"offerUUID",
",",
"userId",
"string",
")",
"(",
"[",
"]",
"txn",
".",
"Op",
",",
"error",
")",
"{",
"conns",
",",
"err",
":=",
"st",
".",
"OfferConnections",
"(",
"offerUUID",
")"... | // suspendRevokedRelationsOps suspends any relations the given user has against
// the specified offer. | [
"suspendRevokedRelationsOps",
"suspends",
"any",
"relations",
"the",
"given",
"user",
"has",
"against",
"the",
"specified",
"offer",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/applicationofferuser.go#L104-L166 |
154,257 | juju/juju | state/applicationofferuser.go | RemoveOfferAccess | func (st *State) RemoveOfferAccess(offer names.ApplicationOfferTag, user names.UserTag) error {
offerUUID, err := applicationOfferUUID(st, offer.Name)
if err != nil {
return errors.Trace(err)
}
buildTxn := func(int) ([]txn.Op, error) {
_, err := st.GetOfferAccess(offerUUID, user)
if err != nil {
return ni... | go | func (st *State) RemoveOfferAccess(offer names.ApplicationOfferTag, user names.UserTag) error {
offerUUID, err := applicationOfferUUID(st, offer.Name)
if err != nil {
return errors.Trace(err)
}
buildTxn := func(int) ([]txn.Op, error) {
_, err := st.GetOfferAccess(offerUUID, user)
if err != nil {
return ni... | [
"func",
"(",
"st",
"*",
"State",
")",
"RemoveOfferAccess",
"(",
"offer",
"names",
".",
"ApplicationOfferTag",
",",
"user",
"names",
".",
"UserTag",
")",
"error",
"{",
"offerUUID",
",",
"err",
":=",
"applicationOfferUUID",
"(",
"st",
",",
"offer",
".",
"Nam... | // RemoveOfferAccess removes the access permission for a user on an offer. | [
"RemoveOfferAccess",
"removes",
"the",
"access",
"permission",
"for",
"a",
"user",
"on",
"an",
"offer",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/applicationofferuser.go#L169-L197 |
154,258 | juju/juju | core/watcher/notify.go | Validate | func (config NotifyConfig) Validate() error {
if config.Handler == nil {
return errors.NotValidf("nil Handler")
}
return nil
} | go | func (config NotifyConfig) Validate() error {
if config.Handler == nil {
return errors.NotValidf("nil Handler")
}
return nil
} | [
"func",
"(",
"config",
"NotifyConfig",
")",
"Validate",
"(",
")",
"error",
"{",
"if",
"config",
".",
"Handler",
"==",
"nil",
"{",
"return",
"errors",
".",
"NotValidf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] | // Validate returns an error if the config cannot start a NotifyWorker. | [
"Validate",
"returns",
"an",
"error",
"if",
"the",
"config",
"cannot",
"start",
"a",
"NotifyWorker",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/core/watcher/notify.go#L54-L59 |
154,259 | juju/juju | core/watcher/notify.go | NewNotifyWorker | func NewNotifyWorker(config NotifyConfig) (*NotifyWorker, error) {
if err := config.Validate(); err != nil {
return nil, errors.Trace(err)
}
nw := &NotifyWorker{
config: config,
}
err := catacomb.Invoke(catacomb.Plan{
Site: &nw.catacomb,
Work: nw.loop,
})
if err != nil {
return nil, errors.Trace(err)
... | go | func NewNotifyWorker(config NotifyConfig) (*NotifyWorker, error) {
if err := config.Validate(); err != nil {
return nil, errors.Trace(err)
}
nw := &NotifyWorker{
config: config,
}
err := catacomb.Invoke(catacomb.Plan{
Site: &nw.catacomb,
Work: nw.loop,
})
if err != nil {
return nil, errors.Trace(err)
... | [
"func",
"NewNotifyWorker",
"(",
"config",
"NotifyConfig",
")",
"(",
"*",
"NotifyWorker",
",",
"error",
")",
"{",
"if",
"err",
":=",
"config",
".",
"Validate",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"Trace",
"(",
... | // NewNotifyWorker starts a new worker that runs a NotifyHandler. | [
"NewNotifyWorker",
"starts",
"a",
"new",
"worker",
"that",
"runs",
"a",
"NotifyHandler",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/core/watcher/notify.go#L62-L77 |
154,260 | juju/juju | storage/provider/dummy/common.go | StorageProviders | func StorageProviders() storage.ProviderRegistry {
return storage.StaticProviderRegistry{
map[storage.ProviderType]storage.Provider{
"static": &StorageProvider{IsDynamic: false},
"modelscoped": &StorageProvider{
StorageScope: storage.ScopeEnviron,
IsDynamic: true,
IsReleasable: true,
},
"m... | go | func StorageProviders() storage.ProviderRegistry {
return storage.StaticProviderRegistry{
map[storage.ProviderType]storage.Provider{
"static": &StorageProvider{IsDynamic: false},
"modelscoped": &StorageProvider{
StorageScope: storage.ScopeEnviron,
IsDynamic: true,
IsReleasable: true,
},
"m... | [
"func",
"StorageProviders",
"(",
")",
"storage",
".",
"ProviderRegistry",
"{",
"return",
"storage",
".",
"StaticProviderRegistry",
"{",
"map",
"[",
"storage",
".",
"ProviderType",
"]",
"storage",
".",
"Provider",
"{",
"\"",
"\"",
":",
"&",
"StorageProvider",
"... | // StorageProviders returns a provider registry with some
// well-defined dummy storage providers. | [
"StorageProviders",
"returns",
"a",
"provider",
"registry",
"with",
"some",
"well",
"-",
"defined",
"dummy",
"storage",
"providers",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/storage/provider/dummy/common.go#L10-L38 |
154,261 | juju/juju | cmd/juju/block/list.go | NewListCommand | func NewListCommand() cmd.Command {
return modelcmd.Wrap(&listCommand{
apiFunc: func(c newAPIRoot) (blockListAPI, error) {
return getBlockAPI(c)
},
controllerAPIFunc: func(c newControllerAPIRoot) (controllerListAPI, error) {
return getControllerAPI(c)
},
})
} | go | func NewListCommand() cmd.Command {
return modelcmd.Wrap(&listCommand{
apiFunc: func(c newAPIRoot) (blockListAPI, error) {
return getBlockAPI(c)
},
controllerAPIFunc: func(c newControllerAPIRoot) (controllerListAPI, error) {
return getControllerAPI(c)
},
})
} | [
"func",
"NewListCommand",
"(",
")",
"cmd",
".",
"Command",
"{",
"return",
"modelcmd",
".",
"Wrap",
"(",
"&",
"listCommand",
"{",
"apiFunc",
":",
"func",
"(",
"c",
"newAPIRoot",
")",
"(",
"blockListAPI",
",",
"error",
")",
"{",
"return",
"getBlockAPI",
"(... | // NewListCommand returns the command that lists the disabled
// commands for the model. | [
"NewListCommand",
"returns",
"the",
"command",
"that",
"lists",
"the",
"disabled",
"commands",
"for",
"the",
"model",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/cmd/juju/block/list.go#L27-L36 |
154,262 | juju/juju | cmd/juju/block/list.go | formatBlockInfo | func formatBlockInfo(all []params.Block) []BlockInfo {
output := make([]BlockInfo, len(all))
for i, one := range all {
set, ok := toCmdValue[one.Type]
if !ok {
set = "<unknown>"
}
output[i] = BlockInfo{
Commands: set,
Message: one.Message,
}
}
return output
} | go | func formatBlockInfo(all []params.Block) []BlockInfo {
output := make([]BlockInfo, len(all))
for i, one := range all {
set, ok := toCmdValue[one.Type]
if !ok {
set = "<unknown>"
}
output[i] = BlockInfo{
Commands: set,
Message: one.Message,
}
}
return output
} | [
"func",
"formatBlockInfo",
"(",
"all",
"[",
"]",
"params",
".",
"Block",
")",
"[",
"]",
"BlockInfo",
"{",
"output",
":=",
"make",
"(",
"[",
"]",
"BlockInfo",
",",
"len",
"(",
"all",
")",
")",
"\n",
"for",
"i",
",",
"one",
":=",
"range",
"all",
"{... | // formatBlockInfo takes a set of Block and creates a
// mapping to information structures. | [
"formatBlockInfo",
"takes",
"a",
"set",
"of",
"Block",
"and",
"creates",
"a",
"mapping",
"to",
"information",
"structures",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/cmd/juju/block/list.go#L159-L172 |
154,263 | juju/juju | cmd/juju/block/list.go | formatBlocks | func formatBlocks(writer io.Writer, value interface{}) error {
blocks, ok := value.([]BlockInfo)
if !ok {
return errors.Errorf("expected value of type %T, got %T", blocks, value)
}
if len(blocks) == 0 {
fmt.Fprintf(writer, "No commands are currently disabled.")
return nil
}
tw := output.TabWriter(writer)
... | go | func formatBlocks(writer io.Writer, value interface{}) error {
blocks, ok := value.([]BlockInfo)
if !ok {
return errors.Errorf("expected value of type %T, got %T", blocks, value)
}
if len(blocks) == 0 {
fmt.Fprintf(writer, "No commands are currently disabled.")
return nil
}
tw := output.TabWriter(writer)
... | [
"func",
"formatBlocks",
"(",
"writer",
"io",
".",
"Writer",
",",
"value",
"interface",
"{",
"}",
")",
"error",
"{",
"blocks",
",",
"ok",
":=",
"value",
".",
"(",
"[",
"]",
"BlockInfo",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"errors",
".",
"Erro... | // formatBlocks writes block list representation. | [
"formatBlocks",
"writes",
"block",
"list",
"representation",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/cmd/juju/block/list.go#L175-L195 |
154,264 | juju/juju | cmd/juju/block/list.go | getControllerAPI | func getControllerAPI(c newControllerAPIRoot) (*controller.Client, error) {
root, err := c.NewControllerAPIRoot()
if err != nil {
return nil, errors.Trace(err)
}
return controller.NewClient(root), nil
} | go | func getControllerAPI(c newControllerAPIRoot) (*controller.Client, error) {
root, err := c.NewControllerAPIRoot()
if err != nil {
return nil, errors.Trace(err)
}
return controller.NewClient(root), nil
} | [
"func",
"getControllerAPI",
"(",
"c",
"newControllerAPIRoot",
")",
"(",
"*",
"controller",
".",
"Client",
",",
"error",
")",
"{",
"root",
",",
"err",
":=",
"c",
".",
"NewControllerAPIRoot",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
... | // getControllerAPI returns a block api for block manipulation. | [
"getControllerAPI",
"returns",
"a",
"block",
"api",
"for",
"block",
"manipulation",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/cmd/juju/block/list.go#L202-L208 |
154,265 | juju/juju | cmd/juju/block/list.go | FormatTabularBlockedModels | func FormatTabularBlockedModels(writer io.Writer, value interface{}) error {
models, ok := value.([]modelBlockInfo)
if !ok {
return errors.Errorf("expected value of type %T, got %T", models, value)
}
tw := output.TabWriter(writer)
w := output.Wrapper{tw}
w.Println("Name", "Model UUID", "Owner", "Disabled comma... | go | func FormatTabularBlockedModels(writer io.Writer, value interface{}) error {
models, ok := value.([]modelBlockInfo)
if !ok {
return errors.Errorf("expected value of type %T, got %T", models, value)
}
tw := output.TabWriter(writer)
w := output.Wrapper{tw}
w.Println("Name", "Model UUID", "Owner", "Disabled comma... | [
"func",
"FormatTabularBlockedModels",
"(",
"writer",
"io",
".",
"Writer",
",",
"value",
"interface",
"{",
"}",
")",
"error",
"{",
"models",
",",
"ok",
":=",
"value",
".",
"(",
"[",
"]",
"modelBlockInfo",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"erro... | // FormatTabularBlockedModels writes out tabular format for blocked models.
// This method is exported as it is also used by destroy-model. | [
"FormatTabularBlockedModels",
"writes",
"out",
"tabular",
"format",
"for",
"blocked",
"models",
".",
"This",
"method",
"is",
"exported",
"as",
"it",
"is",
"also",
"used",
"by",
"destroy",
"-",
"model",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/cmd/juju/block/list.go#L236-L250 |
154,266 | juju/juju | cmd/juju/model/exportbundle.go | NewExportBundleCommand | func NewExportBundleCommand() cmd.Command {
cmd := &exportBundleCommand{}
cmd.newAPIFunc = func() (ExportBundleAPI, error) {
return cmd.getAPI()
}
return modelcmd.Wrap(cmd)
} | go | func NewExportBundleCommand() cmd.Command {
cmd := &exportBundleCommand{}
cmd.newAPIFunc = func() (ExportBundleAPI, error) {
return cmd.getAPI()
}
return modelcmd.Wrap(cmd)
} | [
"func",
"NewExportBundleCommand",
"(",
")",
"cmd",
".",
"Command",
"{",
"cmd",
":=",
"&",
"exportBundleCommand",
"{",
"}",
"\n",
"cmd",
".",
"newAPIFunc",
"=",
"func",
"(",
")",
"(",
"ExportBundleAPI",
",",
"error",
")",
"{",
"return",
"cmd",
".",
"getAP... | // NewExportBundleCommand returns a fully constructed export bundle command. | [
"NewExportBundleCommand",
"returns",
"a",
"fully",
"constructed",
"export",
"bundle",
"command",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/cmd/juju/model/exportbundle.go#L19-L25 |
154,267 | juju/juju | api/logsender/logsender.go | LogWriter | func (api *API) LogWriter() (LogWriter, error) {
attrs := make(url.Values)
attrs.Set("jujuclientversion", version.Current.String())
// Version 1 does ping/pong handling.
attrs.Set("version", "1")
conn, err := api.connector.ConnectStream("/logsink", attrs)
if err != nil {
return nil, errors.Annotatef(err, "canno... | go | func (api *API) LogWriter() (LogWriter, error) {
attrs := make(url.Values)
attrs.Set("jujuclientversion", version.Current.String())
// Version 1 does ping/pong handling.
attrs.Set("version", "1")
conn, err := api.connector.ConnectStream("/logsink", attrs)
if err != nil {
return nil, errors.Annotatef(err, "canno... | [
"func",
"(",
"api",
"*",
"API",
")",
"LogWriter",
"(",
")",
"(",
"LogWriter",
",",
"error",
")",
"{",
"attrs",
":=",
"make",
"(",
"url",
".",
"Values",
")",
"\n",
"attrs",
".",
"Set",
"(",
"\"",
"\"",
",",
"version",
".",
"Current",
".",
"String"... | // LogWriter returns a new log writer interface value
// which must be closed when finished with. | [
"LogWriter",
"returns",
"a",
"new",
"log",
"writer",
"interface",
"value",
"which",
"must",
"be",
"closed",
"when",
"finished",
"with",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/api/logsender/logsender.go#L40-L52 |
154,268 | juju/juju | apiserver/common/controllerconfig.go | ControllerConfig | func (s *ControllerConfigAPI) ControllerConfig() (params.ControllerConfigResult, error) {
result := params.ControllerConfigResult{}
config, err := s.st.ControllerConfig()
if err != nil {
return result, err
}
result.Config = params.ControllerConfig(config)
return result, nil
} | go | func (s *ControllerConfigAPI) ControllerConfig() (params.ControllerConfigResult, error) {
result := params.ControllerConfigResult{}
config, err := s.st.ControllerConfig()
if err != nil {
return result, err
}
result.Config = params.ControllerConfig(config)
return result, nil
} | [
"func",
"(",
"s",
"*",
"ControllerConfigAPI",
")",
"ControllerConfig",
"(",
")",
"(",
"params",
".",
"ControllerConfigResult",
",",
"error",
")",
"{",
"result",
":=",
"params",
".",
"ControllerConfigResult",
"{",
"}",
"\n",
"config",
",",
"err",
":=",
"s",
... | // ControllerConfig returns the controller's configuration. | [
"ControllerConfig",
"returns",
"the",
"controller",
"s",
"configuration",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/common/controllerconfig.go#L33-L41 |
154,269 | juju/juju | apiserver/common/controllerconfig.go | ControllerAPIInfoForModels | func (s *ControllerConfigAPI) ControllerAPIInfoForModels(args params.Entities) (params.ControllerAPIInfoResults, error) {
var result params.ControllerAPIInfoResults
result.Results = make([]params.ControllerAPIInfoResult, len(args.Entities))
for i, entity := range args.Entities {
modelTag, err := names.ParseModelTa... | go | func (s *ControllerConfigAPI) ControllerAPIInfoForModels(args params.Entities) (params.ControllerAPIInfoResults, error) {
var result params.ControllerAPIInfoResults
result.Results = make([]params.ControllerAPIInfoResult, len(args.Entities))
for i, entity := range args.Entities {
modelTag, err := names.ParseModelTa... | [
"func",
"(",
"s",
"*",
"ControllerConfigAPI",
")",
"ControllerAPIInfoForModels",
"(",
"args",
"params",
".",
"Entities",
")",
"(",
"params",
".",
"ControllerAPIInfoResults",
",",
"error",
")",
"{",
"var",
"result",
"params",
".",
"ControllerAPIInfoResults",
"\n",
... | // ControllerAPIInfoForModels returns the controller api connection details for the specified models. | [
"ControllerAPIInfoForModels",
"returns",
"the",
"controller",
"api",
"connection",
"details",
"for",
"the",
"specified",
"models",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/common/controllerconfig.go#L44-L62 |
154,270 | juju/juju | apiserver/common/controllerconfig.go | ControllerInfo | func (s *controllerStateShim) ControllerInfo(modelUUID string) (addrs []string, CACert string, _ error) {
// First see if the requested model UUID is hosted by this controller.
modelExists, err := s.State.ModelExists(modelUUID)
if err != nil {
return nil, "", errors.Trace(err)
}
if modelExists {
return StateCo... | go | func (s *controllerStateShim) ControllerInfo(modelUUID string) (addrs []string, CACert string, _ error) {
// First see if the requested model UUID is hosted by this controller.
modelExists, err := s.State.ModelExists(modelUUID)
if err != nil {
return nil, "", errors.Trace(err)
}
if modelExists {
return StateCo... | [
"func",
"(",
"s",
"*",
"controllerStateShim",
")",
"ControllerInfo",
"(",
"modelUUID",
"string",
")",
"(",
"addrs",
"[",
"]",
"string",
",",
"CACert",
"string",
",",
"_",
"error",
")",
"{",
"// First see if the requested model UUID is hosted by this controller.",
"m... | // ControllerInfo returns the external controller details for the specified model. | [
"ControllerInfo",
"returns",
"the",
"external",
"controller",
"details",
"for",
"the",
"specified",
"model",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/common/controllerconfig.go#L69-L86 |
154,271 | juju/juju | apiserver/common/controllerconfig.go | StateControllerInfo | func StateControllerInfo(st *state.State) (addrs []string, caCert string, _ error) {
addr, err := apiAddresses(st)
if err != nil {
return nil, "", errors.Trace(err)
}
controllerConfig, err := st.ControllerConfig()
if err != nil {
return nil, "", errors.Trace(err)
}
caCert, _ = controllerConfig.CACert()
retu... | go | func StateControllerInfo(st *state.State) (addrs []string, caCert string, _ error) {
addr, err := apiAddresses(st)
if err != nil {
return nil, "", errors.Trace(err)
}
controllerConfig, err := st.ControllerConfig()
if err != nil {
return nil, "", errors.Trace(err)
}
caCert, _ = controllerConfig.CACert()
retu... | [
"func",
"StateControllerInfo",
"(",
"st",
"*",
"state",
".",
"State",
")",
"(",
"addrs",
"[",
"]",
"string",
",",
"caCert",
"string",
",",
"_",
"error",
")",
"{",
"addr",
",",
"err",
":=",
"apiAddresses",
"(",
"st",
")",
"\n",
"if",
"err",
"!=",
"n... | // StateControllerInfo returns the local controller details for the given State. | [
"StateControllerInfo",
"returns",
"the",
"local",
"controller",
"details",
"for",
"the",
"given",
"State",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/common/controllerconfig.go#L89-L100 |
154,272 | juju/juju | cmd/juju/cloud/showcredential.go | NewShowCredentialCommand | func NewShowCredentialCommand() cmd.Command {
cmd := &showCredentialCommand{
store: jujuclient.NewFileClientStore(),
}
cmd.newAPIFunc = func() (CredentialContentAPI, error) {
return cmd.NewCredentialAPI()
}
return modelcmd.WrapBase(cmd)
} | go | func NewShowCredentialCommand() cmd.Command {
cmd := &showCredentialCommand{
store: jujuclient.NewFileClientStore(),
}
cmd.newAPIFunc = func() (CredentialContentAPI, error) {
return cmd.NewCredentialAPI()
}
return modelcmd.WrapBase(cmd)
} | [
"func",
"NewShowCredentialCommand",
"(",
")",
"cmd",
".",
"Command",
"{",
"cmd",
":=",
"&",
"showCredentialCommand",
"{",
"store",
":",
"jujuclient",
".",
"NewFileClientStore",
"(",
")",
",",
"}",
"\n",
"cmd",
".",
"newAPIFunc",
"=",
"func",
"(",
")",
"(",... | // NewShowCredentialCommand returns a command to show information about
// credentials stored on the controller. | [
"NewShowCredentialCommand",
"returns",
"a",
"command",
"to",
"show",
"information",
"about",
"credentials",
"stored",
"on",
"the",
"controller",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/cmd/juju/cloud/showcredential.go#L34-L42 |
154,273 | juju/juju | apiserver/facades/client/modelgeneration/modelgeneration.go | NewModelGenerationFacade | func NewModelGenerationFacade(ctx facade.Context) (*API, error) {
authorizer := ctx.Auth()
st := &stateShim{State: ctx.State()}
m, err := st.Model()
if err != nil {
return nil, errors.Trace(err)
}
return NewModelGenerationAPI(st, authorizer, m)
} | go | func NewModelGenerationFacade(ctx facade.Context) (*API, error) {
authorizer := ctx.Auth()
st := &stateShim{State: ctx.State()}
m, err := st.Model()
if err != nil {
return nil, errors.Trace(err)
}
return NewModelGenerationAPI(st, authorizer, m)
} | [
"func",
"NewModelGenerationFacade",
"(",
"ctx",
"facade",
".",
"Context",
")",
"(",
"*",
"API",
",",
"error",
")",
"{",
"authorizer",
":=",
"ctx",
".",
"Auth",
"(",
")",
"\n",
"st",
":=",
"&",
"stateShim",
"{",
"State",
":",
"ctx",
".",
"State",
"(",... | // NewModelGenerationFacade provides the signature required for facade registration. | [
"NewModelGenerationFacade",
"provides",
"the",
"signature",
"required",
"for",
"facade",
"registration",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/client/modelgeneration/modelgeneration.go#L35-L43 |
154,274 | juju/juju | apiserver/facades/client/modelgeneration/modelgeneration.go | NewModelGenerationAPI | func NewModelGenerationAPI(
st State,
authorizer facade.Authorizer,
m Model,
) (*API, error) {
if !authorizer.AuthClient() {
return nil, common.ErrPerm
}
// Since we know this is a user tag (because AuthClient is true),
// we just do the type assertion to the UserTag.
apiUser, _ := authorizer.GetAuthTag().(na... | go | func NewModelGenerationAPI(
st State,
authorizer facade.Authorizer,
m Model,
) (*API, error) {
if !authorizer.AuthClient() {
return nil, common.ErrPerm
}
// Since we know this is a user tag (because AuthClient is true),
// we just do the type assertion to the UserTag.
apiUser, _ := authorizer.GetAuthTag().(na... | [
"func",
"NewModelGenerationAPI",
"(",
"st",
"State",
",",
"authorizer",
"facade",
".",
"Authorizer",
",",
"m",
"Model",
",",
")",
"(",
"*",
"API",
",",
"error",
")",
"{",
"if",
"!",
"authorizer",
".",
"AuthClient",
"(",
")",
"{",
"return",
"nil",
",",
... | // NewModelGenerationAPI creates a new API endpoint for dealing with model generations. | [
"NewModelGenerationAPI",
"creates",
"a",
"new",
"API",
"endpoint",
"for",
"dealing",
"with",
"model",
"generations",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/client/modelgeneration/modelgeneration.go#L46-L71 |
154,275 | juju/juju | apiserver/facades/client/modelgeneration/modelgeneration.go | AddBranch | func (api *API) AddBranch(arg params.BranchArg) (params.ErrorResult, error) {
result := params.ErrorResult{}
isModelAdmin, err := api.hasAdminAccess()
if err != nil {
return result, errors.Trace(err)
}
if !isModelAdmin && !api.isControllerAdmin {
return result, common.ErrPerm
}
if err := model.ValidateBranc... | go | func (api *API) AddBranch(arg params.BranchArg) (params.ErrorResult, error) {
result := params.ErrorResult{}
isModelAdmin, err := api.hasAdminAccess()
if err != nil {
return result, errors.Trace(err)
}
if !isModelAdmin && !api.isControllerAdmin {
return result, common.ErrPerm
}
if err := model.ValidateBranc... | [
"func",
"(",
"api",
"*",
"API",
")",
"AddBranch",
"(",
"arg",
"params",
".",
"BranchArg",
")",
"(",
"params",
".",
"ErrorResult",
",",
"error",
")",
"{",
"result",
":=",
"params",
".",
"ErrorResult",
"{",
"}",
"\n",
"isModelAdmin",
",",
"err",
":=",
... | // AddBranch adds a new branch with the input name to the model. | [
"AddBranch",
"adds",
"a",
"new",
"branch",
"with",
"the",
"input",
"name",
"to",
"the",
"model",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/client/modelgeneration/modelgeneration.go#L82-L98 |
154,276 | juju/juju | apiserver/facades/client/modelgeneration/modelgeneration.go | CommitBranch | func (api *API) CommitBranch(arg params.BranchArg) (params.IntResult, error) {
result := params.IntResult{}
isModelAdmin, err := api.hasAdminAccess()
if err != nil {
return result, errors.Trace(err)
}
if !isModelAdmin && !api.isControllerAdmin {
return result, common.ErrPerm
}
generation, err := api.model.... | go | func (api *API) CommitBranch(arg params.BranchArg) (params.IntResult, error) {
result := params.IntResult{}
isModelAdmin, err := api.hasAdminAccess()
if err != nil {
return result, errors.Trace(err)
}
if !isModelAdmin && !api.isControllerAdmin {
return result, common.ErrPerm
}
generation, err := api.model.... | [
"func",
"(",
"api",
"*",
"API",
")",
"CommitBranch",
"(",
"arg",
"params",
".",
"BranchArg",
")",
"(",
"params",
".",
"IntResult",
",",
"error",
")",
"{",
"result",
":=",
"params",
".",
"IntResult",
"{",
"}",
"\n\n",
"isModelAdmin",
",",
"err",
":=",
... | // CommitBranch commits the input branch, making its changes applicable to
// the whole model and marking it complete. | [
"CommitBranch",
"commits",
"the",
"input",
"branch",
"making",
"its",
"changes",
"applicable",
"to",
"the",
"whole",
"model",
"and",
"marking",
"it",
"complete",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/client/modelgeneration/modelgeneration.go#L140-L162 |
154,277 | juju/juju | apiserver/facades/client/modelgeneration/modelgeneration.go | BranchInfo | func (api *API) BranchInfo(args params.BranchInfoArgs) (params.GenerationResults, error) {
result := params.GenerationResults{}
isModelAdmin, err := api.hasAdminAccess()
if err != nil {
return result, errors.Trace(err)
}
if !isModelAdmin && !api.isControllerAdmin {
return result, common.ErrPerm
}
// From c... | go | func (api *API) BranchInfo(args params.BranchInfoArgs) (params.GenerationResults, error) {
result := params.GenerationResults{}
isModelAdmin, err := api.hasAdminAccess()
if err != nil {
return result, errors.Trace(err)
}
if !isModelAdmin && !api.isControllerAdmin {
return result, common.ErrPerm
}
// From c... | [
"func",
"(",
"api",
"*",
"API",
")",
"BranchInfo",
"(",
"args",
"params",
".",
"BranchInfoArgs",
")",
"(",
"params",
".",
"GenerationResults",
",",
"error",
")",
"{",
"result",
":=",
"params",
".",
"GenerationResults",
"{",
"}",
"\n\n",
"isModelAdmin",
","... | // BranchInfo will return details of branch identified by the input argument,
// including units on the branch and the configuration disjoint with the
// master generation.
// An error is returned if no in-flight branch matching in input is found. | [
"BranchInfo",
"will",
"return",
"details",
"of",
"branch",
"identified",
"by",
"the",
"input",
"argument",
"including",
"units",
"on",
"the",
"branch",
"and",
"the",
"configuration",
"disjoint",
"with",
"the",
"master",
"generation",
".",
"An",
"error",
"is",
... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/client/modelgeneration/modelgeneration.go#L168-L204 |
154,278 | juju/juju | apiserver/facades/client/modelgeneration/modelgeneration.go | HasActiveBranch | func (api *API) HasActiveBranch(arg params.BranchArg) (params.BoolResult, error) {
result := params.BoolResult{}
isModelAdmin, err := api.hasAdminAccess()
if err != nil {
return result, errors.Trace(err)
}
if !isModelAdmin && !api.isControllerAdmin {
return result, common.ErrPerm
}
if _, err := api.model.Br... | go | func (api *API) HasActiveBranch(arg params.BranchArg) (params.BoolResult, error) {
result := params.BoolResult{}
isModelAdmin, err := api.hasAdminAccess()
if err != nil {
return result, errors.Trace(err)
}
if !isModelAdmin && !api.isControllerAdmin {
return result, common.ErrPerm
}
if _, err := api.model.Br... | [
"func",
"(",
"api",
"*",
"API",
")",
"HasActiveBranch",
"(",
"arg",
"params",
".",
"BranchArg",
")",
"(",
"params",
".",
"BoolResult",
",",
"error",
")",
"{",
"result",
":=",
"params",
".",
"BoolResult",
"{",
"}",
"\n",
"isModelAdmin",
",",
"err",
":="... | // HasActiveBranch returns a true result if the input model has an "in-flight"
// branch matching the input name. | [
"HasActiveBranch",
"returns",
"a",
"true",
"result",
"if",
"the",
"input",
"model",
"has",
"an",
"in",
"-",
"flight",
"branch",
"matching",
"the",
"input",
"name",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/client/modelgeneration/modelgeneration.go#L256-L276 |
154,279 | juju/juju | provider/openstack/provider.go | newGooseClient | func newGooseClient(endpoint string) client.AuthenticatingClient {
// Use NonValidatingClient, in case the endpoint is behind a cert
return client.NewNonValidatingClient(&identity.Credentials{URL: endpoint}, 0, nil)
} | go | func newGooseClient(endpoint string) client.AuthenticatingClient {
// Use NonValidatingClient, in case the endpoint is behind a cert
return client.NewNonValidatingClient(&identity.Credentials{URL: endpoint}, 0, nil)
} | [
"func",
"newGooseClient",
"(",
"endpoint",
"string",
")",
"client",
".",
"AuthenticatingClient",
"{",
"// Use NonValidatingClient, in case the endpoint is behind a cert",
"return",
"client",
".",
"NewNonValidatingClient",
"(",
"&",
"identity",
".",
"Credentials",
"{",
"URL"... | // newGooseClient is the default function in EnvironProvider.ClientFromEndpoint. | [
"newGooseClient",
"is",
"the",
"default",
"function",
"in",
"EnvironProvider",
".",
"ClientFromEndpoint",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L238-L241 |
154,280 | juju/juju | provider/openstack/provider.go | getAddresses | func (inst *openstackInstance) getAddresses(ctx context.ProviderCallContext) (map[string][]nova.IPAddress, error) {
addrs := inst.getServerDetail().Addresses
if len(addrs) == 0 {
server, err := inst.e.nova().GetServer(string(inst.Id()))
if err != nil {
common.HandleCredentialError(IsAuthorisationFailure, err, ... | go | func (inst *openstackInstance) getAddresses(ctx context.ProviderCallContext) (map[string][]nova.IPAddress, error) {
addrs := inst.getServerDetail().Addresses
if len(addrs) == 0 {
server, err := inst.e.nova().GetServer(string(inst.Id()))
if err != nil {
common.HandleCredentialError(IsAuthorisationFailure, err, ... | [
"func",
"(",
"inst",
"*",
"openstackInstance",
")",
"getAddresses",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
")",
"(",
"map",
"[",
"string",
"]",
"[",
"]",
"nova",
".",
"IPAddress",
",",
"error",
")",
"{",
"addrs",
":=",
"inst",
".",
"getServer... | // getAddresses returns the existing server information on addresses,
// but fetches the details over the api again if no addresses exist. | [
"getAddresses",
"returns",
"the",
"existing",
"server",
"information",
"on",
"addresses",
"but",
"fetches",
"the",
"details",
"over",
"the",
"api",
"again",
"if",
"no",
"addresses",
"exist",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L410-L421 |
154,281 | juju/juju | provider/openstack/provider.go | convertNovaAddresses | func convertNovaAddresses(publicIP string, addresses map[string][]nova.IPAddress) []network.Address {
var machineAddresses []network.Address
if publicIP != "" {
publicAddr := network.NewScopedAddress(publicIP, network.ScopePublic)
machineAddresses = append(machineAddresses, publicAddr)
}
// TODO(gz) Network ord... | go | func convertNovaAddresses(publicIP string, addresses map[string][]nova.IPAddress) []network.Address {
var machineAddresses []network.Address
if publicIP != "" {
publicAddr := network.NewScopedAddress(publicIP, network.ScopePublic)
machineAddresses = append(machineAddresses, publicAddr)
}
// TODO(gz) Network ord... | [
"func",
"convertNovaAddresses",
"(",
"publicIP",
"string",
",",
"addresses",
"map",
"[",
"string",
"]",
"[",
"]",
"nova",
".",
"IPAddress",
")",
"[",
"]",
"network",
".",
"Address",
"{",
"var",
"machineAddresses",
"[",
"]",
"network",
".",
"Address",
"\n",... | // convertNovaAddresses returns nova addresses in generic format | [
"convertNovaAddresses",
"returns",
"nova",
"addresses",
"in",
"generic",
"format"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L439-L471 |
154,282 | juju/juju | provider/openstack/provider.go | AvailabilityZones | func (e *Environ) AvailabilityZones(ctx context.ProviderCallContext) ([]common.AvailabilityZone, error) {
e.availabilityZonesMutex.Lock()
defer e.availabilityZonesMutex.Unlock()
if e.availabilityZones == nil {
zones, err := novaListAvailabilityZones(e.nova())
if gooseerrors.IsNotImplemented(err) {
return nil,... | go | func (e *Environ) AvailabilityZones(ctx context.ProviderCallContext) ([]common.AvailabilityZone, error) {
e.availabilityZonesMutex.Lock()
defer e.availabilityZonesMutex.Unlock()
if e.availabilityZones == nil {
zones, err := novaListAvailabilityZones(e.nova())
if gooseerrors.IsNotImplemented(err) {
return nil,... | [
"func",
"(",
"e",
"*",
"Environ",
")",
"AvailabilityZones",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
")",
"(",
"[",
"]",
"common",
".",
"AvailabilityZone",
",",
"error",
")",
"{",
"e",
".",
"availabilityZonesMutex",
".",
"Lock",
"(",
")",
"\n",
... | // AvailabilityZones returns a slice of availability zones. | [
"AvailabilityZones",
"returns",
"a",
"slice",
"of",
"availability",
"zones",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L562-L580 |
154,283 | juju/juju | provider/openstack/provider.go | newClientByType | func newClientByType(
cred identity.Credentials,
authMode identity.AuthMode,
gooseLogger gooselogging.CompatLogger,
sslHostnameVerification bool,
certs []string,
) (client.AuthenticatingClient, error) {
switch {
case len(certs) > 0:
tlsConfig := tlsConfig(certs)
logger.Tracef("using NewClientTLSConfig")
re... | go | func newClientByType(
cred identity.Credentials,
authMode identity.AuthMode,
gooseLogger gooselogging.CompatLogger,
sslHostnameVerification bool,
certs []string,
) (client.AuthenticatingClient, error) {
switch {
case len(certs) > 0:
tlsConfig := tlsConfig(certs)
logger.Tracef("using NewClientTLSConfig")
re... | [
"func",
"newClientByType",
"(",
"cred",
"identity",
".",
"Credentials",
",",
"authMode",
"identity",
".",
"AuthMode",
",",
"gooseLogger",
"gooselogging",
".",
"CompatLogger",
",",
"sslHostnameVerification",
"bool",
",",
"certs",
"[",
"]",
"string",
",",
")",
"("... | // newClientByType returns an authenticating client to talk to the
// OpenStack cloud. CACertificate and SSLHostnameVerification == false
// config options are mutually exclusive here. | [
"newClientByType",
"returns",
"an",
"authenticating",
"client",
"to",
"talk",
"to",
"the",
"OpenStack",
"cloud",
".",
"CACertificate",
"and",
"SSLHostnameVerification",
"==",
"false",
"config",
"options",
"are",
"mutually",
"exclusive",
"here",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L830-L849 |
154,284 | juju/juju | provider/openstack/provider.go | getKeystoneImageSource | func getKeystoneImageSource(env environs.Environ) (simplestreams.DataSource, error) {
e, ok := env.(*Environ)
if !ok {
return nil, errors.NotSupportedf("non-openstack model")
}
return e.getKeystoneDataSource(&e.keystoneImageDataSourceMutex, &e.keystoneImageDataSource, "product-streams")
} | go | func getKeystoneImageSource(env environs.Environ) (simplestreams.DataSource, error) {
e, ok := env.(*Environ)
if !ok {
return nil, errors.NotSupportedf("non-openstack model")
}
return e.getKeystoneDataSource(&e.keystoneImageDataSourceMutex, &e.keystoneImageDataSource, "product-streams")
} | [
"func",
"getKeystoneImageSource",
"(",
"env",
"environs",
".",
"Environ",
")",
"(",
"simplestreams",
".",
"DataSource",
",",
"error",
")",
"{",
"e",
",",
"ok",
":=",
"env",
".",
"(",
"*",
"Environ",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
"... | // getKeystoneImageSource is an imagemetadata.ImageDataSourceFunc that
// returns a DataSource using the "product-streams" keystone URL. | [
"getKeystoneImageSource",
"is",
"an",
"imagemetadata",
".",
"ImageDataSourceFunc",
"that",
"returns",
"a",
"DataSource",
"using",
"the",
"product",
"-",
"streams",
"keystone",
"URL",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L956-L962 |
154,285 | juju/juju | provider/openstack/provider.go | getKeystoneToolsSource | func getKeystoneToolsSource(env environs.Environ) (simplestreams.DataSource, error) {
e, ok := env.(*Environ)
if !ok {
return nil, errors.NotSupportedf("non-openstack model")
}
return e.getKeystoneDataSource(&e.keystoneToolsDataSourceMutex, &e.keystoneToolsDataSource, "juju-tools")
} | go | func getKeystoneToolsSource(env environs.Environ) (simplestreams.DataSource, error) {
e, ok := env.(*Environ)
if !ok {
return nil, errors.NotSupportedf("non-openstack model")
}
return e.getKeystoneDataSource(&e.keystoneToolsDataSourceMutex, &e.keystoneToolsDataSource, "juju-tools")
} | [
"func",
"getKeystoneToolsSource",
"(",
"env",
"environs",
".",
"Environ",
")",
"(",
"simplestreams",
".",
"DataSource",
",",
"error",
")",
"{",
"e",
",",
"ok",
":=",
"env",
".",
"(",
"*",
"Environ",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
"... | // getKeystoneToolsSource is a tools.ToolsDataSourceFunc that
// returns a DataSource using the "juju-tools" keystone URL. | [
"getKeystoneToolsSource",
"is",
"a",
"tools",
".",
"ToolsDataSourceFunc",
"that",
"returns",
"a",
"DataSource",
"using",
"the",
"juju",
"-",
"tools",
"keystone",
"URL",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L966-L972 |
154,286 | juju/juju | provider/openstack/provider.go | assignPublicIP | func (e *Environ) assignPublicIP(fip *string, serverId string) (err error) {
if *fip == "" {
return errors.Errorf("cannot assign a nil public IP to %q", serverId)
}
// At startup nw_info is not yet cached so this may fail
// temporarily while the server is being built
for a := common.LongAttempt.Start(); a.Next(... | go | func (e *Environ) assignPublicIP(fip *string, serverId string) (err error) {
if *fip == "" {
return errors.Errorf("cannot assign a nil public IP to %q", serverId)
}
// At startup nw_info is not yet cached so this may fail
// temporarily while the server is being built
for a := common.LongAttempt.Start(); a.Next(... | [
"func",
"(",
"e",
"*",
"Environ",
")",
"assignPublicIP",
"(",
"fip",
"*",
"string",
",",
"serverId",
"string",
")",
"(",
"err",
"error",
")",
"{",
"if",
"*",
"fip",
"==",
"\"",
"\"",
"{",
"return",
"errors",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"... | // assignPublicIP tries to assign the given floating IP address to the
// specified server, or returns an error. | [
"assignPublicIP",
"tries",
"to",
"assign",
"the",
"given",
"floating",
"IP",
"address",
"to",
"the",
"specified",
"server",
"or",
"returns",
"an",
"error",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L1002-L1015 |
154,287 | juju/juju | provider/openstack/provider.go | MaintainInstance | func (*Environ) MaintainInstance(ctx context.ProviderCallContext, args environs.StartInstanceParams) error {
return nil
} | go | func (*Environ) MaintainInstance(ctx context.ProviderCallContext, args environs.StartInstanceParams) error {
return nil
} | [
"func",
"(",
"*",
"Environ",
")",
"MaintainInstance",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
",",
"args",
"environs",
".",
"StartInstanceParams",
")",
"error",
"{",
"return",
"nil",
"\n",
"}"
] | // MaintainInstance is specified in the InstanceBroker interface. | [
"MaintainInstance",
"is",
"specified",
"in",
"the",
"InstanceBroker",
"interface",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L1032-L1034 |
154,288 | juju/juju | provider/openstack/provider.go | updateFloatingIPAddresses | func (e *Environ) updateFloatingIPAddresses(ctx context.ProviderCallContext, instances map[string]instances.Instance) error {
servers, err := e.nova().ListServersDetail(jujuMachineFilter())
if err != nil {
common.HandleCredentialError(IsAuthorisationFailure, err, ctx)
return err
}
for _, server := range servers... | go | func (e *Environ) updateFloatingIPAddresses(ctx context.ProviderCallContext, instances map[string]instances.Instance) error {
servers, err := e.nova().ListServersDetail(jujuMachineFilter())
if err != nil {
common.HandleCredentialError(IsAuthorisationFailure, err, ctx)
return err
}
for _, server := range servers... | [
"func",
"(",
"e",
"*",
"Environ",
")",
"updateFloatingIPAddresses",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
",",
"instances",
"map",
"[",
"string",
"]",
"instances",
".",
"Instance",
")",
"error",
"{",
"servers",
",",
"err",
":=",
"e",
".",
"nov... | // updateFloatingIPAddresses updates the instances with any floating IP address
// that have been assigned to those instances. | [
"updateFloatingIPAddresses",
"updates",
"the",
"instances",
"with",
"any",
"floating",
"IP",
"address",
"that",
"have",
"been",
"assigned",
"to",
"those",
"instances",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L1494-L1515 |
154,289 | juju/juju | provider/openstack/provider.go | AllInstances | func (e *Environ) AllInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) {
tagFilter := tagValue{tags.JujuModel, e.ecfg().UUID()}
instances, err := e.allInstances(ctx, tagFilter, e.ecfg().useFloatingIP())
if err != nil {
common.HandleCredentialError(IsAuthorisationFailure, err, ctx)
return i... | go | func (e *Environ) AllInstances(ctx context.ProviderCallContext) ([]instances.Instance, error) {
tagFilter := tagValue{tags.JujuModel, e.ecfg().UUID()}
instances, err := e.allInstances(ctx, tagFilter, e.ecfg().useFloatingIP())
if err != nil {
common.HandleCredentialError(IsAuthorisationFailure, err, ctx)
return i... | [
"func",
"(",
"e",
"*",
"Environ",
")",
"AllInstances",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
")",
"(",
"[",
"]",
"instances",
".",
"Instance",
",",
"error",
")",
"{",
"tagFilter",
":=",
"tagValue",
"{",
"tags",
".",
"JujuModel",
",",
"e",
... | // AllInstances returns all instances in this environment. | [
"AllInstances",
"returns",
"all",
"instances",
"in",
"this",
"environment",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L1655-L1663 |
154,290 | juju/juju | provider/openstack/provider.go | destroyControllerManagedEnvirons | func (e *Environ) destroyControllerManagedEnvirons(ctx context.ProviderCallContext, controllerUUID string) error {
// Terminate all instances managed by the controller.
insts, err := e.allControllerManagedInstances(ctx, controllerUUID, false)
if err != nil {
return errors.Annotate(err, "listing instances")
}
ins... | go | func (e *Environ) destroyControllerManagedEnvirons(ctx context.ProviderCallContext, controllerUUID string) error {
// Terminate all instances managed by the controller.
insts, err := e.allControllerManagedInstances(ctx, controllerUUID, false)
if err != nil {
return errors.Annotate(err, "listing instances")
}
ins... | [
"func",
"(",
"e",
"*",
"Environ",
")",
"destroyControllerManagedEnvirons",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
",",
"controllerUUID",
"string",
")",
"error",
"{",
"// Terminate all instances managed by the controller.",
"insts",
",",
"err",
":=",
"e",
"... | // destroyControllerManagedEnvirons destroys all environments managed by this
// models's controller. | [
"destroyControllerManagedEnvirons",
"destroys",
"all",
"environments",
"managed",
"by",
"this",
"models",
"s",
"controller",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L1749-L1789 |
154,291 | juju/juju | provider/openstack/provider.go | jujuMachineFilter | func jujuMachineFilter() *nova.Filter {
filter := nova.NewFilter()
filter.Set(nova.FilterServer, "juju-.*")
return filter
} | go | func jujuMachineFilter() *nova.Filter {
filter := nova.NewFilter()
filter.Set(nova.FilterServer, "juju-.*")
return filter
} | [
"func",
"jujuMachineFilter",
"(",
")",
"*",
"nova",
".",
"Filter",
"{",
"filter",
":=",
"nova",
".",
"NewFilter",
"(",
")",
"\n",
"filter",
".",
"Set",
"(",
"nova",
".",
"FilterServer",
",",
"\"",
"\"",
")",
"\n",
"return",
"filter",
"\n",
"}"
] | // jujuMachineFilter returns a nova.Filter matching machines created by Juju.
// The machines are not filtered to any particular environment. To do that,
// instance tags must be compared. | [
"jujuMachineFilter",
"returns",
"a",
"nova",
".",
"Filter",
"matching",
"machines",
"created",
"by",
"Juju",
".",
"The",
"machines",
"are",
"not",
"filtered",
"to",
"any",
"particular",
"environment",
".",
"To",
"do",
"that",
"instance",
"tags",
"must",
"be",
... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L1798-L1802 |
154,292 | juju/juju | provider/openstack/provider.go | rulesToRuleInfo | func rulesToRuleInfo(groupId string, rules []network.IngressRule) []neutron.RuleInfoV2 {
var result []neutron.RuleInfoV2
for _, r := range rules {
ruleInfo := neutron.RuleInfoV2{
Direction: "ingress",
ParentGroupId: groupId,
PortRangeMin: r.FromPort,
PortRangeMax: r.ToPort,
IPProtocol: r.Pro... | go | func rulesToRuleInfo(groupId string, rules []network.IngressRule) []neutron.RuleInfoV2 {
var result []neutron.RuleInfoV2
for _, r := range rules {
ruleInfo := neutron.RuleInfoV2{
Direction: "ingress",
ParentGroupId: groupId,
PortRangeMin: r.FromPort,
PortRangeMax: r.ToPort,
IPProtocol: r.Pro... | [
"func",
"rulesToRuleInfo",
"(",
"groupId",
"string",
",",
"rules",
"[",
"]",
"network",
".",
"IngressRule",
")",
"[",
"]",
"neutron",
".",
"RuleInfoV2",
"{",
"var",
"result",
"[",
"]",
"neutron",
".",
"RuleInfoV2",
"\n",
"for",
"_",
",",
"r",
":=",
"ra... | // rulesToRuleInfo maps ingress rules to nova rules | [
"rulesToRuleInfo",
"maps",
"ingress",
"rules",
"to",
"nova",
"rules"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L1805-L1825 |
154,293 | juju/juju | provider/openstack/provider.go | TagInstance | func (e *Environ) TagInstance(ctx context.ProviderCallContext, id instance.Id, tags map[string]string) error {
if err := e.nova().SetServerMetadata(string(id), tags); err != nil {
common.HandleCredentialError(IsAuthorisationFailure, err, ctx)
return errors.Annotate(err, "setting server metadata")
}
return nil
} | go | func (e *Environ) TagInstance(ctx context.ProviderCallContext, id instance.Id, tags map[string]string) error {
if err := e.nova().SetServerMetadata(string(id), tags); err != nil {
common.HandleCredentialError(IsAuthorisationFailure, err, ctx)
return errors.Annotate(err, "setting server metadata")
}
return nil
} | [
"func",
"(",
"e",
"*",
"Environ",
")",
"TagInstance",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
",",
"id",
"instance",
".",
"Id",
",",
"tags",
"map",
"[",
"string",
"]",
"string",
")",
"error",
"{",
"if",
"err",
":=",
"e",
".",
"nova",
"(",
... | // TagInstance implements environs.InstanceTagger. | [
"TagInstance",
"implements",
"environs",
".",
"InstanceTagger",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L1908-L1914 |
154,294 | juju/juju | provider/openstack/provider.go | Subnets | func (e *Environ) Subnets(ctx context.ProviderCallContext, instId instance.Id, subnetIds []network.Id) ([]network.SubnetInfo, error) {
subnets, err := e.networking.Subnets(instId, subnetIds)
if err != nil {
common.HandleCredentialError(IsAuthorisationFailure, err, ctx)
return subnets, errors.Trace(err)
}
return... | go | func (e *Environ) Subnets(ctx context.ProviderCallContext, instId instance.Id, subnetIds []network.Id) ([]network.SubnetInfo, error) {
subnets, err := e.networking.Subnets(instId, subnetIds)
if err != nil {
common.HandleCredentialError(IsAuthorisationFailure, err, ctx)
return subnets, errors.Trace(err)
}
return... | [
"func",
"(",
"e",
"*",
"Environ",
")",
"Subnets",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
",",
"instId",
"instance",
".",
"Id",
",",
"subnetIds",
"[",
"]",
"network",
".",
"Id",
")",
"(",
"[",
"]",
"network",
".",
"SubnetInfo",
",",
"error",... | // Subnets is specified on environs.Networking. | [
"Subnets",
"is",
"specified",
"on",
"environs",
".",
"Networking",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L1948-L1955 |
154,295 | juju/juju | provider/openstack/provider.go | NetworkInterfaces | func (e *Environ) NetworkInterfaces(ctx context.ProviderCallContext, instId instance.Id) ([]network.InterfaceInfo, error) {
infos, err := e.networking.NetworkInterfaces(instId)
if err != nil {
common.HandleCredentialError(IsAuthorisationFailure, err, ctx)
return infos, errors.Trace(err)
}
return infos, nil
} | go | func (e *Environ) NetworkInterfaces(ctx context.ProviderCallContext, instId instance.Id) ([]network.InterfaceInfo, error) {
infos, err := e.networking.NetworkInterfaces(instId)
if err != nil {
common.HandleCredentialError(IsAuthorisationFailure, err, ctx)
return infos, errors.Trace(err)
}
return infos, nil
} | [
"func",
"(",
"e",
"*",
"Environ",
")",
"NetworkInterfaces",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
",",
"instId",
"instance",
".",
"Id",
")",
"(",
"[",
"]",
"network",
".",
"InterfaceInfo",
",",
"error",
")",
"{",
"infos",
",",
"err",
":=",
... | // NetworkInterfaces is specified on environs.Networking. | [
"NetworkInterfaces",
"is",
"specified",
"on",
"environs",
".",
"Networking",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L1958-L1965 |
154,296 | juju/juju | provider/openstack/provider.go | SuperSubnets | func (e *Environ) SuperSubnets(ctx context.ProviderCallContext) ([]string, error) {
subnets, err := e.networking.Subnets("", nil)
if err != nil {
common.HandleCredentialError(IsAuthorisationFailure, err, ctx)
return nil, err
}
cidrs := make([]string, len(subnets))
for i, subnet := range subnets {
cidrs[i] = ... | go | func (e *Environ) SuperSubnets(ctx context.ProviderCallContext) ([]string, error) {
subnets, err := e.networking.Subnets("", nil)
if err != nil {
common.HandleCredentialError(IsAuthorisationFailure, err, ctx)
return nil, err
}
cidrs := make([]string, len(subnets))
for i, subnet := range subnets {
cidrs[i] = ... | [
"func",
"(",
"e",
"*",
"Environ",
")",
"SuperSubnets",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"subnets",
",",
"err",
":=",
"e",
".",
"networking",
".",
"Subnets",
"(",
"\"",
"\"",
",",... | // SuperSubnets is specified on environs.Networking | [
"SuperSubnets",
"is",
"specified",
"on",
"environs",
".",
"Networking"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L1988-L1999 |
154,297 | juju/juju | provider/openstack/provider.go | SSHAddresses | func (*Environ) SSHAddresses(ctx context.ProviderCallContext, addresses []network.Address) ([]network.Address, error) {
return addresses, nil
} | go | func (*Environ) SSHAddresses(ctx context.ProviderCallContext, addresses []network.Address) ([]network.Address, error) {
return addresses, nil
} | [
"func",
"(",
"*",
"Environ",
")",
"SSHAddresses",
"(",
"ctx",
"context",
".",
"ProviderCallContext",
",",
"addresses",
"[",
"]",
"network",
".",
"Address",
")",
"(",
"[",
"]",
"network",
".",
"Address",
",",
"error",
")",
"{",
"return",
"addresses",
",",... | // SSHAddresses is specified on environs.SSHAddresses. | [
"SSHAddresses",
"is",
"specified",
"on",
"environs",
".",
"SSHAddresses",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/openstack/provider.go#L2022-L2024 |
154,298 | juju/juju | cmd/juju/application/removesaas.go | NewRemoveSaasCommand | func NewRemoveSaasCommand() cmd.Command {
cmd := &removeSaasCommand{}
cmd.newAPIFunc = func() (RemoveSaasAPI, error) {
root, err := cmd.NewAPIRoot()
if err != nil {
return nil, errors.Trace(err)
}
return application.NewClient(root), nil
}
return modelcmd.Wrap(cmd)
} | go | func NewRemoveSaasCommand() cmd.Command {
cmd := &removeSaasCommand{}
cmd.newAPIFunc = func() (RemoveSaasAPI, error) {
root, err := cmd.NewAPIRoot()
if err != nil {
return nil, errors.Trace(err)
}
return application.NewClient(root), nil
}
return modelcmd.Wrap(cmd)
} | [
"func",
"NewRemoveSaasCommand",
"(",
")",
"cmd",
".",
"Command",
"{",
"cmd",
":=",
"&",
"removeSaasCommand",
"{",
"}",
"\n",
"cmd",
".",
"newAPIFunc",
"=",
"func",
"(",
")",
"(",
"RemoveSaasAPI",
",",
"error",
")",
"{",
"root",
",",
"err",
":=",
"cmd",... | // NewRemoveSaasCommand returns a command which removes a consumed application. | [
"NewRemoveSaasCommand",
"returns",
"a",
"command",
"which",
"removes",
"a",
"consumed",
"application",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/cmd/juju/application/removesaas.go#L19-L29 |
154,299 | juju/juju | provider/gce/google/conn.go | Connect | func Connect(connCfg ConnectionConfig, creds *Credentials) (*Connection, error) {
raw, err := newRawConnection(creds)
if err != nil {
return nil, errors.Trace(err)
}
conn := &Connection{
raw: &rawConn{raw},
region: connCfg.Region,
projectID: connCfg.ProjectID,
}
return conn, nil
} | go | func Connect(connCfg ConnectionConfig, creds *Credentials) (*Connection, error) {
raw, err := newRawConnection(creds)
if err != nil {
return nil, errors.Trace(err)
}
conn := &Connection{
raw: &rawConn{raw},
region: connCfg.Region,
projectID: connCfg.ProjectID,
}
return conn, nil
} | [
"func",
"Connect",
"(",
"connCfg",
"ConnectionConfig",
",",
"creds",
"*",
"Credentials",
")",
"(",
"*",
"Connection",
",",
"error",
")",
"{",
"raw",
",",
"err",
":=",
"newRawConnection",
"(",
"creds",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
... | // Connect authenticates using the provided credentials and opens a
// low-level connection to the GCE API for the Connection. Calling
// Connect after a successful connection has already been made will
// result in an error. All errors that happen while authenticating and
// connecting are returned by Connect. | [
"Connect",
"authenticates",
"using",
"the",
"provided",
"credentials",
"and",
"opens",
"a",
"low",
"-",
"level",
"connection",
"to",
"the",
"GCE",
"API",
"for",
"the",
"Connection",
".",
"Calling",
"Connect",
"after",
"a",
"successful",
"connection",
"has",
"a... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/gce/google/conn.go#L130-L142 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.