Skip to content

Commit

Permalink
Merge pull request #100 from Leaseweb/chore/rename-ips
Browse files Browse the repository at this point in the history
chore: rename ips to ipMgmt
  • Loading branch information
alrayyes authored Dec 27, 2024
2 parents 23e9497 + 7caa427 commit e351aa7
Show file tree
Hide file tree
Showing 53 changed files with 591 additions and 589 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.gitignore
.openapi-generator-ignore
.travis.yml
README.md
api/openapi.yaml
api_ips.go
api_ipmgmt.go
client.go
configuration.go
docs/AssignedContract.md
Expand All @@ -12,7 +13,7 @@ docs/GetNullRouteHistoryListResult.md
docs/GetReverseLookupRecordListResult.md
docs/Ip.md
docs/IpType.md
docs/IpsAPI.md
docs/IpmgmtAPI.md
docs/Metadata.md
docs/NullRouteIPOpts.md
docs/NullRoutedIP.md
Expand Down Expand Up @@ -44,4 +45,5 @@ model_update_null_route_opts.go
model_update_reverse_lookup_records_opts.go
model_update_reverse_lookup_records_result.go
response.go
test/api_ipmgmt_test.go
utils.go
File renamed without changes.
File renamed without changes.
44 changes: 22 additions & 22 deletions ips/README.md → ipmgmt/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Go API client for ips
# Go API client for ipmgmt

> The base URL for this API is: **https://api.leaseweb.com/ipMgmt/v2/_**
Expand All @@ -22,7 +22,7 @@ go get golang.org/x/net/context
Put the package under your project folder and add the following in import:

```go
import ips "github.com/leaseweb/leaseweb-go-sdk/ips"
import ipmgmt "github.com/leaseweb/leaseweb-go-sdk/ipmgmt"
```

To use a proxy, set the environment variable `HTTP_PROXY`:
Expand All @@ -37,18 +37,18 @@ Default configuration comes with `Servers` field that contains server objects as

### Select Server Configuration

For using other server than the one defined on index 0 set context value `ips.ContextServerIndex` of type `int`.
For using other server than the one defined on index 0 set context value `ipmgmt.ContextServerIndex` of type `int`.

```go
ctx := context.WithValue(context.Background(), ips.ContextServerIndex, 1)
ctx := context.WithValue(context.Background(), ipmgmt.ContextServerIndex, 1)
```

### Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value `ips.ContextServerVariables` of type `map[string]string`.
Templated server URL is formatted using default variables from configuration or from context value `ipmgmt.ContextServerVariables` of type `map[string]string`.

```go
ctx := context.WithValue(context.Background(), ips.ContextServerVariables, map[string]string{
ctx := context.WithValue(context.Background(), ipmgmt.ContextServerVariables, map[string]string{
"basePath": "v2",
})
```
Expand All @@ -59,13 +59,13 @@ Note, enum values are always validated and all unused variables are silently ign

Each operation can use different server URL defined using `OperationServers` map in the `Configuration`.
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
Similar rules for overriding default operation server index and variables applies by using `ips.ContextOperationServerIndices` and `ips.ContextOperationServerVariables` context maps.
Similar rules for overriding default operation server index and variables applies by using `ipmgmt.ContextOperationServerIndices` and `ipmgmt.ContextOperationServerVariables` context maps.

