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

Delta Between Two Patch Sets: testservices/errors.go

Issue 103900045: Add support for Availability Zones
Left Patch Set: Add support for Availability Zones Created 9 years, 9 months ago
Right Patch Set: Add support for Availability Zones Created 9 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:
Right: Side by side diff | Download
« no previous file with change/comment | « nova/nova.go ('k') | testservices/novaservice/service.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
(no file at all)
1 package testservices 1 package testservices
2 2
3 import "fmt" 3 import "fmt"
4 4
5 // This map is copied from nova python client 5 // This map is copied from nova python client
6 // https://github.com/openstack/nova/blob/master/nova/api/openstack/wsgi.py#L118 5 6 // https://github.com/openstack/nova/blob/master/nova/api/openstack/wsgi.py#L118 5
7 var nameReference = map[int]string{ 7 var nameReference = map[int]string{
8 400: "badRequest", 8 400: "badRequest",
9 401: "unauthorized", 9 401: "unauthorized",
10 403: "forbidden", 10 403: "forbidden",
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 return serverErrorf(404, "Zero floating ips available") 59 return serverErrorf(404, "Zero floating ips available")
60 } 60 }
61 61
62 func NewIPLimitExceededError() *ServerError { 62 func NewIPLimitExceededError() *ServerError {
63 return serverErrorf(413, "Maximum number of floating ips exceeded") 63 return serverErrorf(413, "Maximum number of floating ips exceeded")
64 } 64 }
65 65
66 func NewRateLimitExceededError() *ServerError { 66 func NewRateLimitExceededError() *ServerError {
67 // This is an undocumented error 67 // This is an undocumented error
68 return serverErrorf(413, "Retry limit exceeded") 68 return serverErrorf(413, "Retry limit exceeded")
69 }
70
71 func NewAvailabilityZoneIsNotAvailableError() *ServerError {
72 return serverErrorf(400, "The requested availability zone is not availab le")
69 } 73 }
70 74
71 func NewAddFlavorError(id string) *ServerError { 75 func NewAddFlavorError(id string) *ServerError {
72 return serverErrorf(409, "A flavor with id %q already exists", id) 76 return serverErrorf(409, "A flavor with id %q already exists", id)
73 } 77 }
74 78
75 func NewNoSuchFlavorError(id string) *ServerError { 79 func NewNoSuchFlavorError(id string) *ServerError {
76 return serverErrorf(404, "No such flavor %q", id) 80 return serverErrorf(404, "No such flavor %q", id)
77 } 81 }
78 82
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 return serverErrorf(409, "Server %q already has floating IP %s", serverI d, ipId) 144 return serverErrorf(409, "Server %q already has floating IP %s", serverI d, ipId)
141 } 145 }
142 146
143 func NewNoFloatingIPsToRemoveError(serverId string) *ServerError { 147 func NewNoFloatingIPsToRemoveError(serverId string) *ServerError {
144 return serverErrorf(409, "Server %q does not have any floating IPs to re move", serverId) 148 return serverErrorf(409, "Server %q does not have any floating IPs to re move", serverId)
145 } 149 }
146 150
147 func NewNoFloatingIPsError(serverId, ipId string) *ServerError { 151 func NewNoFloatingIPsError(serverId, ipId string) *ServerError {
148 return serverErrorf(404, "Server %q does not have floating IP %s", serve rId, ipId) 152 return serverErrorf(404, "Server %q does not have floating IP %s", serve rId, ipId)
149 } 153 }
LEFTRIGHT

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