latest
Models
Powered By GitBook
LanApi
All URIs are relative to https://api.ionos.com/cloudapi/v5
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 map[string]interface{} = 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 datacenter
12
lanId := "lanId_example" // string | The unique ID of the LAN
13
pretty := true // bool | Controls whether response is pretty-printed (with indentation and new lines) (optional) (default to true)
14
depth := int32(56) // int32 | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed (optional)
16
17
configuration := openapiclient.NewConfiguration()
18
api_client := openapiclient.NewAPIClient(configuration)
19
resp, r, err := api_client.LanApi.DatacentersLansDelete(context.Background(), datacenterId, lanId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
20
if err != nil {
21
fmt.Fprintf(os.Stderr, "Error when calling `LanApi.DatacentersLansDelete``: %v\n", err)
22
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23
}
24
// response from `DatacentersLansDelete`: map[string]interface{}
25
fmt.Fprintf(os.Stdout, "Response from `LanApi.DatacentersLansDelete`: %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 datacenter
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 response is pretty-printed (with indentation and new lines)
[default to true]
depth
int32
Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed

Return type

map[string]interface{}

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 datacenter
12
lanId := "lanId_example" // string | The unique ID of the LAN
13
pretty := true // bool | Controls whether response is pretty-printed (with indentation and new lines) (optional) (default to true)
14
depth := int32(56) // int32 | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed (optional)
16
17
configuration := openapiclient.NewConfiguration()
18
api_client := openapiclient.NewAPIClient(configuration)
19
resp, r, err := api_client.LanApi.DatacentersLansFindById(context.Background(), datacenterId, lanId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
20
if err != nil {
21
fmt.Fprintf(os.Stderr, "Error when calling `LanApi.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 `LanApi.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 datacenter
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 response is pretty-printed (with indentation and new lines)
[default to true]
depth
int32
Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 datacenter
12
pretty := true // bool | Controls whether response is pretty-printed (with indentation and new lines) (optional) (default to true)
13
depth := int32(56) // int32 | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed (optional)
15
offset := int32(56) // int32 | the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination) (optional) (default to 0)
16
limit := int32(56) // int32 | the maximum number of elements to return (use together with <code>offset</code> for pagination) (optional) (default to 1000)
17
18
configuration := openapiclient.NewConfiguration()
19
api_client := openapiclient.NewAPIClient(configuration)
20
resp, r, err := api_client.LanApi.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 `LanApi.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 `LanApi.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 datacenter

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 response is pretty-printed (with indentation and new lines)
[default to true]
depth
int32
Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed
offset
int32
the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination)
[default to 0]
limit
int32
the maximum number of elements to return (use together with <code>offset</code> 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 datacenter
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 response is pretty-printed (with indentation and new lines) (optional) (default to true)
15
depth := int32(56) // int32 | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed (optional)
17
18
configuration := openapiclient.NewConfiguration()
19
api_client := openapiclient.NewAPIClient(configuration)
20
resp, r, err := api_client.LanApi.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 `LanApi.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 `LanApi.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 datacenter
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 response is pretty-printed (with indentation and new lines)
[default to true]
depth
int32
Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 datacenter
12
lanId := "lanId_example" // string | The unique ID of the LAN
13
pretty := true // bool | Controls whether response is pretty-printed (with indentation and new lines) (optional) (default to true)
14
depth := int32(56) // int32 | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed (optional)
16
offset := int32(56) // int32 | the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination) (optional) (default to 0)
17
limit := int32(56) // int32 | the maximum number of elements to return (use together with <code>offset</code> for pagination) (optional) (default to 1000)
18
19
configuration := openapiclient.NewConfiguration()
20
api_client := openapiclient.NewAPIClient(configuration)
21
resp, r, err := api_client.LanApi.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 `LanApi.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 `LanApi.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 datacenter
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 response is pretty-printed (with indentation and new lines)
[default to true]
depth
int32
Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed
offset
int32
the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination)
[default to 0]
limit
int32
the maximum number of elements to return (use together with <code>offset</code> 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 datacenter
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 response is pretty-printed (with indentation and new lines) (optional) (default to true)
15
depth := int32(56) // int32 | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed (optional)
17
18
configuration := openapiclient.NewConfiguration()
19
api_client := openapiclient.NewAPIClient(configuration)
20
resp, r, err := api_client.LanApi.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 `LanApi.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 `LanApi.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 datacenter
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 response is pretty-printed (with indentation and new lines)
[default to true]
depth
int32
Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should 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 datacenter
12
lanId := "lanId_example" // string | The unique ID of the LAN
13
lan := *openapiclient.NewLanProperties() // LanProperties | Modified Lan
14
pretty := true // bool | Controls whether response is pretty-printed (with indentation and new lines) (optional) (default to true)
15
depth := int32(56) // int32 | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) 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 having more than 1 contract need to provide contract number, against which all API requests should be executed (optional)
17
18
configuration := openapiclient.NewConfiguration()
19
api_client := openapiclient.NewAPIClient(configuration)
20
resp, r, err := api_client.LanApi.DatacentersLansPatch(context.Background(), datacenterId<