master
Models
LansApi
All URIs are relative to https://api.ionos.com/cloudapi/v6
Method
HTTP request
Description
Delete /datacenters/{datacenterId}/lans/{lanId}
Delete a Lan.
Get /datacenters/{datacenterId}/lans/{lanId}
Retrieve a Lan
Get /datacenters/{datacenterId}/lans
List Lans
Get /datacenters/{datacenterId}/lans/{lanId}/nics/{nicId}
Retrieve a nic attached to lan
Get /datacenters/{datacenterId}/lans/{lanId}/nics
List Lan Members
Post /datacenters/{datacenterId}/lans/{lanId}/nics
Attach a nic
Patch /datacenters/{datacenterId}/lans/{lanId}
Partially modify a Lan
Post /datacenters/{datacenterId}/lans
Create a Lan
Put /datacenters/{datacenterId}/lans/{lanId}
Modify a Lan

DatacentersLansDelete

1
var result = DatacentersLansDelete(ctx, datacenterId, lanId)
2
.Pretty(pretty)
3
.Depth(depth)
4
.XContractNumber(xContractNumber)
5
.Execute()
Copied!
Delete a Lan.

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
lanId := "lanId_example" // string | The unique ID of the LAN
13
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
14
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
15
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, against which all API requests are to be executed. (optional)
16
17
configuration := openapiclient.NewConfiguration()
18
api_client := openapiclient.NewAPIClient(configuration)
19
resp, r, err := api_client.LansApi.DatacentersLansDelete(context.Background(), datacenterId, lanId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
20
if err != nil {
21
fmt.Fprintf(os.Stderr, "Error when calling `LansApi.DatacentersLansDelete``: %v\n", err)
22
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23
}
24
}
Copied!

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
lanId
string
The unique ID of the LAN

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersLansDeleteRequest struct via the builder pattern
Name
Type
Description
Notes
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, against which all API requests are to be executed.

Return type

(empty response body)

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

DatacentersLansFindById

1
var result Lan = DatacentersLansFindById(ctx, datacenterId, lanId)
2
.Pretty(pretty)
3
.Depth(depth)
4
.XContractNumber(xContractNumber)
5
.Execute()
Copied!
Retrieve a Lan

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
lanId := "lanId_example" // string | The unique ID of the LAN
13
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
14
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
15
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, against which all API requests are to be executed. (optional)
16
17
configuration := openapiclient.NewConfiguration()
18
api_client := openapiclient.NewAPIClient(configuration)
19
resp, r, err := api_client.LansApi.DatacentersLansFindById(context.Background(), datacenterId, lanId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
20
if err != nil {
21
fmt.Fprintf(os.Stderr, "Error when calling `LansApi.DatacentersLansFindById``: %v\n", err)
22
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23
}
24
// response from `DatacentersLansFindById`: Lan
25
fmt.Fprintf(os.Stdout, "Response from `LansApi.DatacentersLansFindById`: %v\n", resp)
26
}
Copied!

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
lanId
string
The unique ID of the LAN

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersLansFindByIdRequest struct via the builder pattern
Name
Type
Description
Notes
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, against which all API requests are to be executed.

Return type

Lan

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

DatacentersLansGet

1
var result Lans = DatacentersLansGet(ctx, datacenterId)
2
.Pretty(pretty)
3
.Depth(depth)
4
.XContractNumber(xContractNumber)
5
.Offset(offset)
6
.Limit(limit)
7
.Execute()
Copied!
List Lans

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
13
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
14
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, against which all API requests are to be executed. (optional)
15
offset := int32(56) // int32 | The first element (from the complete list of the elements) to include in the response (use together with limit for pagination). (optional) (default to 0)
16
limit := int32(56) // int32 | The maximum number of elements to return (use together with offset for pagination). (optional) (default to 1000)
17
18
configuration := openapiclient.NewConfiguration()
19
api_client := openapiclient.NewAPIClient(configuration)
20
resp, r, err := api_client.LansApi.DatacentersLansGet(context.Background(), datacenterId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Offset(offset).Limit(limit).Execute()
21
if err != nil {
22
fmt.Fprintf(os.Stderr, "Error when calling `LansApi.DatacentersLansGet``: %v\n", err)
23
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24
}
25
// response from `DatacentersLansGet`: Lans
26
fmt.Fprintf(os.Stdout, "Response from `LansApi.DatacentersLansGet`: %v\n", resp)
27
}
Copied!

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersLansGetRequest struct via the builder pattern
Name
Type
Description
Notes
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, against which all API requests are to be executed.
offset
int32
The first element (from the complete list of the elements) to include in the response (use together with limit for pagination).
[default to 0]
limit
int32
The maximum number of elements to return (use together with offset for pagination).
[default to 1000]