```go
ctx := context.WithValue(context.Background(), ips.ContextOperationServerIndices, map[string]int{
ctx := context.WithValue(context.Background(), ipmgmt.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), ips.ContextOperationServerVariables, map[string]map[string]string{
ctx = context.WithValue(context.Background(), ipmgmt.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
Expand All @@ -78,16 +78,16 @@ All URIs are relative to *https://api.leaseweb.com/ipMgmt/v2*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*IpsAPI* | [**GetIP**](docs/IpsAPI.md#getip) | **Get** /ips/{ip} | Inspect an IP
*IpsAPI* | [**GetIPList**](docs/IpsAPI.md#getiplist) | **Get** /ips | List IPs
*IpsAPI* | [**GetNullRouteHistory**](docs/IpsAPI.md#getnullroutehistory) | **Get** /nullRoutes/{id} | Inspect null route history
*IpsAPI* | [**GetNullRouteHistoryList**](docs/IpsAPI.md#getnullroutehistorylist) | **Get** /nullRoutes | Inspect null route history
*IpsAPI* | [**GetReverseLookupRecordList**](docs/IpsAPI.md#getreverselookuprecordlist) | **Get** /ips/{ip}/reverseLookup | List reverse lookup records for an IPv6 range
*IpsAPI* | [**NullRouteIP**](docs/IpsAPI.md#nullrouteip) | **Post** /ips/{ip}/nullRoute | Null route an IP
*IpsAPI* | [**RemoveIPNullRoute**](docs/IpsAPI.md#removeipnullroute) | **Delete** /ips/{ip}/nullRoute | Remove a null route
*IpsAPI* | [**UpdateIP**](docs/IpsAPI.md#updateip) | **Put** /ips/{ip} | Update an IP
*IpsAPI* | [**UpdateNullRoute**](docs/IpsAPI.md#updatenullroute) | **Put** /nullRoutes/{id} | Update a null route
*IpsAPI* | [**UpdateReverseLookupRecords**](docs/IpsAPI.md#updatereverselookuprecords) | **Put** /ips/{ip}/reverseLookup | Set or remove reverse lookup records for an IPv6 range
*IpmgmtAPI* | [**GetIPList**](docs/IpmgmtAPI.md#getiplist) | **Get** /ips | List IPs
*IpmgmtAPI* | [**GetNullRouteHistoryList**](docs/IpmgmtAPI.md#getnullroutehistorylist) | **Get** /nullRoutes | Inspect null route history
*IpmgmtAPI* | [**GetReverseLookupRecordList**](docs/IpmgmtAPI.md#getreverselookuprecordlist) | **Get** /ips/{ip}/reverseLookup | List reverse lookup records for an IPv6 range
*IpmgmtAPI* | [**InspectIP**](docs/IpmgmtAPI.md#inspectip) | **Get** /ips/{ip} | Inspect an IP
*IpmgmtAPI* | [**InspectNullRouteHistory**](docs/IpmgmtAPI.md#inspectnullroutehistory) | **Get** /nullRoutes/{id} | Inspect null route history
*IpmgmtAPI* | [**NullRouteIP**](docs/IpmgmtAPI.md#nullrouteip) | **Post** /ips/{ip}/nullRoute | Null route an IP
*IpmgmtAPI* | [**RemoveIPNullRoute**](docs/IpmgmtAPI.md#removeipnullroute) | **Delete** /ips/{ip}/nullRoute | Remove a null route
*IpmgmtAPI* | [**UpdateIP**](docs/IpmgmtAPI.md#updateip) | **Put** /ips/{ip} | Update an IP
*IpmgmtAPI* | [**UpdateNullRoute**](docs/IpmgmtAPI.md#updatenullroute) | **Put** /nullRoutes/{id} | Update a null route
*IpmgmtAPI* | [**UpdateReverseLookupRecords**](docs/IpmgmtAPI.md#updatereverselookuprecords) | **Put** /ips/{ip}/reverseLookup | Set or remove reverse lookup records for an IPv6 range


## Documentation For Models
Expand Down Expand Up @@ -122,7 +122,7 @@ Authentication schemes defined for the API:
Example

```go
auth := context.WithValue(context.Background(), ips.ContextAccessToken, "BEARER_TOKEN_STRING")
auth := context.WithValue(context.Background(), ipmgmt.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)
```

Expand All @@ -139,8 +139,8 @@ Example
```go
auth := context.WithValue(
context.Background(),
ips.ContextAPIKeys,
map[string]ips.APIKey{
ipmgmt.ContextAPIKeys,
map[string]ipmgmt.APIKey{
"X-LSW-Auth": {Key: "API_KEY_STRING"},
},
)
Expand Down
24 changes: 12 additions & 12 deletions ips/api/openapi.yaml → ipmgmt/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ paths:
description: Service Unavailable.
summary: List IPs
tags:
- ips
- ipmgmt
/ips/{ip}:
get:
operationId: getIP
operationId: inspectIP
parameters:
- description: "IP address or IP address with prefixLength {ip}_{prefix}. If\
\ prefixLength is not given, then we assume 32 (for IPv4) or 128 (for IPv6).\
Expand Down Expand Up @@ -335,7 +335,7 @@ paths:
description: Service Unavailable.
summary: Inspect an IP
tags:
- ips
- ipmgmt
put:
description: Use this operation to set reverse lookup for IPv4 IP addresses.
operationId: updateIP
Expand Down Expand Up @@ -424,7 +424,7 @@ paths:
description: Service Unavailable.
summary: Update an IP
tags:
- ips
- ipmgmt
/ips/{ip}/reverseLookup:
get:
description: Get reverse lookup values set for IPs in the specified range
Expand Down Expand Up @@ -528,7 +528,7 @@ paths:
description: Service Unavailable.
summary: List reverse lookup records for an IPv6 range
tags:
- ips
- ipmgmt
put:
description: |
This endpoint allows to set or unset reverse lookup for multiple IPv6 IPs in a specific IP range. To remove reverse lookup for an IP address set it to `null` or `""`.
Expand Down Expand Up @@ -625,7 +625,7 @@ paths:
description: Service Unavailable.
summary: Set or remove reverse lookup records for an IPv6 range
tags:
- ips
- ipmgmt
/ips/{ip}/nullRoute:
delete:
operationId: removeIPNullRoute
Expand Down Expand Up @@ -688,7 +688,7 @@ paths:
description: Service Unavailable.
summary: Remove a null route
tags:
- ips
- ipmgmt
post:
operationId: nullRouteIP
parameters:
Expand Down Expand Up @@ -777,7 +777,7 @@ paths:
description: Service Unavailable.
summary: Null route an IP
tags:
- ips
- ipmgmt
/nullRoutes:
get:
operationId: getNullRouteHistoryList
Expand Down Expand Up @@ -970,10 +970,10 @@ paths:
description: Service Unavailable.
summary: Inspect null route history
tags:
- ips
- ipmgmt
/nullRoutes/{id}:
get:
operationId: getNullRouteHistory
operationId: inspectNullRouteHistory
parameters:
- description: Null route ID
explode: false
Expand Down Expand Up @@ -1047,7 +1047,7 @@ paths:
description: Service Unavailable.
summary: Inspect null route history
tags:
- ips
- ipmgmt
put:
operationId: updateNullRoute
parameters:
Expand Down Expand Up @@ -1132,7 +1132,7 @@ paths:
description: Service Unavailable.
summary: Update a null route
tags:
- ips
- ipmgmt
components:
parameters:
limit:
Expand Down
Loading

0 comments on commit e351aa7

Please sign in to comment.