@@ -5,21 +5,17 @@ package cns
55
66// Container Network Service remote API Contract
77const (
8- SetEnvironmentPath = "/network/environment"
9- CreateNetworkPath = "/network/create"
10- DeleteNetworkPath = "/network/delete"
11- ReserveIPAddressPath = "/network/ip/reserve"
12- ReleaseIPAddressPath = "/network/ip/release"
13- GetHostLocalIPPath = "/network/ip/hostlocal"
14- GetIPAddressUtilizationPath = "/network/ip/utilization"
15- GetUnhealthyIPAddressesPath = "/network/ipaddresses/unhealthy"
16- GetHealthReportPath = "/network/health"
17- V1Prefix = "/v0.1"
18- V2Prefix = "/v0.2"
19- CreateOrUpdateNetworkContainer = "/network/createorupdatenetworkcontainer"
20- DeleteNetworkContainer = "/network/deletenetworkcontainer"
21- GetNetworkContainerStatus = "/network/getnetworkcontainerstatus"
22- GetInterfaceForContainer = "/network/getinterfaceforcontainer"
8+ SetEnvironmentPath = "/network/environment"
9+ CreateNetworkPath = "/network/create"
10+ DeleteNetworkPath = "/network/delete"
11+ ReserveIPAddressPath = "/network/ip/reserve"
12+ ReleaseIPAddressPath = "/network/ip/release"
13+ GetHostLocalIPPath = "/network/ip/hostlocal"
14+ GetIPAddressUtilizationPath = "/network/ip/utilization"
15+ GetUnhealthyIPAddressesPath = "/network/ipaddresses/unhealthy"
16+ GetHealthReportPath = "/network/health"
17+ V1Prefix = "/v0.1"
18+ V2Prefix = "/v0.2"
2319)
2420
2521// SetEnvironmentRequest describes the Request to set the environment in CNS.
@@ -110,105 +106,3 @@ type OptionMap map[string]interface{}
110106type errorResponse struct {
111107Err string
112108}
113-
114- // CreateNetworkContainerRequest specifies request to create a network container or network isolation boundary.
115- type CreateNetworkContainerRequest struct {
116- Version string
117- NetworkContainerType string
118- NetworkContainerid string // Mandatory input.
119- PrimaryInterfaceIdentifier string // Primary CA.
120- AuthorizationToken string
121- NetworkContainerOrchestratorInfo NetworkContainerOrchestratorInfo
122- IPConfiguration IPConfiguration
123- MultiTenancyInfo MultiTenancyInfo
124- VnetAddressSpace []IPSubnet // To setup SNAT (should include service endpoint vips).
125- Routes []Route
126- }
127-
128- // NetworkContainerOrchestratorInfo contains orchestrator type, pod name and pod namespace.
129- type NetworkContainerOrchestratorInfo struct {
130- OrchestratorType string
131- PodName string
132- PodNamespace string
133- }
134-
135- // MultiTenancyInfo contains encap type and id.
136- type MultiTenancyInfo struct {
137- EncapType string
138- ID int // This can be vlanid, vxlanid, gre-key etc. (depends on EnacapType).
139- }
140-
141- // IPConfiguration contains details about ip config to provision in the VM.
142- type IPConfiguration struct {
143- IPSubnet IPSubnet
144- DNSServers []string
145- GatewayIPAddress string
146- }
147-
148- // IPSubnet contains ip subnet.
149- type IPSubnet struct {
150- IPAddress string
151- PrefixLength uint8
152- }
153-
154- // Route describes an entry in routing table.
155- type Route struct {
156- IPAddress string
157- GatewayIPAddress string
158- InterfaceToUse string
159- }
160-
161- // CreateNetworkContainerResponse specifies response of creating a network container.
162- type CreateNetworkContainerResponse struct {
163- Response Response
164- }
165-
166- // GetNetworkContainerStatusRequest specifies the details about the request to retrieve status of a specifc network container.
167- type GetNetworkContainerStatusRequest struct {
168- NetworkContainerid string
169- }
170-
171- // GetNetworkContainerStatusResponse specifies response of retriving a network container status.
172- type GetNetworkContainerStatusResponse struct {
173- NetworkContainerid string
174- Version string
175- AzureHostVersion string
176- Response Response
177- }
178-
179- // GetNetworkContainerRequest specifies the details about the request to retrieve a specifc network container.
180- type GetNetworkContainerRequest struct {
181- }
182-
183- // GetNetworkContainerResponse describes the response to retrieve a specifc network container.
184- type GetNetworkContainerResponse struct {
185- Response Response
186- }
187-
188- // DeleteNetworkContainerRequest specifies the details about the request to delete a specifc network container.
189- type DeleteNetworkContainerRequest struct {
190- NetworkContainerid string
191- }
192-
193- // DeleteNetworkContainerResponse describes the response to delete a specifc network container.
194- type DeleteNetworkContainerResponse struct {
195- Response Response
196- }
197-
198- // GetInterfaceForContainerRequest specifies the container ID for which interface needs to be identified.
199- type GetInterfaceForContainerRequest struct {
200- NetworkContainerID string
201- }
202-
203- // GetInterfaceForContainerResponse specifies the interface for a given container ID.
204- type GetInterfaceForContainerResponse struct {
205- NetworkInterface NetworkInterface
206- VnetAddressSpace []IPSubnet
207- Response Response
208- }
209-
210- // NetworkInterface specifies the information that can be used to unquely identify an interface.
211- type NetworkInterface struct {
212- Name string
213- IPAddress string
214- }
0 commit comments