Return type

Lans

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

DatacentersLansNicsFindById

1
var result Nic = DatacentersLansNicsFindById(ctx, datacenterId, lanId, nicId)
2
.Pretty(pretty)
3
.Depth(depth)
4
.XContractNumber(xContractNumber)
5
.Execute()
Copied!
Retrieve a nic attached to lan

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
lanId := "lanId_example" // string | The unique ID of the LAN
13
nicId := "nicId_example" // string | The unique ID of the NIC
14
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
15
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
16
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, against which all API requests are to be executed. (optional)
17
18
configuration := openapiclient.NewConfiguration()
19
api_client := openapiclient.NewAPIClient(configuration)
20
resp, r, err := api_client.LansApi.DatacentersLansNicsFindById(context.Background(), datacenterId, lanId, nicId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
21
if err != nil {
22
fmt.Fprintf(os.Stderr, "Error when calling `LansApi.DatacentersLansNicsFindById``: %v\n", err)
23
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24
}
25
// response from `DatacentersLansNicsFindById`: Nic
26
fmt.Fprintf(os.Stdout, "Response from `LansApi.DatacentersLansNicsFindById`: %v\n", resp)
27
}
Copied!

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
lanId
string
The unique ID of the LAN
nicId
string
The unique ID of the NIC

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersLansNicsFindByIdRequest struct via the builder pattern
Name
Type
Description
Notes
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, against which all API requests are to be executed.

Return type

Nic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

DatacentersLansNicsGet

1
var result LanNics = DatacentersLansNicsGet(ctx, datacenterId, lanId)
2
.Pretty(pretty)
3
.Depth(depth)
4
.XContractNumber(xContractNumber)
5
.Offset(offset)
6
.Limit(limit)
7
.Execute()
Copied!
List Lan Members

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
lanId := "lanId_example" // string | The unique ID of the LAN
13
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
14
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
15
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, against which all API requests are to be executed. (optional)
16
offset := int32(56) // int32 | The first element (from the complete list of the elements) to include in the response (use together with limit for pagination). (optional) (default to 0)
17
limit := int32(56) // int32 | The maximum number of elements to return (use together with offset for pagination). (optional) (default to 1000)
18
19
configuration := openapiclient.NewConfiguration()
20
api_client := openapiclient.NewAPIClient(configuration)
21
resp, r, err := api_client.LansApi.DatacentersLansNicsGet(context.Background(), datacenterId, lanId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Offset(offset).Limit(limit).Execute()
22
if err != nil {
23
fmt.Fprintf(os.Stderr, "Error when calling `LansApi.DatacentersLansNicsGet``: %v\n", err)
24
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25
}
26
// response from `DatacentersLansNicsGet`: LanNics
27
fmt.Fprintf(os.Stdout, "Response from `LansApi.DatacentersLansNicsGet`: %v\n", resp)
28
}
Copied!

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
lanId
string
The unique ID of the LAN

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersLansNicsGetRequest struct via the builder pattern
Name
Type
Description
Notes
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, against which all API requests are to be executed.
offset
int32
The first element (from the complete list of the elements) to include in the response (use together with limit for pagination).
[default to 0]
limit
int32
The maximum number of elements to return (use together with offset for pagination).
[default to 1000]

Return type

LanNics

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

DatacentersLansNicsPost

1
var result Nic = DatacentersLansNicsPost(ctx, datacenterId, lanId)
2
.Nic(nic)
3
.Pretty(pretty)
4
.Depth(depth)
5
.XContractNumber(xContractNumber)
6
.Execute()
Copied!
Attach a nic

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
lanId := "lanId_example" // string | The unique ID of the LAN
13
nic := *openapiclient.NewNic(*openapiclient.NewNicProperties(int32(2))) // Nic | Nic to be attached
14
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
15
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
16
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, against which all API requests are to be executed. (optional)
17
18
configuration := openapiclient.NewConfiguration()
19
api_client := openapiclient.NewAPIClient(configuration)
20
resp, r, err := api_client.LansApi.DatacentersLansNicsPost(context.Background(), datacenterId, lanId).Nic(nic).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
21
if err != nil {
22
fmt.Fprintf(os.Stderr, "Error when calling `LansApi.DatacentersLansNicsPost``: %v\n", err)
23
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24
}
25
// response from `DatacentersLansNicsPost`: Nic
26
fmt.Fprintf(os.Stdout, "Response from `LansApi.DatacentersLansNicsPost`: %v\n", resp)
27
}
Copied!

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
lanId
string
The unique ID of the LAN

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersLansNicsPostRequest struct via the builder pattern
Name
Type
Description
Notes
nic
Nic
Nic to be attached
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, against which all API requests are to be executed.

