Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(306)

Delta Between Two Patch Sets: environs/interface.go

Issue 9824043: Move assignment policy to global env config (Closed)
Left Patch Set: Move assignment policy to global env config Created 10 years, 10 months ago
Right Patch Set: Move assignment policy to global env config Created 10 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « environs/ec2/local_test.go ('k') | environs/maas/environ.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2011, 2012, 2013 Canonical Ltd. 1 // Copyright 2011, 2012, 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package environs 4 package environs
5 5
6 import ( 6 import (
7 "errors" 7 "errors"
8 "io" 8 "io"
9 "launchpad.net/juju-core/constraints" 9 "launchpad.net/juju-core/constraints"
10 "launchpad.net/juju-core/environs/config" 10 "launchpad.net/juju-core/environs/config"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 ClosePorts(machineId string, ports []params.Port) error 74 ClosePorts(machineId string, ports []params.Port) error
75 75
76 // Ports returns the set of ports open on the instance, which 76 // Ports returns the set of ports open on the instance, which
77 // should have been started with the given machine id. 77 // should have been started with the given machine id.
78 // The ports are returned as sorted by state.SortPorts. 78 // The ports are returned as sorted by state.SortPorts.
79 Ports(machineId string) ([]params.Port, error) 79 Ports(machineId string) ([]params.Port, error)
80 } 80 }
81 81
82 var ErrNoInstances = errors.New("no instances found") 82 var ErrNoInstances = errors.New("no instances found")
83 var ErrPartialInstances = errors.New("only some instances were found") 83 var ErrPartialInstances = errors.New("only some instances were found")
84
85 // NotFoundError records an error when something has not been found.
86 type NotFoundError struct {
87 // error is the underlying error.
88 error
89 }
90
91 // IsNotFoundError returns true if err is a NotFoundError.
92 func IsNotFoundError(err error) bool {
93 if _, ok := err.(*NotFoundError); ok {
94 return true
95 }
96 return false
97 }
98 84
99 // A StorageReader can retrieve and list files from a storage provider. 85 // A StorageReader can retrieve and list files from a storage provider.
100 type StorageReader interface { 86 type StorageReader interface {
101 // Get opens the given storage file and returns a ReadCloser 87 // Get opens the given storage file and returns a ReadCloser
102 // that can be used to read its contents. It is the caller's 88 // that can be used to read its contents. It is the caller's
103 // responsibility to close it after use. If the name does not 89 // responsibility to close it after use. If the name does not
104 // exist, it should return a *NotFoundError. 90 // exist, it should return a *NotFoundError.
105 Get(name string) (io.ReadCloser, error) 91 Get(name string) (io.ReadCloser, error)
106 92
107 // List lists all names in the storage with the given prefix, in 93 // List lists all names in the storage with the given prefix, in
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 ClosePorts(ports []params.Port) error 209 ClosePorts(ports []params.Port) error
224 210
225 // Ports returns the ports opened for the whole environment. 211 // Ports returns the ports opened for the whole environment.
226 // Must only be used if the environment was setup with the 212 // Must only be used if the environment was setup with the
227 // FwGlobal firewall mode. 213 // FwGlobal firewall mode.
228 Ports() ([]params.Port, error) 214 Ports() ([]params.Port, error)
229 215
230 // Provider returns the EnvironProvider that created this Environ. 216 // Provider returns the EnvironProvider that created this Environ.
231 Provider() EnvironProvider 217 Provider() EnvironProvider
232 } 218 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b