-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(LH-70705): Fix FTD onboarding fails when ftd is already register (#…
…71)
- Loading branch information
Showing
19 changed files
with
499 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package fmcconfig | ||
|
||
import "github.com/CiscoDevnet/terraform-provider-cdo/go-client/model/cloudfmc/fmcconfig" | ||
|
||
type Item = fmcconfig.Item | ||
|
||
var NewItem = fmcconfig.NewItem | ||
|
||
type Link = fmcconfig.Links | ||
|
||
var NewLinks = fmcconfig.NewLinks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package fmcconfig | ||
|
||
import ( | ||
"context" | ||
"github.com/CiscoDevnet/terraform-provider-cdo/go-client/internal/http" | ||
"github.com/CiscoDevnet/terraform-provider-cdo/go-client/internal/url" | ||
"github.com/CiscoDevnet/terraform-provider-cdo/go-client/model/cloudfmc/fmcconfig" | ||
) | ||
|
||
type ReadDeviceRecordInput struct { | ||
FmcDomainUid string | ||
FmcHostname string | ||
DeviceRecordUid string | ||
} | ||
|
||
func NewReadDeviceRecordInput(fmcDomainUid, fmcHostname, deviceRecordUid string) ReadDeviceRecordInput { | ||
return ReadDeviceRecordInput{ | ||
FmcDomainUid: fmcDomainUid, | ||
FmcHostname: fmcHostname, | ||
DeviceRecordUid: deviceRecordUid, | ||
} | ||
} | ||
|
||
type ReadDeviceRecordOutput = fmcconfig.DeviceRecord | ||
|
||
func ReadDeviceRecord(ctx context.Context, client http.Client, readInp ReadDeviceRecordInput) (*ReadDeviceRecordOutput, error) { | ||
|
||
readUrl := url.ReadFmcDeviceRecord(client.BaseUrl(), readInp.FmcDomainUid, readInp.DeviceRecordUid) | ||
|
||
req := client.NewGet(ctx, readUrl) | ||
req.Header.Add("Fmc-Hostname", readInp.FmcHostname) | ||
|
||
var readOutp fmcconfig.DeviceRecord | ||
if err := req.Send(&readOutp); err != nil { | ||
return nil, err | ||
} | ||
|
||
return &readOutp, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package fmcconfig | ||
|
||
import ( | ||
"context" | ||
"github.com/CiscoDevnet/terraform-provider-cdo/go-client/internal/http" | ||
"github.com/CiscoDevnet/terraform-provider-cdo/go-client/internal/url" | ||
"github.com/CiscoDevnet/terraform-provider-cdo/go-client/model/cloudfmc/fmcconfig" | ||
) | ||
|
||
type ReadAllDeviceRecordsInput struct { | ||
FmcDomainUid string | ||
FmcHostname string | ||
} | ||
|
||
func NewReadAllDeviceRecordsInput(fmcDomainUid string, fmcHostname string) ReadAllDeviceRecordsInput { | ||
return ReadAllDeviceRecordsInput{ | ||
FmcDomainUid: fmcDomainUid, | ||
FmcHostname: fmcHostname, | ||
} | ||
} | ||
|
||
type ReadAllDeviceRecordsOutput = fmcconfig.AllDeviceRecords | ||
|
||
var NewReadAllDeviceRecordsOutputBuilder = fmcconfig.NewAllDeviceRecordsBuilder | ||
|
||
func ReadAllDeviceRecords(ctx context.Context, client http.Client, readInp ReadAllDeviceRecordsInput) (*ReadAllDeviceRecordsOutput, error) { | ||
|
||
readUrl := url.ReadFmcAllDeviceRecords(client.BaseUrl(), readInp.FmcDomainUid) | ||
|
||
req := client.NewGet(ctx, readUrl) | ||
req.Header.Add("Fmc-Hostname", readInp.FmcHostname) | ||
|
||
var readOutp ReadAllDeviceRecordsOutput | ||
if err := req.Send(&readOutp); err != nil { | ||
return nil, err | ||
} | ||
|
||
return &readOutp, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.