Return type

Nic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

DatacentersLansPatch

1
var result Lan = DatacentersLansPatch(ctx, datacenterId, lanId)
2
.Lan(lan)
3
.Pretty(pretty)
4
.Depth(depth)
5
.XContractNumber(xContractNumber)
6
.Execute()
Copied!
Partially modify a Lan

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
lanId := "lanId_example" // string | The unique ID of the LAN
13
lan := *openapiclient.NewLanProperties() // LanProperties | Modified Lan
14
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
15
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
16
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, against which all API requests are to be executed. (optional)
17
18
configuration := openapiclient.NewConfiguration()
19
api_client := openapiclient.NewAPIClient(configuration)
20
resp, r, err := api_client.LansApi.DatacentersLansPatch(context.Background(), datacenterId, lanId).Lan(lan).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
21
if err != nil {
22
fmt.Fprintf(os.Stderr, "Error when calling `LansApi.DatacentersLansPatch``: %v\n", err)
23
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24
}
25
// response from `DatacentersLansPatch`: Lan
26
fmt.Fprintf(os.Stdout, "Response from `LansApi.DatacentersLansPatch`: %v\n", resp)
27
}
Copied!

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
lanId
string
The unique ID of the LAN

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersLansPatchRequest struct via the builder pattern
Name
Type
Description
Notes
lan
Modified Lan
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, against which all API requests are to be executed.

Return type

Lan

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

DatacentersLansPost

1
var result LanPost = DatacentersLansPost(ctx, datacenterId)
2
.Lan(lan)
3
.Pretty(pretty)
4
.Depth(depth)
5
.XContractNumber(xContractNumber)
6
.Execute()
Copied!
Create a Lan

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
lan := *openapiclient.NewLanPost(*openapiclient.NewLanPropertiesPost()) // LanPost | Lan to be created
13
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
14
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
15
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, against which all API requests are to be executed. (optional)
16
17
configuration := openapiclient.NewConfiguration()
18
api_client := openapiclient.NewAPIClient(configuration)
19
resp, r, err := api_client.LansApi.DatacentersLansPost(context.Background(), datacenterId).Lan(lan).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
20
if err != nil {
21
fmt.Fprintf(os.Stderr, "Error when calling `LansApi.DatacentersLansPost``: %v\n", err)
22
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23
}
24
// response from `DatacentersLansPost`: LanPost
25
fmt.Fprintf(os.Stdout, "Response from `LansApi.DatacentersLansPost`: %v\n", resp)
26
}
Copied!

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersLansPostRequest struct via the builder pattern
Name
Type
Description
Notes
lan
LanPost
Lan to be created
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, against which all API requests are to be executed.

Return type

LanPost

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

DatacentersLansPut

1
var result Lan = DatacentersLansPut(ctx, datacenterId, lanId)
2
.Lan(lan)
3
.Pretty(pretty)
4
.Depth(depth)
5
.XContractNumber(xContractNumber)
6
.Execute()
Copied!
Modify a Lan

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
lanId := "lanId_example" // string | The unique ID of the LAN
13
lan := *openapiclient.NewLan(*openapiclient.NewLanProperties()) // Lan | Modified Lan
14
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
15
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
16
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, against which all API requests are to be executed. (optional)
17
18
configuration := openapiclient.NewConfiguration()
19
api_client := openapiclient.NewAPIClient(configuration)
20
resp, r, err := api_client.LansApi.DatacentersLansPut(context.Background(), datacenterId, lanId).Lan(lan).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
21
if err != nil {
22
fmt.Fprintf(os.Stderr, "Error when calling `LansApi.DatacentersLansPut``: %v\n", err)
23
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24
}
25
// response from `DatacentersLansPut`: Lan
26
fmt.Fprintf(os.Stdout, "Response from `LansApi.DatacentersLansPut`: %v\n", resp)
27
}
Copied!

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
lanId
string
The unique ID of the LAN

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersLansPutRequest struct via the builder pattern
Name
Type
Description
Notes
lan
Lan
Modified Lan
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, against which all API requests are to be executed.

Return type

Lan

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json