use correct path
This commit is contained in:
parent
89a5d96e64
commit
7fb583bd4e
4 changed files with 27 additions and 8 deletions
18
.pre-commit-config.yaml
Normal file
18
.pre-commit-config.yaml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
repos:
|
||||||
|
- repo: https://git.candidator.se/go/dev-tools/pre-commit-golang.git
|
||||||
|
rev: f898003d6bfc677c18ee10210eb663fa5394cfb5
|
||||||
|
hooks:
|
||||||
|
- id: go-fmt
|
||||||
|
- id: go-vet
|
||||||
|
- id: go-staticcheck
|
||||||
|
- id: go-imports
|
||||||
|
- id: go-cyclo
|
||||||
|
args: [-over=100]
|
||||||
|
- id: revive
|
||||||
|
- id: gosec
|
||||||
|
- id: validate-toml
|
||||||
|
- id: no-go-testing
|
||||||
|
# - id: golangci-lint
|
||||||
|
- id: go-critic
|
||||||
|
- id: go-unit-tests
|
||||||
|
- id: go-build
|
12
devices.go
12
devices.go
|
@ -171,11 +171,11 @@ type Device struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type NewDevice struct {
|
type NewDevice struct {
|
||||||
Name string `json:"name,omitempty,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
DeviceType int `json:"device_type,omitempty,omitempty"`
|
DeviceType int `json:"device_type,omitempty"`
|
||||||
DeviceRole int `json:"device_role,omitempty,omitempty"`
|
DeviceRole int `json:"device_role,omitempty"`
|
||||||
Tenant int `json:"tenant,omitempty,omitempty"`
|
Tenant int `json:"tenant,omitempty"`
|
||||||
Platform int `json:"platform,omitempty,omitempty"`
|
Platform int `json:"platform,omitempty"`
|
||||||
Serial string `json:"serial,omitempty"`
|
Serial string `json:"serial,omitempty"`
|
||||||
AssetTag string `json:"asset_tag,omitempty"`
|
AssetTag string `json:"asset_tag,omitempty"`
|
||||||
Site int `json:"site,omitempty"`
|
Site int `json:"site,omitempty"`
|
||||||
|
@ -257,7 +257,7 @@ type UpdateDevice struct {
|
||||||
DcimDeviceBelongsToService int `json:"dcim_device_belongs_to_service,omitempty"`
|
DcimDeviceBelongsToService int `json:"dcim_device_belongs_to_service,omitempty"`
|
||||||
DcimDeviceCendotid string `json:"dcim_device_cendotid,omitempty"`
|
DcimDeviceCendotid string `json:"dcim_device_cendotid,omitempty"`
|
||||||
DcimDeviceExposedToInternet int `json:"dcim_device_exposed_to_internet,omitempty"`
|
DcimDeviceExposedToInternet int `json:"dcim_device_exposed_to_internet,omitempty"`
|
||||||
DcimDeviceImportOsVersion bool `json:"dcim_device_import_os_version,omitempty,omitempty"`
|
DcimDeviceImportOsVersion bool `json:"dcim_device_import_os_version,omitempty"`
|
||||||
DcimDevicePod int `json:"dcim_device_pod,omitempty"`
|
DcimDevicePod int `json:"dcim_device_pod,omitempty"`
|
||||||
} `json:"custom_fields,omitempty"`
|
} `json:"custom_fields,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,7 +149,7 @@ func NewClient(apiurl string, httpClient *http.Client) (*Client, error) {
|
||||||
c.DeviceRoles = (*DeviceRolesService)(&c.common)
|
c.DeviceRoles = (*DeviceRolesService)(&c.common)
|
||||||
c.DeviceTypes = (*DeviceTypesService)(&c.common)
|
c.DeviceTypes = (*DeviceTypesService)(&c.common)
|
||||||
c.Interfaces = (*InterfacesService)(&c.common)
|
c.Interfaces = (*InterfacesService)(&c.common)
|
||||||
c.InventoryItems = (*InventoryItemsServices)(&c.common)
|
c.InventoryItems = (*InventoryItemsService)(&c.common)
|
||||||
c.Prefixes = (*PrefixesService)(&c.common)
|
c.Prefixes = (*PrefixesService)(&c.common)
|
||||||
c.RearPorts = (*RearPortsService)(&c.common)
|
c.RearPorts = (*RearPortsService)(&c.common)
|
||||||
c.Tenants = (*TenantsService)(&c.common)
|
c.Tenants = (*TenantsService)(&c.common)
|
||||||
|
@ -185,6 +185,7 @@ func (n *Client) FetchSessionKey(privatekey string) error {
|
||||||
query := form.Encode()
|
query := form.Encode()
|
||||||
|
|
||||||
transport := &http.Transport{
|
transport := &http.Transport{
|
||||||
|
// #nosec XXX: FIXIT
|
||||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: n.InsecureSkipVerify},
|
TLSClientConfig: &tls.Config{InsecureSkipVerify: n.InsecureSkipVerify},
|
||||||
}
|
}
|
||||||
timeout := time.Duration(60 * time.Second)
|
timeout := time.Duration(60 * time.Second)
|
||||||
|
|
|
@ -87,7 +87,7 @@ func (s *SecretsService) List(ctx context.Context, f *SecretFilter) (*Secrets, e
|
||||||
}
|
}
|
||||||
query = form.Encode()
|
query = form.Encode()
|
||||||
|
|
||||||
req, err = s.client.newRequest(ctx, "GET", devicesPath, query, nil)
|
req, err = s.client.newRequest(ctx, "GET", secretsPath, query, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &secrets, err
|
return &secrets, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue