diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..df309478bdc425de0c15de0e249875b4cbdcc236 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +.idea/ diff --git a/cmd/cocsn-server/main.go b/api/cmd/cocsn-server/main.go similarity index 83% rename from cmd/cocsn-server/main.go rename to api/cmd/cocsn-server/main.go index 5ed66a403755bbfe91a08eea875df0cb6c415179..cd01f5991a8bba0e6ed4b4156d8a76dc16c9fc9c 100644 --- a/cmd/cocsn-server/main.go +++ b/api/cmd/cocsn-server/main.go @@ -6,8 +6,8 @@ import ( "log" "os" - "code.fbi.h-da.de/cocsn/cocsn-api/restapi" - "code.fbi.h-da.de/cocsn/cocsn-api/restapi/operations" + "code.fbi.h-da.de/cocsn/cocsn-api/api/restapi" + "code.fbi.h-da.de/cocsn/cocsn-api/api/restapi/operations" "github.com/go-openapi/loads" flags "github.com/jessevdk/go-flags" ) @@ -27,8 +27,8 @@ func main() { defer server.Shutdown() parser := flags.NewParser(server, flags.Default) - parser.ShortDescription = "CoCSN" - parser.LongDescription = "Simple RESTCONF API" + parser.ShortDescription = "cocsn" + parser.LongDescription = "This YANG module represents the CoCSN API" server.ConfigureFlags() for _, optsGroup := range api.CommandLineOptionsGroups { _, err := parser.AddGroup(optsGroup.ShortDescription, optsGroup.LongDescription, optsGroup.Options) diff --git a/api/models/data.go b/api/models/data.go new file mode 100644 index 0000000000000000000000000000000000000000..485d22058e2f94697da775bb7f527dc3d81c8be8 --- /dev/null +++ b/api/models/data.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Data data +// +// swagger:model data +type Data struct { + + // This resource represents the combined configuration and state data resources that can be accessed by a client and cannot be created or deleted by the client. See RESTCONF RFC 8040 for further information. + IetfRestconfData interface{} `json:"ietf-restconf:data,omitempty"` +} + +// Validate validates this data +func (m *Data) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Data) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Data) UnmarshalBinary(b []byte) error { + var res Data + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_arp_table.go b/api/models/data_cocsn_arp_table.go new file mode 100644 index 0000000000000000000000000000000000000000..2a47148a82a3379ab12b769161223f6442d423e0 --- /dev/null +++ b/api/models/data_cocsn_arp_table.go @@ -0,0 +1,177 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnArpTable data cocsn arp table +// +// swagger:model data_cocsn_arp-table +type DataCocsnArpTable struct { + + // cocsn arp table + CocsnArpTable *DataCocsnArpTableCocsnArpTable `json:"cocsn:arp-table,omitempty"` +} + +// Validate validates this data cocsn arp table +func (m *DataCocsnArpTable) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCocsnArpTable(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataCocsnArpTable) validateCocsnArpTable(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnArpTable) { // not required + return nil + } + + if m.CocsnArpTable != nil { + if err := m.CocsnArpTable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:arp-table") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnArpTable) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnArpTable) UnmarshalBinary(b []byte) error { + var res DataCocsnArpTable + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataCocsnArpTableCocsnArpTable (non-presence) +// +// swagger:model DataCocsnArpTableCocsnArpTable +type DataCocsnArpTableCocsnArpTable struct { + + // (list) + ArpEntry []*DataCocsnArpTableCocsnArpTableArpEntryItems0 `json:"arp-entry"` +} + +// Validate validates this data cocsn arp table cocsn arp table +func (m *DataCocsnArpTableCocsnArpTable) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateArpEntry(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataCocsnArpTableCocsnArpTable) validateArpEntry(formats strfmt.Registry) error { + + if swag.IsZero(m.ArpEntry) { // not required + return nil + } + + for i := 0; i < len(m.ArpEntry); i++ { + if swag.IsZero(m.ArpEntry[i]) { // not required + continue + } + + if m.ArpEntry[i] != nil { + if err := m.ArpEntry[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:arp-table" + "." + "arp-entry" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnArpTableCocsnArpTable) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnArpTableCocsnArpTable) UnmarshalBinary(b []byte) error { + var res DataCocsnArpTableCocsnArpTable + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataCocsnArpTableCocsnArpTableArpEntryItems0 data cocsn arp table cocsn arp table arp entry items0 +// +// swagger:model DataCocsnArpTableCocsnArpTableArpEntryItems0 +type DataCocsnArpTableCocsnArpTableArpEntryItems0 struct { + + // IP address of the arp entry (leaf) + Address string `json:"address,omitempty"` + + // Interface of the arp entry (leaf) + Interface string `json:"interface,omitempty"` + + // MAC address of the arp entry (leaf) + PhsAddress string `json:"phs-address,omitempty"` +} + +// Validate validates this data cocsn arp table cocsn arp table arp entry items0 +func (m *DataCocsnArpTableCocsnArpTableArpEntryItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnArpTableCocsnArpTableArpEntryItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnArpTableCocsnArpTableArpEntryItems0) UnmarshalBinary(b []byte) error { + var res DataCocsnArpTableCocsnArpTableArpEntryItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_arp_table_arp_entry.go b/api/models/data_cocsn_arp_table_arp_entry.go new file mode 100644 index 0000000000000000000000000000000000000000..66ffc8bcfb817bb6204be6b604ebaf53157133f0 --- /dev/null +++ b/api/models/data_cocsn_arp_table_arp_entry.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnArpTableArpEntry data cocsn arp table arp entry +// +// swagger:model data_cocsn_arp-table_arp-entry +type DataCocsnArpTableArpEntry struct { + + // (list) + CocsnArpEntry []*DataCocsnArpTableArpEntryCocsnArpEntryItems0 `json:"cocsn:arp-entry"` +} + +// Validate validates this data cocsn arp table arp entry +func (m *DataCocsnArpTableArpEntry) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCocsnArpEntry(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataCocsnArpTableArpEntry) validateCocsnArpEntry(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnArpEntry) { // not required + return nil + } + + for i := 0; i < len(m.CocsnArpEntry); i++ { + if swag.IsZero(m.CocsnArpEntry[i]) { // not required + continue + } + + if m.CocsnArpEntry[i] != nil { + if err := m.CocsnArpEntry[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:arp-entry" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnArpTableArpEntry) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnArpTableArpEntry) UnmarshalBinary(b []byte) error { + var res DataCocsnArpTableArpEntry + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataCocsnArpTableArpEntryCocsnArpEntryItems0 data cocsn arp table arp entry cocsn arp entry items0 +// +// swagger:model DataCocsnArpTableArpEntryCocsnArpEntryItems0 +type DataCocsnArpTableArpEntryCocsnArpEntryItems0 struct { + + // IP address of the arp entry (leaf) + Address string `json:"address,omitempty"` + + // Interface of the arp entry (leaf) + Interface string `json:"interface,omitempty"` + + // MAC address of the arp entry (leaf) + PhsAddress string `json:"phs-address,omitempty"` +} + +// Validate validates this data cocsn arp table arp entry cocsn arp entry items0 +func (m *DataCocsnArpTableArpEntryCocsnArpEntryItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnArpTableArpEntryCocsnArpEntryItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnArpTableArpEntryCocsnArpEntryItems0) UnmarshalBinary(b []byte) error { + var res DataCocsnArpTableArpEntryCocsnArpEntryItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_arp_table_arp_entry_arp_entry_address.go b/api/models/data_cocsn_arp_table_arp_entry_arp_entry_address.go new file mode 100644 index 0000000000000000000000000000000000000000..e89e5007a1a56eb016b09f7c5e5b11190f4ab8c4 --- /dev/null +++ b/api/models/data_cocsn_arp_table_arp_entry_arp_entry_address.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnArpTableArpEntryArpEntryAddress data cocsn arp table arp entry arp entry address +// +// swagger:model data_cocsn_arp-table_arp-entry_arp-entry-address +type DataCocsnArpTableArpEntryArpEntryAddress struct { + + // (list) + CocsnArpEntry []*DataCocsnArpTableArpEntryArpEntryAddressCocsnArpEntryItems0 `json:"cocsn:arp-entry"` +} + +// Validate validates this data cocsn arp table arp entry arp entry address +func (m *DataCocsnArpTableArpEntryArpEntryAddress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCocsnArpEntry(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataCocsnArpTableArpEntryArpEntryAddress) validateCocsnArpEntry(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnArpEntry) { // not required + return nil + } + + for i := 0; i < len(m.CocsnArpEntry); i++ { + if swag.IsZero(m.CocsnArpEntry[i]) { // not required + continue + } + + if m.CocsnArpEntry[i] != nil { + if err := m.CocsnArpEntry[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:arp-entry" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnArpTableArpEntryArpEntryAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnArpTableArpEntryArpEntryAddress) UnmarshalBinary(b []byte) error { + var res DataCocsnArpTableArpEntryArpEntryAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataCocsnArpTableArpEntryArpEntryAddressCocsnArpEntryItems0 data cocsn arp table arp entry arp entry address cocsn arp entry items0 +// +// swagger:model DataCocsnArpTableArpEntryArpEntryAddressCocsnArpEntryItems0 +type DataCocsnArpTableArpEntryArpEntryAddressCocsnArpEntryItems0 struct { + + // IP address of the arp entry (leaf) + Address string `json:"address,omitempty"` + + // Interface of the arp entry (leaf) + Interface string `json:"interface,omitempty"` + + // MAC address of the arp entry (leaf) + PhsAddress string `json:"phs-address,omitempty"` +} + +// Validate validates this data cocsn arp table arp entry arp entry address cocsn arp entry items0 +func (m *DataCocsnArpTableArpEntryArpEntryAddressCocsnArpEntryItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnArpTableArpEntryArpEntryAddressCocsnArpEntryItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnArpTableArpEntryArpEntryAddressCocsnArpEntryItems0) UnmarshalBinary(b []byte) error { + var res DataCocsnArpTableArpEntryArpEntryAddressCocsnArpEntryItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_arp_table_arp_entry_arp_entry_address_address.go b/api/models/data_cocsn_arp_table_arp_entry_arp_entry_address_address.go new file mode 100644 index 0000000000000000000000000000000000000000..ddf70f5e3437b245d40da99112d34dbd59179650 --- /dev/null +++ b/api/models/data_cocsn_arp_table_arp_entry_arp_entry_address_address.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnArpTableArpEntryArpEntryAddressAddress data cocsn arp table arp entry arp entry address address +// +// swagger:model data_cocsn_arp-table_arp-entry_arp-entry-address_address +type DataCocsnArpTableArpEntryArpEntryAddressAddress struct { + + // IP address of the arp entry (leaf) + CocsnAddress string `json:"cocsn:address,omitempty"` +} + +// Validate validates this data cocsn arp table arp entry arp entry address address +func (m *DataCocsnArpTableArpEntryArpEntryAddressAddress) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnArpTableArpEntryArpEntryAddressAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnArpTableArpEntryArpEntryAddressAddress) UnmarshalBinary(b []byte) error { + var res DataCocsnArpTableArpEntryArpEntryAddressAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_arp_table_arp_entry_arp_entry_address_interface.go b/api/models/data_cocsn_arp_table_arp_entry_arp_entry_address_interface.go new file mode 100644 index 0000000000000000000000000000000000000000..c6811a7fe130e4ed352ba6ee3131a3fe174961e7 --- /dev/null +++ b/api/models/data_cocsn_arp_table_arp_entry_arp_entry_address_interface.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnArpTableArpEntryArpEntryAddressInterface data cocsn arp table arp entry arp entry address interface +// +// swagger:model data_cocsn_arp-table_arp-entry_arp-entry-address_interface +type DataCocsnArpTableArpEntryArpEntryAddressInterface struct { + + // Interface of the arp entry (leaf) + CocsnInterface string `json:"cocsn:interface,omitempty"` +} + +// Validate validates this data cocsn arp table arp entry arp entry address interface +func (m *DataCocsnArpTableArpEntryArpEntryAddressInterface) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnArpTableArpEntryArpEntryAddressInterface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnArpTableArpEntryArpEntryAddressInterface) UnmarshalBinary(b []byte) error { + var res DataCocsnArpTableArpEntryArpEntryAddressInterface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address.go b/api/models/data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address.go new file mode 100644 index 0000000000000000000000000000000000000000..c4237e04f66941a2aa1c579f5b5b87471751b17d --- /dev/null +++ b/api/models/data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnArpTableArpEntryArpEntryAddressPhsAddress data cocsn arp table arp entry arp entry address phs address +// +// swagger:model data_cocsn_arp-table_arp-entry_arp-entry-address_phs-address +type DataCocsnArpTableArpEntryArpEntryAddressPhsAddress struct { + + // MAC address of the arp entry (leaf) + CocsnPhsAddress string `json:"cocsn:phs-address,omitempty"` +} + +// Validate validates this data cocsn arp table arp entry arp entry address phs address +func (m *DataCocsnArpTableArpEntryArpEntryAddressPhsAddress) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnArpTableArpEntryArpEntryAddressPhsAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnArpTableArpEntryArpEntryAddressPhsAddress) UnmarshalBinary(b []byte) error { + var res DataCocsnArpTableArpEntryArpEntryAddressPhsAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_arp_table_post.go b/api/models/data_cocsn_arp_table_post.go new file mode 100644 index 0000000000000000000000000000000000000000..162ac740332c41bc313f27ede62cce7abea06615 --- /dev/null +++ b/api/models/data_cocsn_arp_table_post.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnArpTablePost data cocsn arp table post +// +// swagger:model data_cocsn_arp-table-post +type DataCocsnArpTablePost struct { + + // (list) + CocsnArpEntry []*DataCocsnArpTablePostCocsnArpEntryItems0 `json:"cocsn:arp-entry"` +} + +// Validate validates this data cocsn arp table post +func (m *DataCocsnArpTablePost) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCocsnArpEntry(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataCocsnArpTablePost) validateCocsnArpEntry(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnArpEntry) { // not required + return nil + } + + for i := 0; i < len(m.CocsnArpEntry); i++ { + if swag.IsZero(m.CocsnArpEntry[i]) { // not required + continue + } + + if m.CocsnArpEntry[i] != nil { + if err := m.CocsnArpEntry[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:arp-entry" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnArpTablePost) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnArpTablePost) UnmarshalBinary(b []byte) error { + var res DataCocsnArpTablePost + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataCocsnArpTablePostCocsnArpEntryItems0 data cocsn arp table post cocsn arp entry items0 +// +// swagger:model DataCocsnArpTablePostCocsnArpEntryItems0 +type DataCocsnArpTablePostCocsnArpEntryItems0 struct { + + // IP address of the arp entry (leaf) + Address string `json:"address,omitempty"` + + // Interface of the arp entry (leaf) + Interface string `json:"interface,omitempty"` + + // MAC address of the arp entry (leaf) + PhsAddress string `json:"phs-address,omitempty"` +} + +// Validate validates this data cocsn arp table post cocsn arp entry items0 +func (m *DataCocsnArpTablePostCocsnArpEntryItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnArpTablePostCocsnArpEntryItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnArpTablePostCocsnArpEntryItems0) UnmarshalBinary(b []byte) error { + var res DataCocsnArpTablePostCocsnArpEntryItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_interfaces.go b/api/models/data_cocsn_interfaces.go new file mode 100644 index 0000000000000000000000000000000000000000..c0e7e5928efa9ceeb4640be17422c639c6cdcc4f --- /dev/null +++ b/api/models/data_cocsn_interfaces.go @@ -0,0 +1,244 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DataCocsnInterfaces data cocsn interfaces +// +// swagger:model data_cocsn_interfaces +type DataCocsnInterfaces struct { + + // cocsn interfaces + CocsnInterfaces *DataCocsnInterfacesCocsnInterfaces `json:"cocsn:interfaces,omitempty"` +} + +// Validate validates this data cocsn interfaces +func (m *DataCocsnInterfaces) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCocsnInterfaces(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataCocsnInterfaces) validateCocsnInterfaces(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnInterfaces) { // not required + return nil + } + + if m.CocsnInterfaces != nil { + if err := m.CocsnInterfaces.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:interfaces") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnInterfaces) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnInterfaces) UnmarshalBinary(b []byte) error { + var res DataCocsnInterfaces + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataCocsnInterfacesCocsnInterfaces (non-presence) +// +// swagger:model DataCocsnInterfacesCocsnInterfaces +type DataCocsnInterfacesCocsnInterfaces struct { + + // (list) + Interface []*DataCocsnInterfacesCocsnInterfacesInterfaceItems0 `json:"interface"` +} + +// Validate validates this data cocsn interfaces cocsn interfaces +func (m *DataCocsnInterfacesCocsnInterfaces) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateInterface(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataCocsnInterfacesCocsnInterfaces) validateInterface(formats strfmt.Registry) error { + + if swag.IsZero(m.Interface) { // not required + return nil + } + + for i := 0; i < len(m.Interface); i++ { + if swag.IsZero(m.Interface[i]) { // not required + continue + } + + if m.Interface[i] != nil { + if err := m.Interface[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:interfaces" + "." + "interface" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnInterfacesCocsnInterfaces) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnInterfacesCocsnInterfaces) UnmarshalBinary(b []byte) error { + var res DataCocsnInterfacesCocsnInterfaces + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataCocsnInterfacesCocsnInterfacesInterfaceItems0 data cocsn interfaces cocsn interfaces interface items0 +// +// swagger:model DataCocsnInterfacesCocsnInterfacesInterfaceItems0 +type DataCocsnInterfacesCocsnInterfacesInterfaceItems0 struct { + + // addresses + Addresses []string `json:"addresses"` + + // Enable or disable the interface. Example value: true (leaf) + Enabled bool `json:"enabled,omitempty"` + + // Interface name. Example value: en0 (leaf) + Name string `json:"name,omitempty"` + + // Describes whether the interface is physically up or down (leaf) + // Enum: [up down] + OperStatus *string `json:"oper-status,omitempty"` + + // The interface's address at its protocol sub-layer. For + // example, for an 802.x interface, this object normally + // contains a Media Access Control (MAC) address. The + // interface's media-specific modules must define the bit + // and byte ordering and the format of the value of this + // object. For interfaces that do not have such an address + // (e.g., a serial line), this node is not present. (leaf) + PhysAddress string `json:"phys-address,omitempty"` +} + +// Validate validates this data cocsn interfaces cocsn interfaces interface items0 +func (m *DataCocsnInterfacesCocsnInterfacesInterfaceItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOperStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var dataCocsnInterfacesCocsnInterfacesInterfaceItems0TypeOperStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["up","down"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + dataCocsnInterfacesCocsnInterfacesInterfaceItems0TypeOperStatusPropEnum = append(dataCocsnInterfacesCocsnInterfacesInterfaceItems0TypeOperStatusPropEnum, v) + } +} + +const ( + + // DataCocsnInterfacesCocsnInterfacesInterfaceItems0OperStatusUp captures enum value "up" + DataCocsnInterfacesCocsnInterfacesInterfaceItems0OperStatusUp string = "up" + + // DataCocsnInterfacesCocsnInterfacesInterfaceItems0OperStatusDown captures enum value "down" + DataCocsnInterfacesCocsnInterfacesInterfaceItems0OperStatusDown string = "down" +) + +// prop value enum +func (m *DataCocsnInterfacesCocsnInterfacesInterfaceItems0) validateOperStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, dataCocsnInterfacesCocsnInterfacesInterfaceItems0TypeOperStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DataCocsnInterfacesCocsnInterfacesInterfaceItems0) validateOperStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.OperStatus) { // not required + return nil + } + + // value enum + if err := m.validateOperStatusEnum("oper-status", "body", *m.OperStatus); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnInterfacesCocsnInterfacesInterfaceItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnInterfacesCocsnInterfacesInterfaceItems0) UnmarshalBinary(b []byte) error { + var res DataCocsnInterfacesCocsnInterfacesInterfaceItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_interfaces_interface.go b/api/models/data_cocsn_interfaces_interface.go new file mode 100644 index 0000000000000000000000000000000000000000..196295ccda5f1873d802c4aed7f012533a8bc360 --- /dev/null +++ b/api/models/data_cocsn_interfaces_interface.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DataCocsnInterfacesInterface data cocsn interfaces interface +// +// swagger:model data_cocsn_interfaces_interface +type DataCocsnInterfacesInterface struct { + + // (list) + CocsnInterface []*DataCocsnInterfacesInterfaceCocsnInterfaceItems0 `json:"cocsn:interface"` +} + +// Validate validates this data cocsn interfaces interface +func (m *DataCocsnInterfacesInterface) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCocsnInterface(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataCocsnInterfacesInterface) validateCocsnInterface(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnInterface) { // not required + return nil + } + + for i := 0; i < len(m.CocsnInterface); i++ { + if swag.IsZero(m.CocsnInterface[i]) { // not required + continue + } + + if m.CocsnInterface[i] != nil { + if err := m.CocsnInterface[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:interface" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnInterfacesInterface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnInterfacesInterface) UnmarshalBinary(b []byte) error { + var res DataCocsnInterfacesInterface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataCocsnInterfacesInterfaceCocsnInterfaceItems0 data cocsn interfaces interface cocsn interface items0 +// +// swagger:model DataCocsnInterfacesInterfaceCocsnInterfaceItems0 +type DataCocsnInterfacesInterfaceCocsnInterfaceItems0 struct { + + // addresses + Addresses []string `json:"addresses"` + + // Enable or disable the interface. Example value: true (leaf) + Enabled bool `json:"enabled,omitempty"` + + // Interface name. Example value: en0 (leaf) + Name string `json:"name,omitempty"` + + // Describes whether the interface is physically up or down (leaf) + // Enum: [up down] + OperStatus *string `json:"oper-status,omitempty"` + + // The interface's address at its protocol sub-layer. For + // example, for an 802.x interface, this object normally + // contains a Media Access Control (MAC) address. The + // interface's media-specific modules must define the bit + // and byte ordering and the format of the value of this + // object. For interfaces that do not have such an address + // (e.g., a serial line), this node is not present. (leaf) + PhysAddress string `json:"phys-address,omitempty"` +} + +// Validate validates this data cocsn interfaces interface cocsn interface items0 +func (m *DataCocsnInterfacesInterfaceCocsnInterfaceItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOperStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var dataCocsnInterfacesInterfaceCocsnInterfaceItems0TypeOperStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["up","down"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + dataCocsnInterfacesInterfaceCocsnInterfaceItems0TypeOperStatusPropEnum = append(dataCocsnInterfacesInterfaceCocsnInterfaceItems0TypeOperStatusPropEnum, v) + } +} + +const ( + + // DataCocsnInterfacesInterfaceCocsnInterfaceItems0OperStatusUp captures enum value "up" + DataCocsnInterfacesInterfaceCocsnInterfaceItems0OperStatusUp string = "up" + + // DataCocsnInterfacesInterfaceCocsnInterfaceItems0OperStatusDown captures enum value "down" + DataCocsnInterfacesInterfaceCocsnInterfaceItems0OperStatusDown string = "down" +) + +// prop value enum +func (m *DataCocsnInterfacesInterfaceCocsnInterfaceItems0) validateOperStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, dataCocsnInterfacesInterfaceCocsnInterfaceItems0TypeOperStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DataCocsnInterfacesInterfaceCocsnInterfaceItems0) validateOperStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.OperStatus) { // not required + return nil + } + + // value enum + if err := m.validateOperStatusEnum("oper-status", "body", *m.OperStatus); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnInterfacesInterfaceCocsnInterfaceItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnInterfacesInterfaceCocsnInterfaceItems0) UnmarshalBinary(b []byte) error { + var res DataCocsnInterfacesInterfaceCocsnInterfaceItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_interfaces_interface_interface_name.go b/api/models/data_cocsn_interfaces_interface_interface_name.go new file mode 100644 index 0000000000000000000000000000000000000000..8e89f2d300410f3cd0882c4d0328c8e08972a08b --- /dev/null +++ b/api/models/data_cocsn_interfaces_interface_interface_name.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DataCocsnInterfacesInterfaceInterfaceName data cocsn interfaces interface interface name +// +// swagger:model data_cocsn_interfaces_interface_interface-name +type DataCocsnInterfacesInterfaceInterfaceName struct { + + // (list) + CocsnInterface []*DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0 `json:"cocsn:interface"` +} + +// Validate validates this data cocsn interfaces interface interface name +func (m *DataCocsnInterfacesInterfaceInterfaceName) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCocsnInterface(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataCocsnInterfacesInterfaceInterfaceName) validateCocsnInterface(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnInterface) { // not required + return nil + } + + for i := 0; i < len(m.CocsnInterface); i++ { + if swag.IsZero(m.CocsnInterface[i]) { // not required + continue + } + + if m.CocsnInterface[i] != nil { + if err := m.CocsnInterface[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:interface" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnInterfacesInterfaceInterfaceName) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnInterfacesInterfaceInterfaceName) UnmarshalBinary(b []byte) error { + var res DataCocsnInterfacesInterfaceInterfaceName + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0 data cocsn interfaces interface interface name cocsn interface items0 +// +// swagger:model DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0 +type DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0 struct { + + // addresses + Addresses []string `json:"addresses"` + + // Enable or disable the interface. Example value: true (leaf) + Enabled bool `json:"enabled,omitempty"` + + // Interface name. Example value: en0 (leaf) + Name string `json:"name,omitempty"` + + // Describes whether the interface is physically up or down (leaf) + // Enum: [up down] + OperStatus *string `json:"oper-status,omitempty"` + + // The interface's address at its protocol sub-layer. For + // example, for an 802.x interface, this object normally + // contains a Media Access Control (MAC) address. The + // interface's media-specific modules must define the bit + // and byte ordering and the format of the value of this + // object. For interfaces that do not have such an address + // (e.g., a serial line), this node is not present. (leaf) + PhysAddress string `json:"phys-address,omitempty"` +} + +// Validate validates this data cocsn interfaces interface interface name cocsn interface items0 +func (m *DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOperStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var dataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0TypeOperStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["up","down"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + dataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0TypeOperStatusPropEnum = append(dataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0TypeOperStatusPropEnum, v) + } +} + +const ( + + // DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0OperStatusUp captures enum value "up" + DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0OperStatusUp string = "up" + + // DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0OperStatusDown captures enum value "down" + DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0OperStatusDown string = "down" +) + +// prop value enum +func (m *DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0) validateOperStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, dataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0TypeOperStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0) validateOperStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.OperStatus) { // not required + return nil + } + + // value enum + if err := m.validateOperStatusEnum("oper-status", "body", *m.OperStatus); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0) UnmarshalBinary(b []byte) error { + var res DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_interfaces_interface_interface_name_addresses.go b/api/models/data_cocsn_interfaces_interface_interface_name_addresses.go new file mode 100644 index 0000000000000000000000000000000000000000..e7c13abb2700a6b2db3fd9adac1baa67d5629570 --- /dev/null +++ b/api/models/data_cocsn_interfaces_interface_interface_name_addresses.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnInterfacesInterfaceInterfaceNameAddresses data cocsn interfaces interface interface name addresses +// +// swagger:model data_cocsn_interfaces_interface_interface-name_addresses +type DataCocsnInterfacesInterfaceInterfaceNameAddresses struct { + + // cocsn addresses + CocsnAddresses []string `json:"cocsn:addresses"` +} + +// Validate validates this data cocsn interfaces interface interface name addresses +func (m *DataCocsnInterfacesInterfaceInterfaceNameAddresses) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnInterfacesInterfaceInterfaceNameAddresses) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnInterfacesInterfaceInterfaceNameAddresses) UnmarshalBinary(b []byte) error { + var res DataCocsnInterfacesInterfaceInterfaceNameAddresses + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_interfaces_interface_interface_name_addresses_addresses_id.go b/api/models/data_cocsn_interfaces_interface_interface_name_addresses_addresses_id.go new file mode 100644 index 0000000000000000000000000000000000000000..ffd498564ff499af5dcc83c2ccf89f9b0d7313f4 --- /dev/null +++ b/api/models/data_cocsn_interfaces_interface_interface_name_addresses_addresses_id.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesID data cocsn interfaces interface interface name addresses addresses id +// +// swagger:model data_cocsn_interfaces_interface_interface-name_addresses_addresses-id +type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesID struct { + + // cocsn addresses + CocsnAddresses []string `json:"cocsn:addresses"` +} + +// Validate validates this data cocsn interfaces interface interface name addresses addresses id +func (m *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesID) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesID) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesID) UnmarshalBinary(b []byte) error { + var res DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesID + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_interfaces_interface_interface_name_enabled.go b/api/models/data_cocsn_interfaces_interface_interface_name_enabled.go new file mode 100644 index 0000000000000000000000000000000000000000..b77ad50e8273331b57347909ef7b85a847805c6e --- /dev/null +++ b/api/models/data_cocsn_interfaces_interface_interface_name_enabled.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnInterfacesInterfaceInterfaceNameEnabled data cocsn interfaces interface interface name enabled +// +// swagger:model data_cocsn_interfaces_interface_interface-name_enabled +type DataCocsnInterfacesInterfaceInterfaceNameEnabled struct { + + // Enable or disable the interface. Example value: true (leaf) + CocsnEnabled bool `json:"cocsn:enabled,omitempty"` +} + +// Validate validates this data cocsn interfaces interface interface name enabled +func (m *DataCocsnInterfacesInterfaceInterfaceNameEnabled) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnInterfacesInterfaceInterfaceNameEnabled) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnInterfacesInterfaceInterfaceNameEnabled) UnmarshalBinary(b []byte) error { + var res DataCocsnInterfacesInterfaceInterfaceNameEnabled + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_interfaces_interface_interface_name_name.go b/api/models/data_cocsn_interfaces_interface_interface_name_name.go new file mode 100644 index 0000000000000000000000000000000000000000..aad7664ba0cb696ab3fc995dc2b82eb0affeff9f --- /dev/null +++ b/api/models/data_cocsn_interfaces_interface_interface_name_name.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnInterfacesInterfaceInterfaceNameName data cocsn interfaces interface interface name name +// +// swagger:model data_cocsn_interfaces_interface_interface-name_name +type DataCocsnInterfacesInterfaceInterfaceNameName struct { + + // Interface name. Example value: en0 (leaf) + CocsnName string `json:"cocsn:name,omitempty"` +} + +// Validate validates this data cocsn interfaces interface interface name name +func (m *DataCocsnInterfacesInterfaceInterfaceNameName) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnInterfacesInterfaceInterfaceNameName) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnInterfacesInterfaceInterfaceNameName) UnmarshalBinary(b []byte) error { + var res DataCocsnInterfacesInterfaceInterfaceNameName + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_interfaces_interface_interface_name_oper_status.go b/api/models/data_cocsn_interfaces_interface_interface_name_oper_status.go new file mode 100644 index 0000000000000000000000000000000000000000..89b1dc7a3ff6ef249db7395e841c91d9d65c49e8 --- /dev/null +++ b/api/models/data_cocsn_interfaces_interface_interface_name_oper_status.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DataCocsnInterfacesInterfaceInterfaceNameOperStatus data cocsn interfaces interface interface name oper status +// +// swagger:model data_cocsn_interfaces_interface_interface-name_oper-status +type DataCocsnInterfacesInterfaceInterfaceNameOperStatus struct { + + // Describes whether the interface is physically up or down (leaf) + // Enum: [up down] + CocsnOperStatus *string `json:"cocsn:oper-status,omitempty"` +} + +// Validate validates this data cocsn interfaces interface interface name oper status +func (m *DataCocsnInterfacesInterfaceInterfaceNameOperStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCocsnOperStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var dataCocsnInterfacesInterfaceInterfaceNameOperStatusTypeCocsnOperStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["up","down"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + dataCocsnInterfacesInterfaceInterfaceNameOperStatusTypeCocsnOperStatusPropEnum = append(dataCocsnInterfacesInterfaceInterfaceNameOperStatusTypeCocsnOperStatusPropEnum, v) + } +} + +const ( + + // DataCocsnInterfacesInterfaceInterfaceNameOperStatusCocsnOperStatusUp captures enum value "up" + DataCocsnInterfacesInterfaceInterfaceNameOperStatusCocsnOperStatusUp string = "up" + + // DataCocsnInterfacesInterfaceInterfaceNameOperStatusCocsnOperStatusDown captures enum value "down" + DataCocsnInterfacesInterfaceInterfaceNameOperStatusCocsnOperStatusDown string = "down" +) + +// prop value enum +func (m *DataCocsnInterfacesInterfaceInterfaceNameOperStatus) validateCocsnOperStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, dataCocsnInterfacesInterfaceInterfaceNameOperStatusTypeCocsnOperStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DataCocsnInterfacesInterfaceInterfaceNameOperStatus) validateCocsnOperStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnOperStatus) { // not required + return nil + } + + // value enum + if err := m.validateCocsnOperStatusEnum("cocsn:oper-status", "body", *m.CocsnOperStatus); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnInterfacesInterfaceInterfaceNameOperStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnInterfacesInterfaceInterfaceNameOperStatus) UnmarshalBinary(b []byte) error { + var res DataCocsnInterfacesInterfaceInterfaceNameOperStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_interfaces_interface_interface_name_phys_address.go b/api/models/data_cocsn_interfaces_interface_interface_name_phys_address.go new file mode 100644 index 0000000000000000000000000000000000000000..d7c3257a23e3795ae0884254345d5299dc832d41 --- /dev/null +++ b/api/models/data_cocsn_interfaces_interface_interface_name_phys_address.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnInterfacesInterfaceInterfaceNamePhysAddress data cocsn interfaces interface interface name phys address +// +// swagger:model data_cocsn_interfaces_interface_interface-name_phys-address +type DataCocsnInterfacesInterfaceInterfaceNamePhysAddress struct { + + // The interface's address at its protocol sub-layer. For + // example, for an 802.x interface, this object normally + // contains a Media Access Control (MAC) address. The + // interface's media-specific modules must define the bit + // and byte ordering and the format of the value of this + // object. For interfaces that do not have such an address + // (e.g., a serial line), this node is not present. (leaf) + CocsnPhysAddress string `json:"cocsn:phys-address,omitempty"` +} + +// Validate validates this data cocsn interfaces interface interface name phys address +func (m *DataCocsnInterfacesInterfaceInterfaceNamePhysAddress) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnInterfacesInterfaceInterfaceNamePhysAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnInterfacesInterfaceInterfaceNamePhysAddress) UnmarshalBinary(b []byte) error { + var res DataCocsnInterfacesInterfaceInterfaceNamePhysAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_interfaces_post.go b/api/models/data_cocsn_interfaces_post.go new file mode 100644 index 0000000000000000000000000000000000000000..60413b2b4d888a8365958c81c0819503f2a5b4c3 --- /dev/null +++ b/api/models/data_cocsn_interfaces_post.go @@ -0,0 +1,185 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DataCocsnInterfacesPost data cocsn interfaces post +// +// swagger:model data_cocsn_interfaces-post +type DataCocsnInterfacesPost struct { + + // (list) + CocsnInterface []*DataCocsnInterfacesPostCocsnInterfaceItems0 `json:"cocsn:interface"` +} + +// Validate validates this data cocsn interfaces post +func (m *DataCocsnInterfacesPost) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCocsnInterface(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataCocsnInterfacesPost) validateCocsnInterface(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnInterface) { // not required + return nil + } + + for i := 0; i < len(m.CocsnInterface); i++ { + if swag.IsZero(m.CocsnInterface[i]) { // not required + continue + } + + if m.CocsnInterface[i] != nil { + if err := m.CocsnInterface[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:interface" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnInterfacesPost) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnInterfacesPost) UnmarshalBinary(b []byte) error { + var res DataCocsnInterfacesPost + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataCocsnInterfacesPostCocsnInterfaceItems0 data cocsn interfaces post cocsn interface items0 +// +// swagger:model DataCocsnInterfacesPostCocsnInterfaceItems0 +type DataCocsnInterfacesPostCocsnInterfaceItems0 struct { + + // addresses + Addresses []string `json:"addresses"` + + // Enable or disable the interface. Example value: true (leaf) + Enabled bool `json:"enabled,omitempty"` + + // Interface name. Example value: en0 (leaf) + Name string `json:"name,omitempty"` + + // Describes whether the interface is physically up or down (leaf) + // Enum: [up down] + OperStatus *string `json:"oper-status,omitempty"` + + // The interface's address at its protocol sub-layer. For + // example, for an 802.x interface, this object normally + // contains a Media Access Control (MAC) address. The + // interface's media-specific modules must define the bit + // and byte ordering and the format of the value of this + // object. For interfaces that do not have such an address + // (e.g., a serial line), this node is not present. (leaf) + PhysAddress string `json:"phys-address,omitempty"` +} + +// Validate validates this data cocsn interfaces post cocsn interface items0 +func (m *DataCocsnInterfacesPostCocsnInterfaceItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOperStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var dataCocsnInterfacesPostCocsnInterfaceItems0TypeOperStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["up","down"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + dataCocsnInterfacesPostCocsnInterfaceItems0TypeOperStatusPropEnum = append(dataCocsnInterfacesPostCocsnInterfaceItems0TypeOperStatusPropEnum, v) + } +} + +const ( + + // DataCocsnInterfacesPostCocsnInterfaceItems0OperStatusUp captures enum value "up" + DataCocsnInterfacesPostCocsnInterfaceItems0OperStatusUp string = "up" + + // DataCocsnInterfacesPostCocsnInterfaceItems0OperStatusDown captures enum value "down" + DataCocsnInterfacesPostCocsnInterfaceItems0OperStatusDown string = "down" +) + +// prop value enum +func (m *DataCocsnInterfacesPostCocsnInterfaceItems0) validateOperStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, dataCocsnInterfacesPostCocsnInterfaceItems0TypeOperStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DataCocsnInterfacesPostCocsnInterfaceItems0) validateOperStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.OperStatus) { // not required + return nil + } + + // value enum + if err := m.validateOperStatusEnum("oper-status", "body", *m.OperStatus); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnInterfacesPostCocsnInterfaceItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnInterfacesPostCocsnInterfaceItems0) UnmarshalBinary(b []byte) error { + var res DataCocsnInterfacesPostCocsnInterfaceItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_routes.go b/api/models/data_cocsn_routes.go new file mode 100644 index 0000000000000000000000000000000000000000..4d494baf140f3d4e61c5c01cfd28472d7c1f9976 --- /dev/null +++ b/api/models/data_cocsn_routes.go @@ -0,0 +1,183 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnRoutes data cocsn routes +// +// swagger:model data_cocsn_routes +type DataCocsnRoutes struct { + + // cocsn routes + CocsnRoutes *DataCocsnRoutesCocsnRoutes `json:"cocsn:routes,omitempty"` +} + +// Validate validates this data cocsn routes +func (m *DataCocsnRoutes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCocsnRoutes(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataCocsnRoutes) validateCocsnRoutes(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnRoutes) { // not required + return nil + } + + if m.CocsnRoutes != nil { + if err := m.CocsnRoutes.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:routes") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnRoutes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnRoutes) UnmarshalBinary(b []byte) error { + var res DataCocsnRoutes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataCocsnRoutesCocsnRoutes (non-presence) +// +// swagger:model DataCocsnRoutesCocsnRoutes +type DataCocsnRoutesCocsnRoutes struct { + + // (list) + Route []*DataCocsnRoutesCocsnRoutesRouteItems0 `json:"route"` +} + +// Validate validates this data cocsn routes cocsn routes +func (m *DataCocsnRoutesCocsnRoutes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRoute(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataCocsnRoutesCocsnRoutes) validateRoute(formats strfmt.Registry) error { + + if swag.IsZero(m.Route) { // not required + return nil + } + + for i := 0; i < len(m.Route); i++ { + if swag.IsZero(m.Route[i]) { // not required + continue + } + + if m.Route[i] != nil { + if err := m.Route[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:routes" + "." + "route" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnRoutesCocsnRoutes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnRoutesCocsnRoutes) UnmarshalBinary(b []byte) error { + var res DataCocsnRoutesCocsnRoutes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataCocsnRoutesCocsnRoutesRouteItems0 data cocsn routes cocsn routes route items0 +// +// swagger:model DataCocsnRoutesCocsnRoutesRouteItems0 +type DataCocsnRoutesCocsnRoutesRouteItems0 struct { + + // Route destination. IP network (leaf) + Destination string `json:"destination,omitempty"` + + // Expiration timer of the route (leaf) + Expire string `json:"expire,omitempty"` + + // Flags of the route (leaf) + Flags string `json:"flags,omitempty"` + + // Route gateway. IP address or host name (leaf) + Gateway string `json:"gateway,omitempty"` + + // Interface used for the route (leaf) + Interface string `json:"interface,omitempty"` +} + +// Validate validates this data cocsn routes cocsn routes route items0 +func (m *DataCocsnRoutesCocsnRoutesRouteItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnRoutesCocsnRoutesRouteItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnRoutesCocsnRoutesRouteItems0) UnmarshalBinary(b []byte) error { + var res DataCocsnRoutesCocsnRoutesRouteItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_routes_post.go b/api/models/data_cocsn_routes_post.go new file mode 100644 index 0000000000000000000000000000000000000000..370e523bac76c8b1878a1958f7ed7615aee8bff0 --- /dev/null +++ b/api/models/data_cocsn_routes_post.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnRoutesPost data cocsn routes post +// +// swagger:model data_cocsn_routes-post +type DataCocsnRoutesPost struct { + + // (list) + CocsnRoute []*DataCocsnRoutesPostCocsnRouteItems0 `json:"cocsn:route"` +} + +// Validate validates this data cocsn routes post +func (m *DataCocsnRoutesPost) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCocsnRoute(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataCocsnRoutesPost) validateCocsnRoute(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnRoute) { // not required + return nil + } + + for i := 0; i < len(m.CocsnRoute); i++ { + if swag.IsZero(m.CocsnRoute[i]) { // not required + continue + } + + if m.CocsnRoute[i] != nil { + if err := m.CocsnRoute[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:route" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnRoutesPost) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnRoutesPost) UnmarshalBinary(b []byte) error { + var res DataCocsnRoutesPost + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataCocsnRoutesPostCocsnRouteItems0 data cocsn routes post cocsn route items0 +// +// swagger:model DataCocsnRoutesPostCocsnRouteItems0 +type DataCocsnRoutesPostCocsnRouteItems0 struct { + + // Route destination. IP network (leaf) + Destination string `json:"destination,omitempty"` + + // Expiration timer of the route (leaf) + Expire string `json:"expire,omitempty"` + + // Flags of the route (leaf) + Flags string `json:"flags,omitempty"` + + // Route gateway. IP address or host name (leaf) + Gateway string `json:"gateway,omitempty"` + + // Interface used for the route (leaf) + Interface string `json:"interface,omitempty"` +} + +// Validate validates this data cocsn routes post cocsn route items0 +func (m *DataCocsnRoutesPostCocsnRouteItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnRoutesPostCocsnRouteItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnRoutesPostCocsnRouteItems0) UnmarshalBinary(b []byte) error { + var res DataCocsnRoutesPostCocsnRouteItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_routes_route.go b/api/models/data_cocsn_routes_route.go new file mode 100644 index 0000000000000000000000000000000000000000..c2c0581c80fd5ca1f451f762486040a5e757b9b3 --- /dev/null +++ b/api/models/data_cocsn_routes_route.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnRoutesRoute data cocsn routes route +// +// swagger:model data_cocsn_routes_route +type DataCocsnRoutesRoute struct { + + // (list) + CocsnRoute []*DataCocsnRoutesRouteCocsnRouteItems0 `json:"cocsn:route"` +} + +// Validate validates this data cocsn routes route +func (m *DataCocsnRoutesRoute) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCocsnRoute(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataCocsnRoutesRoute) validateCocsnRoute(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnRoute) { // not required + return nil + } + + for i := 0; i < len(m.CocsnRoute); i++ { + if swag.IsZero(m.CocsnRoute[i]) { // not required + continue + } + + if m.CocsnRoute[i] != nil { + if err := m.CocsnRoute[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:route" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnRoutesRoute) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnRoutesRoute) UnmarshalBinary(b []byte) error { + var res DataCocsnRoutesRoute + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataCocsnRoutesRouteCocsnRouteItems0 data cocsn routes route cocsn route items0 +// +// swagger:model DataCocsnRoutesRouteCocsnRouteItems0 +type DataCocsnRoutesRouteCocsnRouteItems0 struct { + + // Route destination. IP network (leaf) + Destination string `json:"destination,omitempty"` + + // Expiration timer of the route (leaf) + Expire string `json:"expire,omitempty"` + + // Flags of the route (leaf) + Flags string `json:"flags,omitempty"` + + // Route gateway. IP address or host name (leaf) + Gateway string `json:"gateway,omitempty"` + + // Interface used for the route (leaf) + Interface string `json:"interface,omitempty"` +} + +// Validate validates this data cocsn routes route cocsn route items0 +func (m *DataCocsnRoutesRouteCocsnRouteItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnRoutesRouteCocsnRouteItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnRoutesRouteCocsnRouteItems0) UnmarshalBinary(b []byte) error { + var res DataCocsnRoutesRouteCocsnRouteItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_routes_route_route_destination.go b/api/models/data_cocsn_routes_route_route_destination.go new file mode 100644 index 0000000000000000000000000000000000000000..8559ca7f4f812324445f85e7cbfc9e781844b54c --- /dev/null +++ b/api/models/data_cocsn_routes_route_route_destination.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnRoutesRouteRouteDestination data cocsn routes route route destination +// +// swagger:model data_cocsn_routes_route_route-destination +type DataCocsnRoutesRouteRouteDestination struct { + + // (list) + CocsnRoute []*DataCocsnRoutesRouteRouteDestinationCocsnRouteItems0 `json:"cocsn:route"` +} + +// Validate validates this data cocsn routes route route destination +func (m *DataCocsnRoutesRouteRouteDestination) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCocsnRoute(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataCocsnRoutesRouteRouteDestination) validateCocsnRoute(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnRoute) { // not required + return nil + } + + for i := 0; i < len(m.CocsnRoute); i++ { + if swag.IsZero(m.CocsnRoute[i]) { // not required + continue + } + + if m.CocsnRoute[i] != nil { + if err := m.CocsnRoute[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:route" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnRoutesRouteRouteDestination) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnRoutesRouteRouteDestination) UnmarshalBinary(b []byte) error { + var res DataCocsnRoutesRouteRouteDestination + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataCocsnRoutesRouteRouteDestinationCocsnRouteItems0 data cocsn routes route route destination cocsn route items0 +// +// swagger:model DataCocsnRoutesRouteRouteDestinationCocsnRouteItems0 +type DataCocsnRoutesRouteRouteDestinationCocsnRouteItems0 struct { + + // Route destination. IP network (leaf) + Destination string `json:"destination,omitempty"` + + // Expiration timer of the route (leaf) + Expire string `json:"expire,omitempty"` + + // Flags of the route (leaf) + Flags string `json:"flags,omitempty"` + + // Route gateway. IP address or host name (leaf) + Gateway string `json:"gateway,omitempty"` + + // Interface used for the route (leaf) + Interface string `json:"interface,omitempty"` +} + +// Validate validates this data cocsn routes route route destination cocsn route items0 +func (m *DataCocsnRoutesRouteRouteDestinationCocsnRouteItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnRoutesRouteRouteDestinationCocsnRouteItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnRoutesRouteRouteDestinationCocsnRouteItems0) UnmarshalBinary(b []byte) error { + var res DataCocsnRoutesRouteRouteDestinationCocsnRouteItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_routes_route_route_destination_destination.go b/api/models/data_cocsn_routes_route_route_destination_destination.go new file mode 100644 index 0000000000000000000000000000000000000000..413bcd192b5b5bc2d0181fcdab88524e0229fa79 --- /dev/null +++ b/api/models/data_cocsn_routes_route_route_destination_destination.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnRoutesRouteRouteDestinationDestination data cocsn routes route route destination destination +// +// swagger:model data_cocsn_routes_route_route-destination_destination +type DataCocsnRoutesRouteRouteDestinationDestination struct { + + // Route destination. IP network (leaf) + CocsnDestination string `json:"cocsn:destination,omitempty"` +} + +// Validate validates this data cocsn routes route route destination destination +func (m *DataCocsnRoutesRouteRouteDestinationDestination) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnRoutesRouteRouteDestinationDestination) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnRoutesRouteRouteDestinationDestination) UnmarshalBinary(b []byte) error { + var res DataCocsnRoutesRouteRouteDestinationDestination + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_routes_route_route_destination_expire.go b/api/models/data_cocsn_routes_route_route_destination_expire.go new file mode 100644 index 0000000000000000000000000000000000000000..e3f6f5c6e152e0c944ca31b1b328826860efb189 --- /dev/null +++ b/api/models/data_cocsn_routes_route_route_destination_expire.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnRoutesRouteRouteDestinationExpire data cocsn routes route route destination expire +// +// swagger:model data_cocsn_routes_route_route-destination_expire +type DataCocsnRoutesRouteRouteDestinationExpire struct { + + // Expiration timer of the route (leaf) + CocsnExpire string `json:"cocsn:expire,omitempty"` +} + +// Validate validates this data cocsn routes route route destination expire +func (m *DataCocsnRoutesRouteRouteDestinationExpire) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnRoutesRouteRouteDestinationExpire) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnRoutesRouteRouteDestinationExpire) UnmarshalBinary(b []byte) error { + var res DataCocsnRoutesRouteRouteDestinationExpire + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_routes_route_route_destination_flags.go b/api/models/data_cocsn_routes_route_route_destination_flags.go new file mode 100644 index 0000000000000000000000000000000000000000..f209b3cc753765707d286d95fe14166d8f573020 --- /dev/null +++ b/api/models/data_cocsn_routes_route_route_destination_flags.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnRoutesRouteRouteDestinationFlags data cocsn routes route route destination flags +// +// swagger:model data_cocsn_routes_route_route-destination_flags +type DataCocsnRoutesRouteRouteDestinationFlags struct { + + // Flags of the route (leaf) + CocsnFlags string `json:"cocsn:flags,omitempty"` +} + +// Validate validates this data cocsn routes route route destination flags +func (m *DataCocsnRoutesRouteRouteDestinationFlags) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnRoutesRouteRouteDestinationFlags) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnRoutesRouteRouteDestinationFlags) UnmarshalBinary(b []byte) error { + var res DataCocsnRoutesRouteRouteDestinationFlags + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_routes_route_route_destination_gateway.go b/api/models/data_cocsn_routes_route_route_destination_gateway.go new file mode 100644 index 0000000000000000000000000000000000000000..df1bc2d83a36d97b8936801378bb5b71860f26b1 --- /dev/null +++ b/api/models/data_cocsn_routes_route_route_destination_gateway.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnRoutesRouteRouteDestinationGateway data cocsn routes route route destination gateway +// +// swagger:model data_cocsn_routes_route_route-destination_gateway +type DataCocsnRoutesRouteRouteDestinationGateway struct { + + // Route gateway. IP address or host name (leaf) + CocsnGateway string `json:"cocsn:gateway,omitempty"` +} + +// Validate validates this data cocsn routes route route destination gateway +func (m *DataCocsnRoutesRouteRouteDestinationGateway) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnRoutesRouteRouteDestinationGateway) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnRoutesRouteRouteDestinationGateway) UnmarshalBinary(b []byte) error { + var res DataCocsnRoutesRouteRouteDestinationGateway + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_cocsn_routes_route_route_destination_interface.go b/api/models/data_cocsn_routes_route_route_destination_interface.go new file mode 100644 index 0000000000000000000000000000000000000000..ea7be89498a6868163cd44fd82a29632e5ca233d --- /dev/null +++ b/api/models/data_cocsn_routes_route_route_destination_interface.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DataCocsnRoutesRouteRouteDestinationInterface data cocsn routes route route destination interface +// +// swagger:model data_cocsn_routes_route_route-destination_interface +type DataCocsnRoutesRouteRouteDestinationInterface struct { + + // Interface used for the route (leaf) + CocsnInterface string `json:"cocsn:interface,omitempty"` +} + +// Validate validates this data cocsn routes route route destination interface +func (m *DataCocsnRoutesRouteRouteDestinationInterface) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataCocsnRoutesRouteRouteDestinationInterface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataCocsnRoutesRouteRouteDestinationInterface) UnmarshalBinary(b []byte) error { + var res DataCocsnRoutesRouteRouteDestinationInterface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_post.go b/api/models/data_post.go new file mode 100644 index 0000000000000000000000000000000000000000..1b2e91146ea06aa9f42f2de6b68c65c6881bfc5b --- /dev/null +++ b/api/models/data_post.go @@ -0,0 +1,508 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DataPost data post +// +// swagger:model data-post +type DataPost struct { + + // cocsn arp table + CocsnArpTable *DataPostCocsnArpTable `json:"cocsn:arp-table,omitempty"` + + // cocsn interfaces + CocsnInterfaces *DataPostCocsnInterfaces `json:"cocsn:interfaces,omitempty"` + + // cocsn routes + CocsnRoutes *DataPostCocsnRoutes `json:"cocsn:routes,omitempty"` +} + +// Validate validates this data post +func (m *DataPost) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCocsnArpTable(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCocsnInterfaces(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCocsnRoutes(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataPost) validateCocsnArpTable(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnArpTable) { // not required + return nil + } + + if m.CocsnArpTable != nil { + if err := m.CocsnArpTable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:arp-table") + } + return err + } + } + + return nil +} + +func (m *DataPost) validateCocsnInterfaces(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnInterfaces) { // not required + return nil + } + + if m.CocsnInterfaces != nil { + if err := m.CocsnInterfaces.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:interfaces") + } + return err + } + } + + return nil +} + +func (m *DataPost) validateCocsnRoutes(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnRoutes) { // not required + return nil + } + + if m.CocsnRoutes != nil { + if err := m.CocsnRoutes.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:routes") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataPost) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataPost) UnmarshalBinary(b []byte) error { + var res DataPost + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataPostCocsnArpTable (non-presence) +// +// swagger:model DataPostCocsnArpTable +type DataPostCocsnArpTable struct { + + // (list) + ArpEntry []*DataPostCocsnArpTableArpEntryItems0 `json:"arp-entry"` +} + +// Validate validates this data post cocsn arp table +func (m *DataPostCocsnArpTable) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateArpEntry(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataPostCocsnArpTable) validateArpEntry(formats strfmt.Registry) error { + + if swag.IsZero(m.ArpEntry) { // not required + return nil + } + + for i := 0; i < len(m.ArpEntry); i++ { + if swag.IsZero(m.ArpEntry[i]) { // not required + continue + } + + if m.ArpEntry[i] != nil { + if err := m.ArpEntry[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:arp-table" + "." + "arp-entry" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataPostCocsnArpTable) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataPostCocsnArpTable) UnmarshalBinary(b []byte) error { + var res DataPostCocsnArpTable + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataPostCocsnArpTableArpEntryItems0 data post cocsn arp table arp entry items0 +// +// swagger:model DataPostCocsnArpTableArpEntryItems0 +type DataPostCocsnArpTableArpEntryItems0 struct { + + // IP address of the arp entry (leaf) + Address string `json:"address,omitempty"` + + // Interface of the arp entry (leaf) + Interface string `json:"interface,omitempty"` + + // MAC address of the arp entry (leaf) + PhsAddress string `json:"phs-address,omitempty"` +} + +// Validate validates this data post cocsn arp table arp entry items0 +func (m *DataPostCocsnArpTableArpEntryItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataPostCocsnArpTableArpEntryItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataPostCocsnArpTableArpEntryItems0) UnmarshalBinary(b []byte) error { + var res DataPostCocsnArpTableArpEntryItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataPostCocsnInterfaces (non-presence) +// +// swagger:model DataPostCocsnInterfaces +type DataPostCocsnInterfaces struct { + + // (list) + Interface []*DataPostCocsnInterfacesInterfaceItems0 `json:"interface"` +} + +// Validate validates this data post cocsn interfaces +func (m *DataPostCocsnInterfaces) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateInterface(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataPostCocsnInterfaces) validateInterface(formats strfmt.Registry) error { + + if swag.IsZero(m.Interface) { // not required + return nil + } + + for i := 0; i < len(m.Interface); i++ { + if swag.IsZero(m.Interface[i]) { // not required + continue + } + + if m.Interface[i] != nil { + if err := m.Interface[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:interfaces" + "." + "interface" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataPostCocsnInterfaces) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataPostCocsnInterfaces) UnmarshalBinary(b []byte) error { + var res DataPostCocsnInterfaces + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataPostCocsnInterfacesInterfaceItems0 data post cocsn interfaces interface items0 +// +// swagger:model DataPostCocsnInterfacesInterfaceItems0 +type DataPostCocsnInterfacesInterfaceItems0 struct { + + // addresses + Addresses []string `json:"addresses"` + + // Enable or disable the interface. Example value: true (leaf) + Enabled bool `json:"enabled,omitempty"` + + // Interface name. Example value: en0 (leaf) + Name string `json:"name,omitempty"` + + // Describes whether the interface is physically up or down (leaf) + // Enum: [up down] + OperStatus *string `json:"oper-status,omitempty"` + + // The interface's address at its protocol sub-layer. For + // example, for an 802.x interface, this object normally + // contains a Media Access Control (MAC) address. The + // interface's media-specific modules must define the bit + // and byte ordering and the format of the value of this + // object. For interfaces that do not have such an address + // (e.g., a serial line), this node is not present. (leaf) + PhysAddress string `json:"phys-address,omitempty"` +} + +// Validate validates this data post cocsn interfaces interface items0 +func (m *DataPostCocsnInterfacesInterfaceItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOperStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var dataPostCocsnInterfacesInterfaceItems0TypeOperStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["up","down"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + dataPostCocsnInterfacesInterfaceItems0TypeOperStatusPropEnum = append(dataPostCocsnInterfacesInterfaceItems0TypeOperStatusPropEnum, v) + } +} + +const ( + + // DataPostCocsnInterfacesInterfaceItems0OperStatusUp captures enum value "up" + DataPostCocsnInterfacesInterfaceItems0OperStatusUp string = "up" + + // DataPostCocsnInterfacesInterfaceItems0OperStatusDown captures enum value "down" + DataPostCocsnInterfacesInterfaceItems0OperStatusDown string = "down" +) + +// prop value enum +func (m *DataPostCocsnInterfacesInterfaceItems0) validateOperStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, dataPostCocsnInterfacesInterfaceItems0TypeOperStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DataPostCocsnInterfacesInterfaceItems0) validateOperStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.OperStatus) { // not required + return nil + } + + // value enum + if err := m.validateOperStatusEnum("oper-status", "body", *m.OperStatus); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataPostCocsnInterfacesInterfaceItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataPostCocsnInterfacesInterfaceItems0) UnmarshalBinary(b []byte) error { + var res DataPostCocsnInterfacesInterfaceItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataPostCocsnRoutes (non-presence) +// +// swagger:model DataPostCocsnRoutes +type DataPostCocsnRoutes struct { + + // (list) + Route []*DataPostCocsnRoutesRouteItems0 `json:"route"` +} + +// Validate validates this data post cocsn routes +func (m *DataPostCocsnRoutes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRoute(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataPostCocsnRoutes) validateRoute(formats strfmt.Registry) error { + + if swag.IsZero(m.Route) { // not required + return nil + } + + for i := 0; i < len(m.Route); i++ { + if swag.IsZero(m.Route[i]) { // not required + continue + } + + if m.Route[i] != nil { + if err := m.Route[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cocsn:routes" + "." + "route" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataPostCocsnRoutes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataPostCocsnRoutes) UnmarshalBinary(b []byte) error { + var res DataPostCocsnRoutes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataPostCocsnRoutesRouteItems0 data post cocsn routes route items0 +// +// swagger:model DataPostCocsnRoutesRouteItems0 +type DataPostCocsnRoutesRouteItems0 struct { + + // Route destination. IP network (leaf) + Destination string `json:"destination,omitempty"` + + // Expiration timer of the route (leaf) + Expire string `json:"expire,omitempty"` + + // Flags of the route (leaf) + Flags string `json:"flags,omitempty"` + + // Route gateway. IP address or host name (leaf) + Gateway string `json:"gateway,omitempty"` + + // Interface used for the route (leaf) + Interface string `json:"interface,omitempty"` +} + +// Validate validates this data post cocsn routes route items0 +func (m *DataPostCocsnRoutesRouteItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataPostCocsnRoutesRouteItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataPostCocsnRoutesRouteItems0) UnmarshalBinary(b []byte) error { + var res DataPostCocsnRoutesRouteItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/data_put_patch.go b/api/models/data_put_patch.go new file mode 100644 index 0000000000000000000000000000000000000000..9bd8c8153344dace534ea0f646e82ffce35ebf0f --- /dev/null +++ b/api/models/data_put_patch.go @@ -0,0 +1,567 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DataPutPatch data put patch +// +// swagger:model data-put-patch +type DataPutPatch struct { + + // ietf restconf data + IetfRestconfData *DataPutPatchIetfRestconfData `json:"ietf-restconf:data,omitempty"` +} + +// Validate validates this data put patch +func (m *DataPutPatch) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIetfRestconfData(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataPutPatch) validateIetfRestconfData(formats strfmt.Registry) error { + + if swag.IsZero(m.IetfRestconfData) { // not required + return nil + } + + if m.IetfRestconfData != nil { + if err := m.IetfRestconfData.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ietf-restconf:data") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataPutPatch) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataPutPatch) UnmarshalBinary(b []byte) error { + var res DataPutPatch + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataPutPatchIetfRestconfData This YANG module represents the CoCSN API +// +// swagger:model DataPutPatchIetfRestconfData +type DataPutPatchIetfRestconfData struct { + + // cocsn arp table + CocsnArpTable *DataPutPatchIetfRestconfDataCocsnArpTable `json:"cocsn:arp-table,omitempty"` + + // cocsn interfaces + CocsnInterfaces *DataPutPatchIetfRestconfDataCocsnInterfaces `json:"cocsn:interfaces,omitempty"` + + // cocsn routes + CocsnRoutes *DataPutPatchIetfRestconfDataCocsnRoutes `json:"cocsn:routes,omitempty"` +} + +// Validate validates this data put patch ietf restconf data +func (m *DataPutPatchIetfRestconfData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCocsnArpTable(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCocsnInterfaces(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCocsnRoutes(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataPutPatchIetfRestconfData) validateCocsnArpTable(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnArpTable) { // not required + return nil + } + + if m.CocsnArpTable != nil { + if err := m.CocsnArpTable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ietf-restconf:data" + "." + "cocsn:arp-table") + } + return err + } + } + + return nil +} + +func (m *DataPutPatchIetfRestconfData) validateCocsnInterfaces(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnInterfaces) { // not required + return nil + } + + if m.CocsnInterfaces != nil { + if err := m.CocsnInterfaces.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ietf-restconf:data" + "." + "cocsn:interfaces") + } + return err + } + } + + return nil +} + +func (m *DataPutPatchIetfRestconfData) validateCocsnRoutes(formats strfmt.Registry) error { + + if swag.IsZero(m.CocsnRoutes) { // not required + return nil + } + + if m.CocsnRoutes != nil { + if err := m.CocsnRoutes.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ietf-restconf:data" + "." + "cocsn:routes") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataPutPatchIetfRestconfData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataPutPatchIetfRestconfData) UnmarshalBinary(b []byte) error { + var res DataPutPatchIetfRestconfData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataPutPatchIetfRestconfDataCocsnArpTable (non-presence) +// +// swagger:model DataPutPatchIetfRestconfDataCocsnArpTable +type DataPutPatchIetfRestconfDataCocsnArpTable struct { + + // (list) + ArpEntry []*DataPutPatchIetfRestconfDataCocsnArpTableArpEntryItems0 `json:"arp-entry"` +} + +// Validate validates this data put patch ietf restconf data cocsn arp table +func (m *DataPutPatchIetfRestconfDataCocsnArpTable) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateArpEntry(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataPutPatchIetfRestconfDataCocsnArpTable) validateArpEntry(formats strfmt.Registry) error { + + if swag.IsZero(m.ArpEntry) { // not required + return nil + } + + for i := 0; i < len(m.ArpEntry); i++ { + if swag.IsZero(m.ArpEntry[i]) { // not required + continue + } + + if m.ArpEntry[i] != nil { + if err := m.ArpEntry[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ietf-restconf:data" + "." + "cocsn:arp-table" + "." + "arp-entry" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataPutPatchIetfRestconfDataCocsnArpTable) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataPutPatchIetfRestconfDataCocsnArpTable) UnmarshalBinary(b []byte) error { + var res DataPutPatchIetfRestconfDataCocsnArpTable + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataPutPatchIetfRestconfDataCocsnArpTableArpEntryItems0 data put patch ietf restconf data cocsn arp table arp entry items0 +// +// swagger:model DataPutPatchIetfRestconfDataCocsnArpTableArpEntryItems0 +type DataPutPatchIetfRestconfDataCocsnArpTableArpEntryItems0 struct { + + // IP address of the arp entry (leaf) + Address string `json:"address,omitempty"` + + // Interface of the arp entry (leaf) + Interface string `json:"interface,omitempty"` + + // MAC address of the arp entry (leaf) + PhsAddress string `json:"phs-address,omitempty"` +} + +// Validate validates this data put patch ietf restconf data cocsn arp table arp entry items0 +func (m *DataPutPatchIetfRestconfDataCocsnArpTableArpEntryItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataPutPatchIetfRestconfDataCocsnArpTableArpEntryItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataPutPatchIetfRestconfDataCocsnArpTableArpEntryItems0) UnmarshalBinary(b []byte) error { + var res DataPutPatchIetfRestconfDataCocsnArpTableArpEntryItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataPutPatchIetfRestconfDataCocsnInterfaces (non-presence) +// +// swagger:model DataPutPatchIetfRestconfDataCocsnInterfaces +type DataPutPatchIetfRestconfDataCocsnInterfaces struct { + + // (list) + Interface []*DataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0 `json:"interface"` +} + +// Validate validates this data put patch ietf restconf data cocsn interfaces +func (m *DataPutPatchIetfRestconfDataCocsnInterfaces) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateInterface(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataPutPatchIetfRestconfDataCocsnInterfaces) validateInterface(formats strfmt.Registry) error { + + if swag.IsZero(m.Interface) { // not required + return nil + } + + for i := 0; i < len(m.Interface); i++ { + if swag.IsZero(m.Interface[i]) { // not required + continue + } + + if m.Interface[i] != nil { + if err := m.Interface[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ietf-restconf:data" + "." + "cocsn:interfaces" + "." + "interface" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataPutPatchIetfRestconfDataCocsnInterfaces) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataPutPatchIetfRestconfDataCocsnInterfaces) UnmarshalBinary(b []byte) error { + var res DataPutPatchIetfRestconfDataCocsnInterfaces + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0 data put patch ietf restconf data cocsn interfaces interface items0 +// +// swagger:model DataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0 +type DataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0 struct { + + // addresses + Addresses []string `json:"addresses"` + + // Enable or disable the interface. Example value: true (leaf) + Enabled bool `json:"enabled,omitempty"` + + // Interface name. Example value: en0 (leaf) + Name string `json:"name,omitempty"` + + // Describes whether the interface is physically up or down (leaf) + // Enum: [up down] + OperStatus *string `json:"oper-status,omitempty"` + + // The interface's address at its protocol sub-layer. For + // example, for an 802.x interface, this object normally + // contains a Media Access Control (MAC) address. The + // interface's media-specific modules must define the bit + // and byte ordering and the format of the value of this + // object. For interfaces that do not have such an address + // (e.g., a serial line), this node is not present. (leaf) + PhysAddress string `json:"phys-address,omitempty"` +} + +// Validate validates this data put patch ietf restconf data cocsn interfaces interface items0 +func (m *DataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOperStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var dataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0TypeOperStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["up","down"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + dataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0TypeOperStatusPropEnum = append(dataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0TypeOperStatusPropEnum, v) + } +} + +const ( + + // DataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0OperStatusUp captures enum value "up" + DataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0OperStatusUp string = "up" + + // DataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0OperStatusDown captures enum value "down" + DataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0OperStatusDown string = "down" +) + +// prop value enum +func (m *DataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0) validateOperStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, dataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0TypeOperStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0) validateOperStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.OperStatus) { // not required + return nil + } + + // value enum + if err := m.validateOperStatusEnum("oper-status", "body", *m.OperStatus); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0) UnmarshalBinary(b []byte) error { + var res DataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataPutPatchIetfRestconfDataCocsnRoutes (non-presence) +// +// swagger:model DataPutPatchIetfRestconfDataCocsnRoutes +type DataPutPatchIetfRestconfDataCocsnRoutes struct { + + // (list) + Route []*DataPutPatchIetfRestconfDataCocsnRoutesRouteItems0 `json:"route"` +} + +// Validate validates this data put patch ietf restconf data cocsn routes +func (m *DataPutPatchIetfRestconfDataCocsnRoutes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRoute(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DataPutPatchIetfRestconfDataCocsnRoutes) validateRoute(formats strfmt.Registry) error { + + if swag.IsZero(m.Route) { // not required + return nil + } + + for i := 0; i < len(m.Route); i++ { + if swag.IsZero(m.Route[i]) { // not required + continue + } + + if m.Route[i] != nil { + if err := m.Route[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ietf-restconf:data" + "." + "cocsn:routes" + "." + "route" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DataPutPatchIetfRestconfDataCocsnRoutes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataPutPatchIetfRestconfDataCocsnRoutes) UnmarshalBinary(b []byte) error { + var res DataPutPatchIetfRestconfDataCocsnRoutes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DataPutPatchIetfRestconfDataCocsnRoutesRouteItems0 data put patch ietf restconf data cocsn routes route items0 +// +// swagger:model DataPutPatchIetfRestconfDataCocsnRoutesRouteItems0 +type DataPutPatchIetfRestconfDataCocsnRoutesRouteItems0 struct { + + // Route destination. IP network (leaf) + Destination string `json:"destination,omitempty"` + + // Expiration timer of the route (leaf) + Expire string `json:"expire,omitempty"` + + // Flags of the route (leaf) + Flags string `json:"flags,omitempty"` + + // Route gateway. IP address or host name (leaf) + Gateway string `json:"gateway,omitempty"` + + // Interface used for the route (leaf) + Interface string `json:"interface,omitempty"` +} + +// Validate validates this data put patch ietf restconf data cocsn routes route items0 +func (m *DataPutPatchIetfRestconfDataCocsnRoutesRouteItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DataPutPatchIetfRestconfDataCocsnRoutesRouteItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DataPutPatchIetfRestconfDataCocsnRoutesRouteItems0) UnmarshalBinary(b []byte) error { + var res DataPutPatchIetfRestconfDataCocsnRoutesRouteItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/operations.go b/api/models/operations.go new file mode 100644 index 0000000000000000000000000000000000000000..58f5a2ea4b811107c0183fc6aba5494cb06e4ec5 --- /dev/null +++ b/api/models/operations.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Operations operations +// +// swagger:model operations +type Operations struct { + + // This resource is a container that provides access to the data-model-specific RPC operations supported by the server. See RESTCONF RFC 8040 for further information. + IetfRestconfOperations interface{} `json:"ietf-restconf:operations,omitempty"` +} + +// Validate validates this operations +func (m *Operations) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Operations) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Operations) UnmarshalBinary(b []byte) error { + var res Operations + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/root.go b/api/models/root.go new file mode 100644 index 0000000000000000000000000000000000000000..3d61f262a770b826d29683aa8a093a0435b32df0 --- /dev/null +++ b/api/models/root.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Root root +// +// swagger:model root +type Root struct { + + // ietf restconf restconf + IetfRestconfRestconf *RootIetfRestconfRestconf `json:"ietf-restconf:restconf,omitempty"` +} + +// Validate validates this root +func (m *Root) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIetfRestconfRestconf(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Root) validateIetfRestconfRestconf(formats strfmt.Registry) error { + + if swag.IsZero(m.IetfRestconfRestconf) { // not required + return nil + } + + if m.IetfRestconfRestconf != nil { + if err := m.IetfRestconfRestconf.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ietf-restconf:restconf") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Root) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Root) UnmarshalBinary(b []byte) error { + var res Root + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// RootIetfRestconfRestconf This is the RESTCONF root resource for the RESTCONF datastore and operation resources. See RESTCONF RFC 8040 for further information. +// +// swagger:model RootIetfRestconfRestconf +type RootIetfRestconfRestconf struct { + + // data + Data interface{} `json:"data,omitempty"` + + // operations + Operations interface{} `json:"operations,omitempty"` + + // yang library version + YangLibraryVersion string `json:"yang-library-version,omitempty"` +} + +// Validate validates this root ietf restconf restconf +func (m *RootIetfRestconfRestconf) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RootIetfRestconfRestconf) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RootIetfRestconfRestconf) UnmarshalBinary(b []byte) error { + var res RootIetfRestconfRestconf + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/models/yang_library_version.go b/api/models/yang_library_version.go new file mode 100644 index 0000000000000000000000000000000000000000..06c49883c2b7e87eded1f6aafcbbf21b71b97385 --- /dev/null +++ b/api/models/yang_library_version.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// YangLibraryVersion yang library version +// +// swagger:model yang-library-version +type YangLibraryVersion struct { + + // This leaf identifies the revision date of the 'ietf-yang-library' YANG module that is implemented by this server. See RESTCONF RFC 8040 for further information. + IetfRestconfYangLibraryVersion interface{} `json:"ietf-restconf:yang-library-version,omitempty"` +} + +// Validate validates this yang library version +func (m *YangLibraryVersion) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *YangLibraryVersion) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *YangLibraryVersion) UnmarshalBinary(b []byte) error { + var res YangLibraryVersion + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/restapi/configure_cocsn.go b/api/restapi/configure_cocsn.go new file mode 100644 index 0000000000000000000000000000000000000000..9c38b2dda259451cd80dd1eb2b4882a06010700c --- /dev/null +++ b/api/restapi/configure_cocsn.go @@ -0,0 +1,296 @@ +// This file is safe to edit. Once it exists it will not be overwritten + +package restapi + +import ( + "crypto/tls" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/restapi/operations" + "code.fbi.h-da.de/cocsn/cocsn-api/api/restapi/operations/data" + "code.fbi.h-da.de/cocsn/cocsn-api/api/restapi/operations/operationsops" + "code.fbi.h-da.de/cocsn/cocsn-api/api/restapi/operations/root" + "code.fbi.h-da.de/cocsn/cocsn-api/api/restapi/operations/yang_library_version" +) + +//go:generate swagger generate server --target ../../api --name Cocsn --spec ../../cocsn.json --principal interface{} + +func configureFlags(api *operations.CocsnAPI) { + // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } +} + +func configureAPI(api *operations.CocsnAPI) http.Handler { + // configure the api here + api.ServeError = errors.ServeError + + // Set your custom logger if needed. Default one is log.Printf + // Expected interface func(string, ...interface{}) + // + // Example: + // api.Logger = log.Printf + + api.UseSwaggerUI() + // To continue using redoc as your UI, uncomment the following line + // api.UseRedoc() + + api.JSONConsumer = runtime.JSONConsumer() + + api.JSONProducer = runtime.JSONProducer() + + // Applies when the Authorization header is set with the Basic scheme + if api.BasicAuthAuth == nil { + api.BasicAuthAuth = func(user string, pass string) (interface{}, error) { + return nil, errors.NotImplemented("basic auth (basicAuth) has not yet been implemented") + } + } + + // Set your custom authorizer if needed. Default one is security.Authorized() + // Expected interface runtime.Authorizer + // + // Example: + // api.APIAuthorizer = security.Authorized() + if api.DataDataCocsnArpTableArpEntryArpEntryAddressAddressGetHandler == nil { + api.DataDataCocsnArpTableArpEntryArpEntryAddressAddressGetHandler = data.DataCocsnArpTableArpEntryArpEntryAddressAddressGetHandlerFunc(func(params data.DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTableArpEntryArpEntryAddressAddressGet has not yet been implemented") + }) + } + if api.DataDataCocsnArpTableArpEntryArpEntryAddressGetHandler == nil { + api.DataDataCocsnArpTableArpEntryArpEntryAddressGetHandler = data.DataCocsnArpTableArpEntryArpEntryAddressGetHandlerFunc(func(params data.DataCocsnArpTableArpEntryArpEntryAddressGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTableArpEntryArpEntryAddressGet has not yet been implemented") + }) + } + if api.DataDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetHandler == nil { + api.DataDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetHandler = data.DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetHandlerFunc(func(params data.DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTableArpEntryArpEntryAddressInterfaceGet has not yet been implemented") + }) + } + if api.DataDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetHandler == nil { + api.DataDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetHandler = data.DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetHandlerFunc(func(params data.DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGet has not yet been implemented") + }) + } + if api.DataDataCocsnArpTableArpEntryGetHandler == nil { + api.DataDataCocsnArpTableArpEntryGetHandler = data.DataCocsnArpTableArpEntryGetHandlerFunc(func(params data.DataCocsnArpTableArpEntryGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTableArpEntryGet has not yet been implemented") + }) + } + if api.DataDataCocsnArpTableDeleteHandler == nil { + api.DataDataCocsnArpTableDeleteHandler = data.DataCocsnArpTableDeleteHandlerFunc(func(params data.DataCocsnArpTableDeleteParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTableDelete has not yet been implemented") + }) + } + if api.DataDataCocsnArpTableGetHandler == nil { + api.DataDataCocsnArpTableGetHandler = data.DataCocsnArpTableGetHandlerFunc(func(params data.DataCocsnArpTableGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTableGet has not yet been implemented") + }) + } + if api.DataDataCocsnArpTablePatchHandler == nil { + api.DataDataCocsnArpTablePatchHandler = data.DataCocsnArpTablePatchHandlerFunc(func(params data.DataCocsnArpTablePatchParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTablePatch has not yet been implemented") + }) + } + if api.DataDataCocsnArpTablePostHandler == nil { + api.DataDataCocsnArpTablePostHandler = data.DataCocsnArpTablePostHandlerFunc(func(params data.DataCocsnArpTablePostParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTablePost has not yet been implemented") + }) + } + if api.DataDataCocsnArpTablePutHandler == nil { + api.DataDataCocsnArpTablePutHandler = data.DataCocsnArpTablePutHandlerFunc(func(params data.DataCocsnArpTablePutParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTablePut has not yet been implemented") + }) + } + if api.DataDataCocsnInterfacesDeleteHandler == nil { + api.DataDataCocsnInterfacesDeleteHandler = data.DataCocsnInterfacesDeleteHandlerFunc(func(params data.DataCocsnInterfacesDeleteParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesDelete has not yet been implemented") + }) + } + if api.DataDataCocsnInterfacesGetHandler == nil { + api.DataDataCocsnInterfacesGetHandler = data.DataCocsnInterfacesGetHandlerFunc(func(params data.DataCocsnInterfacesGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesGet has not yet been implemented") + }) + } + if api.DataDataCocsnInterfacesInterfaceGetHandler == nil { + api.DataDataCocsnInterfacesInterfaceGetHandler = data.DataCocsnInterfacesInterfaceGetHandlerFunc(func(params data.DataCocsnInterfacesInterfaceGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesInterfaceGet has not yet been implemented") + }) + } + if api.DataDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetHandler == nil { + api.DataDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetHandler = data.DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetHandlerFunc(func(params data.DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGet has not yet been implemented") + }) + } + if api.DataDataCocsnInterfacesInterfaceInterfaceNameAddressesGetHandler == nil { + api.DataDataCocsnInterfacesInterfaceInterfaceNameAddressesGetHandler = data.DataCocsnInterfacesInterfaceInterfaceNameAddressesGetHandlerFunc(func(params data.DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesInterfaceInterfaceNameAddressesGet has not yet been implemented") + }) + } + if api.DataDataCocsnInterfacesInterfaceInterfaceNameEnabledGetHandler == nil { + api.DataDataCocsnInterfacesInterfaceInterfaceNameEnabledGetHandler = data.DataCocsnInterfacesInterfaceInterfaceNameEnabledGetHandlerFunc(func(params data.DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesInterfaceInterfaceNameEnabledGet has not yet been implemented") + }) + } + if api.DataDataCocsnInterfacesInterfaceInterfaceNameGetHandler == nil { + api.DataDataCocsnInterfacesInterfaceInterfaceNameGetHandler = data.DataCocsnInterfacesInterfaceInterfaceNameGetHandlerFunc(func(params data.DataCocsnInterfacesInterfaceInterfaceNameGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesInterfaceInterfaceNameGet has not yet been implemented") + }) + } + if api.DataDataCocsnInterfacesInterfaceInterfaceNameNameGetHandler == nil { + api.DataDataCocsnInterfacesInterfaceInterfaceNameNameGetHandler = data.DataCocsnInterfacesInterfaceInterfaceNameNameGetHandlerFunc(func(params data.DataCocsnInterfacesInterfaceInterfaceNameNameGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesInterfaceInterfaceNameNameGet has not yet been implemented") + }) + } + if api.DataDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetHandler == nil { + api.DataDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetHandler = data.DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetHandlerFunc(func(params data.DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesInterfaceInterfaceNameOperStatusGet has not yet been implemented") + }) + } + if api.DataDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetHandler == nil { + api.DataDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetHandler = data.DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetHandlerFunc(func(params data.DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGet has not yet been implemented") + }) + } + if api.DataDataCocsnInterfacesPatchHandler == nil { + api.DataDataCocsnInterfacesPatchHandler = data.DataCocsnInterfacesPatchHandlerFunc(func(params data.DataCocsnInterfacesPatchParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesPatch has not yet been implemented") + }) + } + if api.DataDataCocsnInterfacesPostHandler == nil { + api.DataDataCocsnInterfacesPostHandler = data.DataCocsnInterfacesPostHandlerFunc(func(params data.DataCocsnInterfacesPostParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesPost has not yet been implemented") + }) + } + if api.DataDataCocsnInterfacesPutHandler == nil { + api.DataDataCocsnInterfacesPutHandler = data.DataCocsnInterfacesPutHandlerFunc(func(params data.DataCocsnInterfacesPutParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesPut has not yet been implemented") + }) + } + if api.DataDataCocsnRoutesDeleteHandler == nil { + api.DataDataCocsnRoutesDeleteHandler = data.DataCocsnRoutesDeleteHandlerFunc(func(params data.DataCocsnRoutesDeleteParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesDelete has not yet been implemented") + }) + } + if api.DataDataCocsnRoutesGetHandler == nil { + api.DataDataCocsnRoutesGetHandler = data.DataCocsnRoutesGetHandlerFunc(func(params data.DataCocsnRoutesGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesGet has not yet been implemented") + }) + } + if api.DataDataCocsnRoutesPatchHandler == nil { + api.DataDataCocsnRoutesPatchHandler = data.DataCocsnRoutesPatchHandlerFunc(func(params data.DataCocsnRoutesPatchParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesPatch has not yet been implemented") + }) + } + if api.DataDataCocsnRoutesPostHandler == nil { + api.DataDataCocsnRoutesPostHandler = data.DataCocsnRoutesPostHandlerFunc(func(params data.DataCocsnRoutesPostParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesPost has not yet been implemented") + }) + } + if api.DataDataCocsnRoutesPutHandler == nil { + api.DataDataCocsnRoutesPutHandler = data.DataCocsnRoutesPutHandlerFunc(func(params data.DataCocsnRoutesPutParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesPut has not yet been implemented") + }) + } + if api.DataDataCocsnRoutesRouteGetHandler == nil { + api.DataDataCocsnRoutesRouteGetHandler = data.DataCocsnRoutesRouteGetHandlerFunc(func(params data.DataCocsnRoutesRouteGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesRouteGet has not yet been implemented") + }) + } + if api.DataDataCocsnRoutesRouteRouteDestinationDestinationGetHandler == nil { + api.DataDataCocsnRoutesRouteRouteDestinationDestinationGetHandler = data.DataCocsnRoutesRouteRouteDestinationDestinationGetHandlerFunc(func(params data.DataCocsnRoutesRouteRouteDestinationDestinationGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesRouteRouteDestinationDestinationGet has not yet been implemented") + }) + } + if api.DataDataCocsnRoutesRouteRouteDestinationExpireGetHandler == nil { + api.DataDataCocsnRoutesRouteRouteDestinationExpireGetHandler = data.DataCocsnRoutesRouteRouteDestinationExpireGetHandlerFunc(func(params data.DataCocsnRoutesRouteRouteDestinationExpireGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesRouteRouteDestinationExpireGet has not yet been implemented") + }) + } + if api.DataDataCocsnRoutesRouteRouteDestinationFlagsGetHandler == nil { + api.DataDataCocsnRoutesRouteRouteDestinationFlagsGetHandler = data.DataCocsnRoutesRouteRouteDestinationFlagsGetHandlerFunc(func(params data.DataCocsnRoutesRouteRouteDestinationFlagsGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesRouteRouteDestinationFlagsGet has not yet been implemented") + }) + } + if api.DataDataCocsnRoutesRouteRouteDestinationGatewayGetHandler == nil { + api.DataDataCocsnRoutesRouteRouteDestinationGatewayGetHandler = data.DataCocsnRoutesRouteRouteDestinationGatewayGetHandlerFunc(func(params data.DataCocsnRoutesRouteRouteDestinationGatewayGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesRouteRouteDestinationGatewayGet has not yet been implemented") + }) + } + if api.DataDataCocsnRoutesRouteRouteDestinationGetHandler == nil { + api.DataDataCocsnRoutesRouteRouteDestinationGetHandler = data.DataCocsnRoutesRouteRouteDestinationGetHandlerFunc(func(params data.DataCocsnRoutesRouteRouteDestinationGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesRouteRouteDestinationGet has not yet been implemented") + }) + } + if api.DataDataCocsnRoutesRouteRouteDestinationInterfaceGetHandler == nil { + api.DataDataCocsnRoutesRouteRouteDestinationInterfaceGetHandler = data.DataCocsnRoutesRouteRouteDestinationInterfaceGetHandlerFunc(func(params data.DataCocsnRoutesRouteRouteDestinationInterfaceGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesRouteRouteDestinationInterfaceGet has not yet been implemented") + }) + } + if api.DataDataGetHandler == nil { + api.DataDataGetHandler = data.DataGetHandlerFunc(func(params data.DataGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataGet has not yet been implemented") + }) + } + if api.DataDataPatchHandler == nil { + api.DataDataPatchHandler = data.DataPatchHandlerFunc(func(params data.DataPatchParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataPatch has not yet been implemented") + }) + } + if api.DataDataPostHandler == nil { + api.DataDataPostHandler = data.DataPostHandlerFunc(func(params data.DataPostParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataPost has not yet been implemented") + }) + } + if api.DataDataPutHandler == nil { + api.DataDataPutHandler = data.DataPutHandlerFunc(func(params data.DataPutParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataPut has not yet been implemented") + }) + } + if api.OperationsopsOperationsGetHandler == nil { + api.OperationsopsOperationsGetHandler = operationsops.OperationsGetHandlerFunc(func(params operationsops.OperationsGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation operationsops.OperationsGet has not yet been implemented") + }) + } + if api.RootRootGetHandler == nil { + api.RootRootGetHandler = root.RootGetHandlerFunc(func(params root.RootGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation root.RootGet has not yet been implemented") + }) + } + if api.YangLibraryVersionYangLibraryVersionGetHandler == nil { + api.YangLibraryVersionYangLibraryVersionGetHandler = yang_library_version.YangLibraryVersionGetHandlerFunc(func(params yang_library_version.YangLibraryVersionGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation yang_library_version.YangLibraryVersionGet has not yet been implemented") + }) + } + + api.PreServerShutdown = func() {} + + api.ServerShutdown = func() {} + + return setupGlobalMiddleware(api.Serve(setupMiddlewares)) +} + +// The TLS configuration before HTTPS server starts. +func configureTLS(tlsConfig *tls.Config) { + // Make all necessary changes to the TLS configuration here. +} + +// As soon as server is initialized but not run yet, this function will be called. +// If you need to modify a config, store server instance to stop it individually later, this is the place. +// This function can be called multiple times, depending on the number of serving schemes. +// scheme value will be set accordingly: "http", "https" or "unix" +func configureServer(s *http.Server, scheme, addr string) { +} + +// The middleware configuration is for the handler executors. These do not apply to the swagger.json document. +// The middleware executes after routing but before authentication, binding and validation +func setupMiddlewares(handler http.Handler) http.Handler { + return handler +} + +// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document. +// So this is a good place to plug in a panic handling middleware, logging and metrics +func setupGlobalMiddleware(handler http.Handler) http.Handler { + return handler +} diff --git a/api/restapi/doc.go b/api/restapi/doc.go new file mode 100644 index 0000000000000000000000000000000000000000..b4d0738667cde116e334d443cb688b81f3babc42 --- /dev/null +++ b/api/restapi/doc.go @@ -0,0 +1,20 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Package restapi cocsn +// +// This YANG module represents the CoCSN API +// Schemes: +// http +// https +// Host: localhost +// BasePath: /restconf +// Version: 2020-08-17 +// +// Consumes: +// - application/yang-data+json +// +// Produces: +// - application/yang-data+json +// +// swagger:meta +package restapi diff --git a/api/restapi/embedded_spec.go b/api/restapi/embedded_spec.go new file mode 100644 index 0000000000000000000000000000000000000000..eda4f3ca48d63dee5538ac45ce61f5abff5b2478 --- /dev/null +++ b/api/restapi/embedded_spec.go @@ -0,0 +1,8797 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package restapi + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" +) + +var ( + // SwaggerJSON embedded version of the swagger document used at generation time + SwaggerJSON json.RawMessage + // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time + FlatSwaggerJSON json.RawMessage +) + +func init() { + SwaggerJSON = json.RawMessage([]byte(`{ + "consumes": [ + "application/yang-data+json" + ], + "produces": [ + "application/yang-data+json" + ], + "schemes": [ + "http", + "https" + ], + "swagger": "2.0", + "info": { + "description": "This YANG module represents the CoCSN API", + "title": "cocsn", + "version": "2020-08-17" + }, + "basePath": "/restconf", + "paths": { + "/": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "This YANG module represents the CoCSN API", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "root", + "get" + ], + "summary": "This YANG module represents the CoCSN API", + "operationId": "root_get", + "responses": { + "200": { + "description": "This YANG module represents the CoCSN API", + "schema": { + "$ref": "#/definitions/root" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "This YANG module represents the CoCSN API", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "This YANG module represents the CoCSN API", + "operationId": "data_get", + "responses": { + "200": { + "description": "This YANG module represents the CoCSN API", + "schema": { + "$ref": "#/definitions/data" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + }, + "put": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "This YANG module represents the CoCSN API", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "put" + ], + "summary": "This YANG module represents the CoCSN API", + "operationId": "data_put", + "parameters": [ + { + "$ref": "#/parameters/data-put-patch" + } + ], + "responses": { + "201": { + "description": "This YANG module represents the CoCSN API" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + }, + "post": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "This YANG module represents the CoCSN API", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "post" + ], + "summary": "This YANG module represents the CoCSN API", + "operationId": "data_post", + "parameters": [ + { + "$ref": "#/parameters/data-post" + } + ], + "responses": { + "201": { + "description": "This YANG module represents the CoCSN API" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + }, + "patch": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "This YANG module represents the CoCSN API", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "patch" + ], + "summary": "This YANG module represents the CoCSN API", + "operationId": "data_patch", + "parameters": [ + { + "$ref": "#/parameters/data-put-patch" + } + ], + "responses": { + "204": { + "description": "This YANG module represents the CoCSN API" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:arp-table": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "operationId": "data_cocsn_arp_table_get", + "parameters": [ + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + }, + "put": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "put" + ], + "operationId": "data_cocsn_arp_table_put", + "parameters": [ + { + "$ref": "#/parameters/data_cocsn_arp-table" + } + ], + "responses": { + "201": { + "description": "container arp-table created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + }, + "post": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "post" + ], + "operationId": "data_cocsn_arp_table_post", + "parameters": [ + { + "$ref": "#/parameters/data_cocsn_arp-table-post" + } + ], + "responses": { + "201": { + "description": "container arp-table created" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + }, + "delete": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "delete" + ], + "operationId": "data_cocsn_arp_table_delete", + "responses": { + "204": { + "$ref": "#/responses/204" + } + } + }, + "patch": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "patch" + ], + "operationId": "data_cocsn_arp_table_patch", + "parameters": [ + { + "$ref": "#/parameters/data_cocsn_arp-table" + } + ], + "responses": { + "204": { + "description": "container arp-table updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:arp-table/arp-entry": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "operationId": "data_cocsn_arp_table_arp_entry_get", + "parameters": [ + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table_arp-entry" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:arp-table/arp-entry={arp-entry-address}": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "operationId": "data_cocsn_arp_table_arp_entry_arp_entry_address_get", + "parameters": [ + { + "$ref": "#/parameters/arp-entry-address" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table_arp-entry_arp-entry-address" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:arp-table/arp-entry={arp-entry-address}/address": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "IP address of the arp entry", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "IP address of the arp entry", + "operationId": "data_cocsn_arp_table_arp_entry_arp_entry_address_address_get", + "parameters": [ + { + "$ref": "#/parameters/arp-entry-address" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "IP address of the arp entry", + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table_arp-entry_arp-entry-address_address" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:arp-table/arp-entry={arp-entry-address}/interface": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Interface of the arp entry", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Interface of the arp entry", + "operationId": "data_cocsn_arp_table_arp_entry_arp_entry_address_interface_get", + "parameters": [ + { + "$ref": "#/parameters/arp-entry-address" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Interface of the arp entry", + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table_arp-entry_arp-entry-address_interface" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:arp-table/arp-entry={arp-entry-address}/phs-address": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "MAC address of the arp entry", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "MAC address of the arp entry", + "operationId": "data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address_get", + "parameters": [ + { + "$ref": "#/parameters/arp-entry-address" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "MAC address of the arp entry", + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table_arp-entry_arp-entry-address_phs-address" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:interfaces": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "operationId": "data_cocsn_interfaces_get", + "parameters": [ + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + }, + "put": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "put" + ], + "operationId": "data_cocsn_interfaces_put", + "parameters": [ + { + "$ref": "#/parameters/data_cocsn_interfaces" + } + ], + "responses": { + "201": { + "description": "container interfaces created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + }, + "post": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "post" + ], + "operationId": "data_cocsn_interfaces_post", + "parameters": [ + { + "$ref": "#/parameters/data_cocsn_interfaces-post" + } + ], + "responses": { + "201": { + "description": "container interfaces created" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + }, + "delete": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "delete" + ], + "operationId": "data_cocsn_interfaces_delete", + "responses": { + "204": { + "$ref": "#/responses/204" + } + } + }, + "patch": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "patch" + ], + "operationId": "data_cocsn_interfaces_patch", + "parameters": [ + { + "$ref": "#/parameters/data_cocsn_interfaces" + } + ], + "responses": { + "204": { + "description": "container interfaces updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:interfaces/interface": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "operationId": "data_cocsn_interfaces_interface_get", + "parameters": [ + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:interfaces/interface={interface-name}": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "operationId": "data_cocsn_interfaces_interface_interface_name_get", + "parameters": [ + { + "$ref": "#/parameters/interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:interfaces/interface={interface-name}/addresses": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Interface IP address. Example value: 10.10.10.1", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Interface IP address. Example value: 10.10.10.1", + "operationId": "data_cocsn_interfaces_interface_interface_name_addresses_get", + "parameters": [ + { + "$ref": "#/parameters/interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Interface IP address. Example value: 10.10.10.1", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name_addresses" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:interfaces/interface={interface-name}/addresses={addresses-id}": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Interface IP address. Example value: 10.10.10.1", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Interface IP address. Example value: 10.10.10.1", + "operationId": "data_cocsn_interfaces_interface_interface_name_addresses_addresses_id_get", + "parameters": [ + { + "$ref": "#/parameters/interface-name" + }, + { + "$ref": "#/parameters/addresses-id" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Interface IP address. Example value: 10.10.10.1", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name_addresses_addresses-id" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:interfaces/interface={interface-name}/enabled": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Enable or disable the interface. Example value: true", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Enable or disable the interface. Example value: true", + "operationId": "data_cocsn_interfaces_interface_interface_name_enabled_get", + "parameters": [ + { + "$ref": "#/parameters/interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Enable or disable the interface. Example value: true", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name_enabled" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:interfaces/interface={interface-name}/name": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Interface name. Example value: en0", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Interface name. Example value: en0", + "operationId": "data_cocsn_interfaces_interface_interface_name_name_get", + "parameters": [ + { + "$ref": "#/parameters/interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Interface name. Example value: en0", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name_name" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:interfaces/interface={interface-name}/oper-status": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Describes whether the interface is physically up or down", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Describes whether the interface is physically up or down", + "operationId": "data_cocsn_interfaces_interface_interface_name_oper_status_get", + "parameters": [ + { + "$ref": "#/parameters/interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Describes whether the interface is physically up or down", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name_oper-status" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:interfaces/interface={interface-name}/phys-address": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present.", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present.", + "operationId": "data_cocsn_interfaces_interface_interface_name_phys_address_get", + "parameters": [ + { + "$ref": "#/parameters/interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present.", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name_phys-address" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:routes": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "operationId": "data_cocsn_routes_get", + "parameters": [ + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_routes" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + }, + "put": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "put" + ], + "operationId": "data_cocsn_routes_put", + "parameters": [ + { + "$ref": "#/parameters/data_cocsn_routes" + } + ], + "responses": { + "201": { + "description": "container routes created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + }, + "post": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "post" + ], + "operationId": "data_cocsn_routes_post", + "parameters": [ + { + "$ref": "#/parameters/data_cocsn_routes-post" + } + ], + "responses": { + "201": { + "description": "container routes created" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + }, + "delete": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "delete" + ], + "operationId": "data_cocsn_routes_delete", + "responses": { + "204": { + "$ref": "#/responses/204" + } + } + }, + "patch": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "patch" + ], + "operationId": "data_cocsn_routes_patch", + "parameters": [ + { + "$ref": "#/parameters/data_cocsn_routes" + } + ], + "responses": { + "204": { + "description": "container routes updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:routes/route": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "operationId": "data_cocsn_routes_route_get", + "parameters": [ + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:routes/route={route-destination}": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "operationId": "data_cocsn_routes_route_route_destination_get", + "parameters": [ + { + "$ref": "#/parameters/route-destination" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route_route-destination" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:routes/route={route-destination}/destination": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Route destination. IP network", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Route destination. IP network", + "operationId": "data_cocsn_routes_route_route_destination_destination_get", + "parameters": [ + { + "$ref": "#/parameters/route-destination" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Route destination. IP network", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route_route-destination_destination" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:routes/route={route-destination}/expire": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Expiration timer of the route", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Expiration timer of the route", + "operationId": "data_cocsn_routes_route_route_destination_expire_get", + "parameters": [ + { + "$ref": "#/parameters/route-destination" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Expiration timer of the route", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route_route-destination_expire" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:routes/route={route-destination}/flags": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Flags of the route", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Flags of the route", + "operationId": "data_cocsn_routes_route_route_destination_flags_get", + "parameters": [ + { + "$ref": "#/parameters/route-destination" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Flags of the route", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route_route-destination_flags" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:routes/route={route-destination}/gateway": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Route gateway. IP address or host name", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Route gateway. IP address or host name", + "operationId": "data_cocsn_routes_route_route_destination_gateway_get", + "parameters": [ + { + "$ref": "#/parameters/route-destination" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Route gateway. IP address or host name", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route_route-destination_gateway" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/data/cocsn:routes/route={route-destination}/interface": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Interface used for the route", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Interface used for the route", + "operationId": "data_cocsn_routes_route_route_destination_interface_get", + "parameters": [ + { + "$ref": "#/parameters/route-destination" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Interface used for the route", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route_route-destination_interface" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/operations": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "This YANG module represents the CoCSN API", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "operations", + "get" + ], + "summary": "This YANG module represents the CoCSN API", + "operationId": "operations_get", + "responses": { + "200": { + "description": "This YANG module represents the CoCSN API", + "schema": { + "$ref": "#/definitions/operations" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + }, + "/yang-library-version": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "This YANG module represents the CoCSN API", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "yang-library-version", + "get" + ], + "summary": "This YANG module represents the CoCSN API", + "operationId": "yang_library_version_get", + "responses": { + "200": { + "description": "This YANG module represents the CoCSN API", + "schema": { + "$ref": "#/definitions/yang-library-version" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + } + } + } + }, + "definitions": { + "data": { + "type": "object", + "properties": { + "ietf-restconf:data": { + "description": "This resource represents the combined configuration and state data resources that can be accessed by a client and cannot be created or deleted by the client. See RESTCONF RFC 8040 for further information.", + "type": "object", + "x-yang": { + "type": "datastore" + } + } + } + }, + "data-post": { + "type": "object", + "properties": { + "cocsn:arp-table": { + "description": "(non-presence)", + "type": "object", + "properties": { + "arp-entry": { + "description": "(list)", + "type": "array", + "items": { + "type": "object", + "properties": { + "address": { + "description": "IP address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "phs-address": { + "description": "MAC address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "cocsn:interfaces": { + "description": "(non-presence)", + "type": "object", + "properties": { + "interface": { + "description": "(list)", + "type": "array", + "items": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + }, + "x-yang": { + "type": "leaf-list" + } + }, + "enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "type": "string", + "format": "boolean", + "x-yang": { + "type": "leaf" + } + }, + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ], + "x-yang": { + "type": "leaf" + } + }, + "phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "cocsn:routes": { + "description": "(non-presence)", + "type": "object", + "properties": { + "route": { + "description": "(list)", + "type": "array", + "items": { + "type": "object", + "properties": { + "destination": { + "description": "Route destination. IP network (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "expire": { + "description": "Expiration timer of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "flags": { + "description": "Flags of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface used for the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + } + } + }, + "data-put-patch": { + "type": "object", + "properties": { + "ietf-restconf:data": { + "description": "This YANG module represents the CoCSN API", + "type": "object", + "properties": { + "cocsn:arp-table": { + "description": "(non-presence)", + "type": "object", + "properties": { + "arp-entry": { + "description": "(list)", + "type": "array", + "items": { + "type": "object", + "properties": { + "address": { + "description": "IP address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "phs-address": { + "description": "MAC address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "cocsn:interfaces": { + "description": "(non-presence)", + "type": "object", + "properties": { + "interface": { + "description": "(list)", + "type": "array", + "items": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + }, + "x-yang": { + "type": "leaf-list" + } + }, + "enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "type": "string", + "format": "boolean", + "x-yang": { + "type": "leaf" + } + }, + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ], + "x-yang": { + "type": "leaf" + } + }, + "phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "cocsn:routes": { + "description": "(non-presence)", + "type": "object", + "properties": { + "route": { + "description": "(list)", + "type": "array", + "items": { + "type": "object", + "properties": { + "destination": { + "description": "Route destination. IP network (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "expire": { + "description": "Expiration timer of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "flags": { + "description": "Flags of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface used for the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + } + }, + "x-yang": { + "type": "datastore" + } + } + } + }, + "data_cocsn_arp-table": { + "type": "object", + "properties": { + "cocsn:arp-table": { + "description": "(non-presence)", + "type": "object", + "properties": { + "arp-entry": { + "description": "(list)", + "type": "array", + "items": { + "type": "object", + "properties": { + "address": { + "description": "IP address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "phs-address": { + "description": "MAC address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + } + } + }, + "data_cocsn_arp-table-post": { + "type": "object", + "properties": { + "cocsn:arp-entry": { + "description": "(list)", + "type": "array", + "items": { + "type": "object", + "properties": { + "address": { + "description": "IP address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "phs-address": { + "description": "MAC address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "x-yang": { + "type": "list" + } + } + } + }, + "data_cocsn_arp-table_arp-entry": { + "type": "object", + "properties": { + "cocsn:arp-entry": { + "description": "(list)", + "type": "array", + "items": { + "type": "object", + "properties": { + "address": { + "description": "IP address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "phs-address": { + "description": "MAC address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "x-yang": { + "type": "list" + } + } + } + }, + "data_cocsn_arp-table_arp-entry_arp-entry-address": { + "type": "object", + "properties": { + "cocsn:arp-entry": { + "description": "(list)", + "type": "array", + "items": { + "type": "object", + "properties": { + "address": { + "description": "IP address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "phs-address": { + "description": "MAC address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "x-yang": { + "type": "list" + } + } + } + }, + "data_cocsn_arp-table_arp-entry_arp-entry-address_address": { + "type": "object", + "properties": { + "cocsn:address": { + "description": "IP address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_arp-table_arp-entry_arp-entry-address_interface": { + "type": "object", + "properties": { + "cocsn:interface": { + "description": "Interface of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_arp-table_arp-entry_arp-entry-address_phs-address": { + "type": "object", + "properties": { + "cocsn:phs-address": { + "description": "MAC address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_interfaces": { + "type": "object", + "properties": { + "cocsn:interfaces": { + "description": "(non-presence)", + "type": "object", + "properties": { + "interface": { + "description": "(list)", + "type": "array", + "items": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + }, + "x-yang": { + "type": "leaf-list" + } + }, + "enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "type": "string", + "format": "boolean", + "x-yang": { + "type": "leaf" + } + }, + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ], + "x-yang": { + "type": "leaf" + } + }, + "phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + } + } + }, + "data_cocsn_interfaces-post": { + "type": "object", + "properties": { + "cocsn:interface": { + "description": "(list)", + "type": "array", + "items": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + }, + "x-yang": { + "type": "leaf-list" + } + }, + "enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "type": "string", + "format": "boolean", + "x-yang": { + "type": "leaf" + } + }, + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ], + "x-yang": { + "type": "leaf" + } + }, + "phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "x-yang": { + "type": "list" + } + } + } + }, + "data_cocsn_interfaces_interface": { + "type": "object", + "properties": { + "cocsn:interface": { + "description": "(list)", + "type": "array", + "items": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + }, + "x-yang": { + "type": "leaf-list" + } + }, + "enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "type": "string", + "format": "boolean", + "x-yang": { + "type": "leaf" + } + }, + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ], + "x-yang": { + "type": "leaf" + } + }, + "phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "x-yang": { + "type": "list" + } + } + } + }, + "data_cocsn_interfaces_interface_interface-name": { + "type": "object", + "properties": { + "cocsn:interface": { + "description": "(list)", + "type": "array", + "items": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + }, + "x-yang": { + "type": "leaf-list" + } + }, + "enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "type": "string", + "format": "boolean", + "x-yang": { + "type": "leaf" + } + }, + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ], + "x-yang": { + "type": "leaf" + } + }, + "phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "x-yang": { + "type": "list" + } + } + } + }, + "data_cocsn_interfaces_interface_interface-name_addresses": { + "type": "object", + "properties": { + "cocsn:addresses": { + "type": "array", + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + }, + "x-yang": { + "type": "leaf-list" + } + } + } + }, + "data_cocsn_interfaces_interface_interface-name_addresses_addresses-id": { + "type": "object", + "properties": { + "cocsn:addresses": { + "type": "array", + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + }, + "x-yang": { + "type": "leaf-list" + } + } + } + }, + "data_cocsn_interfaces_interface_interface-name_enabled": { + "type": "object", + "properties": { + "cocsn:enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "type": "string", + "format": "boolean", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_interfaces_interface_interface-name_name": { + "type": "object", + "properties": { + "cocsn:name": { + "description": "Interface name. Example value: en0 (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_interfaces_interface_interface-name_oper-status": { + "type": "object", + "properties": { + "cocsn:oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ], + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_interfaces_interface_interface-name_phys-address": { + "type": "object", + "properties": { + "cocsn:phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_routes": { + "type": "object", + "properties": { + "cocsn:routes": { + "description": "(non-presence)", + "type": "object", + "properties": { + "route": { + "description": "(list)", + "type": "array", + "items": { + "type": "object", + "properties": { + "destination": { + "description": "Route destination. IP network (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "expire": { + "description": "Expiration timer of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "flags": { + "description": "Flags of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface used for the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + } + } + }, + "data_cocsn_routes-post": { + "type": "object", + "properties": { + "cocsn:route": { + "description": "(list)", + "type": "array", + "items": { + "type": "object", + "properties": { + "destination": { + "description": "Route destination. IP network (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "expire": { + "description": "Expiration timer of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "flags": { + "description": "Flags of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface used for the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "x-yang": { + "type": "list" + } + } + } + }, + "data_cocsn_routes_route": { + "type": "object", + "properties": { + "cocsn:route": { + "description": "(list)", + "type": "array", + "items": { + "type": "object", + "properties": { + "destination": { + "description": "Route destination. IP network (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "expire": { + "description": "Expiration timer of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "flags": { + "description": "Flags of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface used for the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "x-yang": { + "type": "list" + } + } + } + }, + "data_cocsn_routes_route_route-destination": { + "type": "object", + "properties": { + "cocsn:route": { + "description": "(list)", + "type": "array", + "items": { + "type": "object", + "properties": { + "destination": { + "description": "Route destination. IP network (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "expire": { + "description": "Expiration timer of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "flags": { + "description": "Flags of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface used for the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "x-yang": { + "type": "list" + } + } + } + }, + "data_cocsn_routes_route_route-destination_destination": { + "type": "object", + "properties": { + "cocsn:destination": { + "description": "Route destination. IP network (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_routes_route_route-destination_expire": { + "type": "object", + "properties": { + "cocsn:expire": { + "description": "Expiration timer of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_routes_route_route-destination_flags": { + "type": "object", + "properties": { + "cocsn:flags": { + "description": "Flags of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_routes_route_route-destination_gateway": { + "type": "object", + "properties": { + "cocsn:gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_routes_route_route-destination_interface": { + "type": "object", + "properties": { + "cocsn:interface": { + "description": "Interface used for the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "operations": { + "type": "object", + "properties": { + "ietf-restconf:operations": { + "description": "This resource is a container that provides access to the data-model-specific RPC operations supported by the server. See RESTCONF RFC 8040 for further information.", + "type": "object", + "x-yang": { + "type": "operations" + } + } + } + }, + "root": { + "type": "object", + "properties": { + "ietf-restconf:restconf": { + "description": "This is the RESTCONF root resource for the RESTCONF datastore and operation resources. See RESTCONF RFC 8040 for further information.", + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "operations": { + "type": "object" + }, + "yang-library-version": { + "type": "string" + } + }, + "x-yang": { + "type": "root" + } + } + } + }, + "yang-library-version": { + "type": "object", + "properties": { + "ietf-restconf:yang-library-version": { + "description": "This leaf identifies the revision date of the 'ietf-yang-library' YANG module that is implemented by this server. See RESTCONF RFC 8040 for further information.", + "type": "object", + "x-yang": { + "type": "leaf" + } + } + } + } + }, + "parameters": { + "addresses-id": { + "type": "string", + "format": "string", + "description": "Interface IP address. Example value: 10.10.10.1", + "name": "addresses-id", + "in": "path", + "required": true + }, + "arp-entry-address": { + "type": "string", + "format": "string", + "description": "IP address of the arp entry", + "name": "arp-entry-address", + "in": "path", + "required": true + }, + "content": { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + "data-post": { + "description": "This YANG module represents the CoCSN API", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data-post" + } + }, + "data-put-patch": { + "description": "This YANG module represents the CoCSN API", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data-put-patch" + } + }, + "data_cocsn_arp-table": { + "name": "arp-table", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table" + } + }, + "data_cocsn_arp-table-post": { + "name": "arp-table", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table-post" + } + }, + "data_cocsn_interfaces": { + "name": "interfaces", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces" + } + }, + "data_cocsn_interfaces-post": { + "name": "interfaces", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces-post" + } + }, + "data_cocsn_routes": { + "name": "routes", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_routes" + } + }, + "data_cocsn_routes-post": { + "name": "routes", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_routes-post" + } + }, + "depth": { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + "fields": { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + "filter": { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + "insert": { + "enum": [ + "first", + "last", + "before", + "after" + ], + "type": "string", + "format": "enumeration", + "default": "first", + "description": "controlling the order when adding new list elements", + "name": "insert", + "in": "query" + }, + "interface-name": { + "type": "string", + "format": "string", + "description": "Interface name. Example value: en0", + "name": "interface-name", + "in": "path", + "required": true + }, + "point": { + "type": "string", + "format": "string", + "description": "used to specify the insertion point", + "name": "point", + "in": "query" + }, + "route-destination": { + "type": "string", + "format": "string", + "description": "Route destination. IP network", + "name": "route-destination", + "in": "path", + "required": true + }, + "with-defaults": { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + }, + "responses": { + "200": { + "description": "OK" + }, + "201": { + "description": "Created" + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + }, + "securityDefinitions": { + "basicAuth": { + "type": "basic" + } + }, + "tags": [ + { + "description": "root resources", + "name": "root" + }, + { + "description": "operations resources", + "name": "operations" + }, + { + "description": "data resources", + "name": "data" + }, + { + "description": "get resources", + "name": "get" + }, + { + "description": "post resources", + "name": "post" + }, + { + "description": "patch resources", + "name": "patch" + }, + { + "description": "put resources", + "name": "put" + }, + { + "description": "delete resources", + "name": "delete" + } + ] +}`)) + FlatSwaggerJSON = json.RawMessage([]byte(`{ + "consumes": [ + "application/yang-data+json" + ], + "produces": [ + "application/yang-data+json" + ], + "schemes": [ + "http", + "https" + ], + "swagger": "2.0", + "info": { + "description": "This YANG module represents the CoCSN API", + "title": "cocsn", + "version": "2020-08-17" + }, + "basePath": "/restconf", + "paths": { + "/": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "This YANG module represents the CoCSN API", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "root", + "get" + ], + "summary": "This YANG module represents the CoCSN API", + "operationId": "root_get", + "responses": { + "200": { + "description": "This YANG module represents the CoCSN API", + "schema": { + "$ref": "#/definitions/root" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "This YANG module represents the CoCSN API", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "This YANG module represents the CoCSN API", + "operationId": "data_get", + "responses": { + "200": { + "description": "This YANG module represents the CoCSN API", + "schema": { + "$ref": "#/definitions/data" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + }, + "put": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "This YANG module represents the CoCSN API", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "put" + ], + "summary": "This YANG module represents the CoCSN API", + "operationId": "data_put", + "parameters": [ + { + "description": "This YANG module represents the CoCSN API", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data-put-patch" + } + } + ], + "responses": { + "201": { + "description": "This YANG module represents the CoCSN API" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + }, + "post": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "This YANG module represents the CoCSN API", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "post" + ], + "summary": "This YANG module represents the CoCSN API", + "operationId": "data_post", + "parameters": [ + { + "description": "This YANG module represents the CoCSN API", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data-post" + } + } + ], + "responses": { + "201": { + "description": "This YANG module represents the CoCSN API" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + }, + "patch": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "This YANG module represents the CoCSN API", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "patch" + ], + "summary": "This YANG module represents the CoCSN API", + "operationId": "data_patch", + "parameters": [ + { + "description": "This YANG module represents the CoCSN API", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data-put-patch" + } + } + ], + "responses": { + "204": { + "description": "This YANG module represents the CoCSN API" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:arp-table": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "operationId": "data_cocsn_arp_table_get", + "parameters": [ + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + }, + "put": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "put" + ], + "operationId": "data_cocsn_arp_table_put", + "parameters": [ + { + "name": "arp-table", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table" + } + } + ], + "responses": { + "201": { + "description": "container arp-table created or replaced" + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + }, + "post": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "post" + ], + "operationId": "data_cocsn_arp_table_post", + "parameters": [ + { + "name": "arp-table", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table-post" + } + } + ], + "responses": { + "201": { + "description": "container arp-table created" + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + }, + "delete": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "delete" + ], + "operationId": "data_cocsn_arp_table_delete", + "responses": { + "204": { + "description": "No Content" + } + } + }, + "patch": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "patch" + ], + "operationId": "data_cocsn_arp_table_patch", + "parameters": [ + { + "name": "arp-table", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table" + } + } + ], + "responses": { + "204": { + "description": "container arp-table updated" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:arp-table/arp-entry": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "operationId": "data_cocsn_arp_table_arp_entry_get", + "parameters": [ + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table_arp-entry" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:arp-table/arp-entry={arp-entry-address}": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "operationId": "data_cocsn_arp_table_arp_entry_arp_entry_address_get", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "IP address of the arp entry", + "name": "arp-entry-address", + "in": "path", + "required": true + }, + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table_arp-entry_arp-entry-address" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:arp-table/arp-entry={arp-entry-address}/address": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "IP address of the arp entry", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "IP address of the arp entry", + "operationId": "data_cocsn_arp_table_arp_entry_arp_entry_address_address_get", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "IP address of the arp entry", + "name": "arp-entry-address", + "in": "path", + "required": true + }, + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "IP address of the arp entry", + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table_arp-entry_arp-entry-address_address" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:arp-table/arp-entry={arp-entry-address}/interface": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Interface of the arp entry", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Interface of the arp entry", + "operationId": "data_cocsn_arp_table_arp_entry_arp_entry_address_interface_get", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "IP address of the arp entry", + "name": "arp-entry-address", + "in": "path", + "required": true + }, + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Interface of the arp entry", + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table_arp-entry_arp-entry-address_interface" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:arp-table/arp-entry={arp-entry-address}/phs-address": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "MAC address of the arp entry", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "MAC address of the arp entry", + "operationId": "data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address_get", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "IP address of the arp entry", + "name": "arp-entry-address", + "in": "path", + "required": true + }, + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "MAC address of the arp entry", + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table_arp-entry_arp-entry-address_phs-address" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:interfaces": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "operationId": "data_cocsn_interfaces_get", + "parameters": [ + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + }, + "put": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "put" + ], + "operationId": "data_cocsn_interfaces_put", + "parameters": [ + { + "name": "interfaces", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces" + } + } + ], + "responses": { + "201": { + "description": "container interfaces created or replaced" + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + }, + "post": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "post" + ], + "operationId": "data_cocsn_interfaces_post", + "parameters": [ + { + "name": "interfaces", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces-post" + } + } + ], + "responses": { + "201": { + "description": "container interfaces created" + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + }, + "delete": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "delete" + ], + "operationId": "data_cocsn_interfaces_delete", + "responses": { + "204": { + "description": "No Content" + } + } + }, + "patch": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "patch" + ], + "operationId": "data_cocsn_interfaces_patch", + "parameters": [ + { + "name": "interfaces", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces" + } + } + ], + "responses": { + "204": { + "description": "container interfaces updated" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:interfaces/interface": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "operationId": "data_cocsn_interfaces_interface_get", + "parameters": [ + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:interfaces/interface={interface-name}": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "operationId": "data_cocsn_interfaces_interface_interface_name_get", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "Interface name. Example value: en0", + "name": "interface-name", + "in": "path", + "required": true + }, + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:interfaces/interface={interface-name}/addresses": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Interface IP address. Example value: 10.10.10.1", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Interface IP address. Example value: 10.10.10.1", + "operationId": "data_cocsn_interfaces_interface_interface_name_addresses_get", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "Interface name. Example value: en0", + "name": "interface-name", + "in": "path", + "required": true + }, + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Interface IP address. Example value: 10.10.10.1", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name_addresses" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:interfaces/interface={interface-name}/addresses={addresses-id}": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Interface IP address. Example value: 10.10.10.1", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Interface IP address. Example value: 10.10.10.1", + "operationId": "data_cocsn_interfaces_interface_interface_name_addresses_addresses_id_get", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "Interface name. Example value: en0", + "name": "interface-name", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "string", + "description": "Interface IP address. Example value: 10.10.10.1", + "name": "addresses-id", + "in": "path", + "required": true + }, + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Interface IP address. Example value: 10.10.10.1", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name_addresses_addresses-id" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:interfaces/interface={interface-name}/enabled": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Enable or disable the interface. Example value: true", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Enable or disable the interface. Example value: true", + "operationId": "data_cocsn_interfaces_interface_interface_name_enabled_get", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "Interface name. Example value: en0", + "name": "interface-name", + "in": "path", + "required": true + }, + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Enable or disable the interface. Example value: true", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name_enabled" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:interfaces/interface={interface-name}/name": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Interface name. Example value: en0", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Interface name. Example value: en0", + "operationId": "data_cocsn_interfaces_interface_interface_name_name_get", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "Interface name. Example value: en0", + "name": "interface-name", + "in": "path", + "required": true + }, + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Interface name. Example value: en0", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name_name" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:interfaces/interface={interface-name}/oper-status": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Describes whether the interface is physically up or down", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Describes whether the interface is physically up or down", + "operationId": "data_cocsn_interfaces_interface_interface_name_oper_status_get", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "Interface name. Example value: en0", + "name": "interface-name", + "in": "path", + "required": true + }, + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Describes whether the interface is physically up or down", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name_oper-status" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:interfaces/interface={interface-name}/phys-address": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present.", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present.", + "operationId": "data_cocsn_interfaces_interface_interface_name_phys_address_get", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "Interface name. Example value: en0", + "name": "interface-name", + "in": "path", + "required": true + }, + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present.", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name_phys-address" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:routes": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "operationId": "data_cocsn_routes_get", + "parameters": [ + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_routes" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + }, + "put": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "put" + ], + "operationId": "data_cocsn_routes_put", + "parameters": [ + { + "name": "routes", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_routes" + } + } + ], + "responses": { + "201": { + "description": "container routes created or replaced" + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + }, + "post": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "post" + ], + "operationId": "data_cocsn_routes_post", + "parameters": [ + { + "name": "routes", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_routes-post" + } + } + ], + "responses": { + "201": { + "description": "container routes created" + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + }, + "delete": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "delete" + ], + "operationId": "data_cocsn_routes_delete", + "responses": { + "204": { + "description": "No Content" + } + } + }, + "patch": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "patch" + ], + "operationId": "data_cocsn_routes_patch", + "parameters": [ + { + "name": "routes", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_routes" + } + } + ], + "responses": { + "204": { + "description": "container routes updated" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:routes/route": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "operationId": "data_cocsn_routes_route_get", + "parameters": [ + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:routes/route={route-destination}": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "operationId": "data_cocsn_routes_route_route_destination_get", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "Route destination. IP network", + "name": "route-destination", + "in": "path", + "required": true + }, + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route_route-destination" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:routes/route={route-destination}/destination": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Route destination. IP network", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Route destination. IP network", + "operationId": "data_cocsn_routes_route_route_destination_destination_get", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "Route destination. IP network", + "name": "route-destination", + "in": "path", + "required": true + }, + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Route destination. IP network", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route_route-destination_destination" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:routes/route={route-destination}/expire": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Expiration timer of the route", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Expiration timer of the route", + "operationId": "data_cocsn_routes_route_route_destination_expire_get", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "Route destination. IP network", + "name": "route-destination", + "in": "path", + "required": true + }, + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Expiration timer of the route", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route_route-destination_expire" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:routes/route={route-destination}/flags": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Flags of the route", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Flags of the route", + "operationId": "data_cocsn_routes_route_route_destination_flags_get", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "Route destination. IP network", + "name": "route-destination", + "in": "path", + "required": true + }, + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Flags of the route", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route_route-destination_flags" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:routes/route={route-destination}/gateway": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Route gateway. IP address or host name", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Route gateway. IP address or host name", + "operationId": "data_cocsn_routes_route_route_destination_gateway_get", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "Route destination. IP network", + "name": "route-destination", + "in": "path", + "required": true + }, + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Route gateway. IP address or host name", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route_route-destination_gateway" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/data/cocsn:routes/route={route-destination}/interface": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "Interface used for the route", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "data", + "get" + ], + "summary": "Interface used for the route", + "operationId": "data_cocsn_routes_route_route_destination_interface_get", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "Route destination. IP network", + "name": "route-destination", + "in": "path", + "required": true + }, + { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Interface used for the route", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route_route-destination_interface" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/operations": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "This YANG module represents the CoCSN API", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "operations", + "get" + ], + "summary": "This YANG module represents the CoCSN API", + "operationId": "operations_get", + "responses": { + "200": { + "description": "This YANG module represents the CoCSN API", + "schema": { + "$ref": "#/definitions/operations" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + }, + "/yang-library-version": { + "get": { + "security": [ + { + "basicAuth": [] + } + ], + "description": "This YANG module represents the CoCSN API", + "produces": [ + "application/yang-data+json" + ], + "tags": [ + "yang-library-version", + "get" + ], + "summary": "This YANG module represents the CoCSN API", + "operationId": "yang_library_version_get", + "responses": { + "200": { + "description": "This YANG module represents the CoCSN API", + "schema": { + "$ref": "#/definitions/yang-library-version" + } + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + } + } + } + }, + "definitions": { + "DataCocsnArpTableArpEntryArpEntryAddressCocsnArpEntryItems0": { + "type": "object", + "properties": { + "address": { + "description": "IP address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "phs-address": { + "description": "MAC address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "DataCocsnArpTableArpEntryCocsnArpEntryItems0": { + "type": "object", + "properties": { + "address": { + "description": "IP address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "phs-address": { + "description": "MAC address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "DataCocsnArpTableCocsnArpTable": { + "description": "(non-presence)", + "type": "object", + "properties": { + "arp-entry": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataCocsnArpTableCocsnArpTableArpEntryItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "DataCocsnArpTableCocsnArpTableArpEntryItems0": { + "type": "object", + "properties": { + "address": { + "description": "IP address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "phs-address": { + "description": "MAC address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "DataCocsnArpTablePostCocsnArpEntryItems0": { + "type": "object", + "properties": { + "address": { + "description": "IP address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "phs-address": { + "description": "MAC address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "DataCocsnInterfacesCocsnInterfaces": { + "description": "(non-presence)", + "type": "object", + "properties": { + "interface": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataCocsnInterfacesCocsnInterfacesInterfaceItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "DataCocsnInterfacesCocsnInterfacesInterfaceItems0": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + }, + "x-yang": { + "type": "leaf-list" + } + }, + "enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "type": "string", + "format": "boolean", + "x-yang": { + "type": "leaf" + } + }, + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ], + "x-yang": { + "type": "leaf" + } + }, + "phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "DataCocsnInterfacesInterfaceCocsnInterfaceItems0": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + }, + "x-yang": { + "type": "leaf-list" + } + }, + "enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "type": "string", + "format": "boolean", + "x-yang": { + "type": "leaf" + } + }, + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ], + "x-yang": { + "type": "leaf" + } + }, + "phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + }, + "x-yang": { + "type": "leaf-list" + } + }, + "enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "type": "string", + "format": "boolean", + "x-yang": { + "type": "leaf" + } + }, + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ], + "x-yang": { + "type": "leaf" + } + }, + "phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "DataCocsnInterfacesPostCocsnInterfaceItems0": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + }, + "x-yang": { + "type": "leaf-list" + } + }, + "enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "type": "string", + "format": "boolean", + "x-yang": { + "type": "leaf" + } + }, + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ], + "x-yang": { + "type": "leaf" + } + }, + "phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "DataCocsnRoutesCocsnRoutes": { + "description": "(non-presence)", + "type": "object", + "properties": { + "route": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataCocsnRoutesCocsnRoutesRouteItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "DataCocsnRoutesCocsnRoutesRouteItems0": { + "type": "object", + "properties": { + "destination": { + "description": "Route destination. IP network (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "expire": { + "description": "Expiration timer of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "flags": { + "description": "Flags of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface used for the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "DataCocsnRoutesPostCocsnRouteItems0": { + "type": "object", + "properties": { + "destination": { + "description": "Route destination. IP network (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "expire": { + "description": "Expiration timer of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "flags": { + "description": "Flags of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface used for the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "DataCocsnRoutesRouteCocsnRouteItems0": { + "type": "object", + "properties": { + "destination": { + "description": "Route destination. IP network (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "expire": { + "description": "Expiration timer of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "flags": { + "description": "Flags of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface used for the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "DataCocsnRoutesRouteRouteDestinationCocsnRouteItems0": { + "type": "object", + "properties": { + "destination": { + "description": "Route destination. IP network (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "expire": { + "description": "Expiration timer of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "flags": { + "description": "Flags of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface used for the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "DataPostCocsnArpTable": { + "description": "(non-presence)", + "type": "object", + "properties": { + "arp-entry": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataPostCocsnArpTableArpEntryItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "DataPostCocsnArpTableArpEntryItems0": { + "type": "object", + "properties": { + "address": { + "description": "IP address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "phs-address": { + "description": "MAC address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "DataPostCocsnInterfaces": { + "description": "(non-presence)", + "type": "object", + "properties": { + "interface": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataPostCocsnInterfacesInterfaceItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "DataPostCocsnInterfacesInterfaceItems0": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + }, + "x-yang": { + "type": "leaf-list" + } + }, + "enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "type": "string", + "format": "boolean", + "x-yang": { + "type": "leaf" + } + }, + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ], + "x-yang": { + "type": "leaf" + } + }, + "phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "DataPostCocsnRoutes": { + "description": "(non-presence)", + "type": "object", + "properties": { + "route": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataPostCocsnRoutesRouteItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "DataPostCocsnRoutesRouteItems0": { + "type": "object", + "properties": { + "destination": { + "description": "Route destination. IP network (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "expire": { + "description": "Expiration timer of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "flags": { + "description": "Flags of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface used for the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "DataPutPatchIetfRestconfData": { + "description": "This YANG module represents the CoCSN API", + "type": "object", + "properties": { + "cocsn:arp-table": { + "description": "(non-presence)", + "type": "object", + "properties": { + "arp-entry": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataPutPatchIetfRestconfDataCocsnArpTableArpEntryItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "cocsn:interfaces": { + "description": "(non-presence)", + "type": "object", + "properties": { + "interface": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "cocsn:routes": { + "description": "(non-presence)", + "type": "object", + "properties": { + "route": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataPutPatchIetfRestconfDataCocsnRoutesRouteItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + } + }, + "x-yang": { + "type": "datastore" + } + }, + "DataPutPatchIetfRestconfDataCocsnArpTable": { + "description": "(non-presence)", + "type": "object", + "properties": { + "arp-entry": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataPutPatchIetfRestconfDataCocsnArpTableArpEntryItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "DataPutPatchIetfRestconfDataCocsnArpTableArpEntryItems0": { + "type": "object", + "properties": { + "address": { + "description": "IP address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "phs-address": { + "description": "MAC address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "DataPutPatchIetfRestconfDataCocsnInterfaces": { + "description": "(non-presence)", + "type": "object", + "properties": { + "interface": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "DataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + }, + "x-yang": { + "type": "leaf-list" + } + }, + "enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "type": "string", + "format": "boolean", + "x-yang": { + "type": "leaf" + } + }, + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ], + "x-yang": { + "type": "leaf" + } + }, + "phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "DataPutPatchIetfRestconfDataCocsnRoutes": { + "description": "(non-presence)", + "type": "object", + "properties": { + "route": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataPutPatchIetfRestconfDataCocsnRoutesRouteItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "DataPutPatchIetfRestconfDataCocsnRoutesRouteItems0": { + "type": "object", + "properties": { + "destination": { + "description": "Route destination. IP network (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "expire": { + "description": "Expiration timer of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "flags": { + "description": "Flags of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + }, + "interface": { + "description": "Interface used for the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "RootIetfRestconfRestconf": { + "description": "This is the RESTCONF root resource for the RESTCONF datastore and operation resources. See RESTCONF RFC 8040 for further information.", + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "operations": { + "type": "object" + }, + "yang-library-version": { + "type": "string" + } + }, + "x-yang": { + "type": "root" + } + }, + "data": { + "type": "object", + "properties": { + "ietf-restconf:data": { + "description": "This resource represents the combined configuration and state data resources that can be accessed by a client and cannot be created or deleted by the client. See RESTCONF RFC 8040 for further information.", + "type": "object", + "x-yang": { + "type": "datastore" + } + } + } + }, + "data-post": { + "type": "object", + "properties": { + "cocsn:arp-table": { + "description": "(non-presence)", + "type": "object", + "properties": { + "arp-entry": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataPostCocsnArpTableArpEntryItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "cocsn:interfaces": { + "description": "(non-presence)", + "type": "object", + "properties": { + "interface": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataPostCocsnInterfacesInterfaceItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "cocsn:routes": { + "description": "(non-presence)", + "type": "object", + "properties": { + "route": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataPostCocsnRoutesRouteItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + } + } + }, + "data-put-patch": { + "type": "object", + "properties": { + "ietf-restconf:data": { + "description": "This YANG module represents the CoCSN API", + "type": "object", + "properties": { + "cocsn:arp-table": { + "description": "(non-presence)", + "type": "object", + "properties": { + "arp-entry": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataPutPatchIetfRestconfDataCocsnArpTableArpEntryItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "cocsn:interfaces": { + "description": "(non-presence)", + "type": "object", + "properties": { + "interface": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataPutPatchIetfRestconfDataCocsnInterfacesInterfaceItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + }, + "cocsn:routes": { + "description": "(non-presence)", + "type": "object", + "properties": { + "route": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataPutPatchIetfRestconfDataCocsnRoutesRouteItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + } + }, + "x-yang": { + "type": "datastore" + } + } + } + }, + "data_cocsn_arp-table": { + "type": "object", + "properties": { + "cocsn:arp-table": { + "description": "(non-presence)", + "type": "object", + "properties": { + "arp-entry": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataCocsnArpTableCocsnArpTableArpEntryItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + } + } + }, + "data_cocsn_arp-table-post": { + "type": "object", + "properties": { + "cocsn:arp-entry": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataCocsnArpTablePostCocsnArpEntryItems0" + }, + "x-yang": { + "type": "list" + } + } + } + }, + "data_cocsn_arp-table_arp-entry": { + "type": "object", + "properties": { + "cocsn:arp-entry": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataCocsnArpTableArpEntryCocsnArpEntryItems0" + }, + "x-yang": { + "type": "list" + } + } + } + }, + "data_cocsn_arp-table_arp-entry_arp-entry-address": { + "type": "object", + "properties": { + "cocsn:arp-entry": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataCocsnArpTableArpEntryArpEntryAddressCocsnArpEntryItems0" + }, + "x-yang": { + "type": "list" + } + } + } + }, + "data_cocsn_arp-table_arp-entry_arp-entry-address_address": { + "type": "object", + "properties": { + "cocsn:address": { + "description": "IP address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_arp-table_arp-entry_arp-entry-address_interface": { + "type": "object", + "properties": { + "cocsn:interface": { + "description": "Interface of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_arp-table_arp-entry_arp-entry-address_phs-address": { + "type": "object", + "properties": { + "cocsn:phs-address": { + "description": "MAC address of the arp entry (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_interfaces": { + "type": "object", + "properties": { + "cocsn:interfaces": { + "description": "(non-presence)", + "type": "object", + "properties": { + "interface": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataCocsnInterfacesCocsnInterfacesInterfaceItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + } + } + }, + "data_cocsn_interfaces-post": { + "type": "object", + "properties": { + "cocsn:interface": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataCocsnInterfacesPostCocsnInterfaceItems0" + }, + "x-yang": { + "type": "list" + } + } + } + }, + "data_cocsn_interfaces_interface": { + "type": "object", + "properties": { + "cocsn:interface": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataCocsnInterfacesInterfaceCocsnInterfaceItems0" + }, + "x-yang": { + "type": "list" + } + } + } + }, + "data_cocsn_interfaces_interface_interface-name": { + "type": "object", + "properties": { + "cocsn:interface": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataCocsnInterfacesInterfaceInterfaceNameCocsnInterfaceItems0" + }, + "x-yang": { + "type": "list" + } + } + } + }, + "data_cocsn_interfaces_interface_interface-name_addresses": { + "type": "object", + "properties": { + "cocsn:addresses": { + "type": "array", + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + }, + "x-yang": { + "type": "leaf-list" + } + } + } + }, + "data_cocsn_interfaces_interface_interface-name_addresses_addresses-id": { + "type": "object", + "properties": { + "cocsn:addresses": { + "type": "array", + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + }, + "x-yang": { + "type": "leaf-list" + } + } + } + }, + "data_cocsn_interfaces_interface_interface-name_enabled": { + "type": "object", + "properties": { + "cocsn:enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "type": "string", + "format": "boolean", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_interfaces_interface_interface-name_name": { + "type": "object", + "properties": { + "cocsn:name": { + "description": "Interface name. Example value: en0 (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_interfaces_interface_interface-name_oper-status": { + "type": "object", + "properties": { + "cocsn:oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ], + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_interfaces_interface_interface-name_phys-address": { + "type": "object", + "properties": { + "cocsn:phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_routes": { + "type": "object", + "properties": { + "cocsn:routes": { + "description": "(non-presence)", + "type": "object", + "properties": { + "route": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataCocsnRoutesCocsnRoutesRouteItems0" + }, + "x-yang": { + "type": "list" + } + } + }, + "x-yang": { + "is_presence": "false", + "type": "container" + } + } + } + }, + "data_cocsn_routes-post": { + "type": "object", + "properties": { + "cocsn:route": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataCocsnRoutesPostCocsnRouteItems0" + }, + "x-yang": { + "type": "list" + } + } + } + }, + "data_cocsn_routes_route": { + "type": "object", + "properties": { + "cocsn:route": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataCocsnRoutesRouteCocsnRouteItems0" + }, + "x-yang": { + "type": "list" + } + } + } + }, + "data_cocsn_routes_route_route-destination": { + "type": "object", + "properties": { + "cocsn:route": { + "description": "(list)", + "type": "array", + "items": { + "$ref": "#/definitions/DataCocsnRoutesRouteRouteDestinationCocsnRouteItems0" + }, + "x-yang": { + "type": "list" + } + } + } + }, + "data_cocsn_routes_route_route-destination_destination": { + "type": "object", + "properties": { + "cocsn:destination": { + "description": "Route destination. IP network (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_routes_route_route-destination_expire": { + "type": "object", + "properties": { + "cocsn:expire": { + "description": "Expiration timer of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_routes_route_route-destination_flags": { + "type": "object", + "properties": { + "cocsn:flags": { + "description": "Flags of the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_routes_route_route-destination_gateway": { + "type": "object", + "properties": { + "cocsn:gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "data_cocsn_routes_route_route-destination_interface": { + "type": "object", + "properties": { + "cocsn:interface": { + "description": "Interface used for the route (leaf)", + "type": "string", + "format": "string", + "x-yang": { + "type": "leaf" + } + } + } + }, + "operations": { + "type": "object", + "properties": { + "ietf-restconf:operations": { + "description": "This resource is a container that provides access to the data-model-specific RPC operations supported by the server. See RESTCONF RFC 8040 for further information.", + "type": "object", + "x-yang": { + "type": "operations" + } + } + } + }, + "root": { + "type": "object", + "properties": { + "ietf-restconf:restconf": { + "description": "This is the RESTCONF root resource for the RESTCONF datastore and operation resources. See RESTCONF RFC 8040 for further information.", + "type": "object", + "properties": { + "data": { + "type": "object" + }, + "operations": { + "type": "object" + }, + "yang-library-version": { + "type": "string" + } + }, + "x-yang": { + "type": "root" + } + } + } + }, + "yang-library-version": { + "type": "object", + "properties": { + "ietf-restconf:yang-library-version": { + "description": "This leaf identifies the revision date of the 'ietf-yang-library' YANG module that is implemented by this server. See RESTCONF RFC 8040 for further information.", + "type": "object", + "x-yang": { + "type": "leaf" + } + } + } + } + }, + "parameters": { + "addresses-id": { + "type": "string", + "format": "string", + "description": "Interface IP address. Example value: 10.10.10.1", + "name": "addresses-id", + "in": "path", + "required": true + }, + "arp-entry-address": { + "type": "string", + "format": "string", + "description": "IP address of the arp entry", + "name": "arp-entry-address", + "in": "path", + "required": true + }, + "content": { + "enum": [ + "config", + "nonconfig", + "all" + ], + "type": "string", + "format": "enumeration", + "default": "config", + "description": "controlling descendant nodes in response", + "name": "content", + "in": "query" + }, + "data-post": { + "description": "This YANG module represents the CoCSN API", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data-post" + } + }, + "data-put-patch": { + "description": "This YANG module represents the CoCSN API", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data-put-patch" + } + }, + "data_cocsn_arp-table": { + "name": "arp-table", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table" + } + }, + "data_cocsn_arp-table-post": { + "name": "arp-table", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table-post" + } + }, + "data_cocsn_interfaces": { + "name": "interfaces", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces" + } + }, + "data_cocsn_interfaces-post": { + "name": "interfaces", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces-post" + } + }, + "data_cocsn_routes": { + "name": "routes", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_routes" + } + }, + "data_cocsn_routes-post": { + "name": "routes", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_routes-post" + } + }, + "depth": { + "type": "integer", + "format": "uint16", + "description": "limit the depth of nodes in response", + "name": "depth", + "in": "query" + }, + "fields": { + "type": "string", + "format": "string", + "description": "optionally identify specific data nodes in response", + "name": "fields", + "in": "query" + }, + "filter": { + "type": "string", + "format": "string", + "description": "xpath expression to filter data nodes in response", + "name": "filter", + "in": "query" + }, + "insert": { + "enum": [ + "first", + "last", + "before", + "after" + ], + "type": "string", + "format": "enumeration", + "default": "first", + "description": "controlling the order when adding new list elements", + "name": "insert", + "in": "query" + }, + "interface-name": { + "type": "string", + "format": "string", + "description": "Interface name. Example value: en0", + "name": "interface-name", + "in": "path", + "required": true + }, + "point": { + "type": "string", + "format": "string", + "description": "used to specify the insertion point", + "name": "point", + "in": "query" + }, + "route-destination": { + "type": "string", + "format": "string", + "description": "Route destination. IP network", + "name": "route-destination", + "in": "path", + "required": true + }, + "with-defaults": { + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ], + "type": "string", + "format": "enumeration", + "default": "report-all", + "description": "controlling default values in response", + "name": "with-defaults", + "in": "query" + } + }, + "responses": { + "200": { + "description": "OK" + }, + "201": { + "description": "Created" + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + }, + "securityDefinitions": { + "basicAuth": { + "type": "basic" + } + }, + "tags": [ + { + "description": "root resources", + "name": "root" + }, + { + "description": "operations resources", + "name": "operations" + }, + { + "description": "data resources", + "name": "data" + }, + { + "description": "get resources", + "name": "get" + }, + { + "description": "post resources", + "name": "post" + }, + { + "description": "patch resources", + "name": "patch" + }, + { + "description": "put resources", + "name": "put" + }, + { + "description": "delete resources", + "name": "delete" + } + ] +}`)) +} diff --git a/api/restapi/operations/cocsn_api.go b/api/restapi/operations/cocsn_api.go new file mode 100644 index 0000000000000000000000000000000000000000..393b7688be1b9e78fd9c2e455b8e28397c66759d --- /dev/null +++ b/api/restapi/operations/cocsn_api.go @@ -0,0 +1,821 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "net/http" + "strings" + + "github.com/go-openapi/errors" + "github.com/go-openapi/loads" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/runtime/security" + "github.com/go-openapi/spec" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/restapi/operations/data" + "code.fbi.h-da.de/cocsn/cocsn-api/api/restapi/operations/operationsops" + "code.fbi.h-da.de/cocsn/cocsn-api/api/restapi/operations/root" + "code.fbi.h-da.de/cocsn/cocsn-api/api/restapi/operations/yang_library_version" +) + +// NewCocsnAPI creates a new Cocsn instance +func NewCocsnAPI(spec *loads.Document) *CocsnAPI { + return &CocsnAPI{ + handlers: make(map[string]map[string]http.Handler), + formats: strfmt.Default, + defaultConsumes: "application/json", + defaultProduces: "application/json", + customConsumers: make(map[string]runtime.Consumer), + customProducers: make(map[string]runtime.Producer), + PreServerShutdown: func() {}, + ServerShutdown: func() {}, + spec: spec, + useSwaggerUI: false, + ServeError: errors.ServeError, + BasicAuthenticator: security.BasicAuth, + APIKeyAuthenticator: security.APIKeyAuth, + BearerAuthenticator: security.BearerAuth, + + JSONConsumer: runtime.JSONConsumer(), + + JSONProducer: runtime.JSONProducer(), + + DataDataCocsnArpTableArpEntryArpEntryAddressAddressGetHandler: data.DataCocsnArpTableArpEntryArpEntryAddressAddressGetHandlerFunc(func(params data.DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTableArpEntryArpEntryAddressAddressGet has not yet been implemented") + }), + DataDataCocsnArpTableArpEntryArpEntryAddressGetHandler: data.DataCocsnArpTableArpEntryArpEntryAddressGetHandlerFunc(func(params data.DataCocsnArpTableArpEntryArpEntryAddressGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTableArpEntryArpEntryAddressGet has not yet been implemented") + }), + DataDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetHandler: data.DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetHandlerFunc(func(params data.DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTableArpEntryArpEntryAddressInterfaceGet has not yet been implemented") + }), + DataDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetHandler: data.DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetHandlerFunc(func(params data.DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGet has not yet been implemented") + }), + DataDataCocsnArpTableArpEntryGetHandler: data.DataCocsnArpTableArpEntryGetHandlerFunc(func(params data.DataCocsnArpTableArpEntryGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTableArpEntryGet has not yet been implemented") + }), + DataDataCocsnArpTableDeleteHandler: data.DataCocsnArpTableDeleteHandlerFunc(func(params data.DataCocsnArpTableDeleteParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTableDelete has not yet been implemented") + }), + DataDataCocsnArpTableGetHandler: data.DataCocsnArpTableGetHandlerFunc(func(params data.DataCocsnArpTableGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTableGet has not yet been implemented") + }), + DataDataCocsnArpTablePatchHandler: data.DataCocsnArpTablePatchHandlerFunc(func(params data.DataCocsnArpTablePatchParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTablePatch has not yet been implemented") + }), + DataDataCocsnArpTablePostHandler: data.DataCocsnArpTablePostHandlerFunc(func(params data.DataCocsnArpTablePostParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTablePost has not yet been implemented") + }), + DataDataCocsnArpTablePutHandler: data.DataCocsnArpTablePutHandlerFunc(func(params data.DataCocsnArpTablePutParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnArpTablePut has not yet been implemented") + }), + DataDataCocsnInterfacesDeleteHandler: data.DataCocsnInterfacesDeleteHandlerFunc(func(params data.DataCocsnInterfacesDeleteParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesDelete has not yet been implemented") + }), + DataDataCocsnInterfacesGetHandler: data.DataCocsnInterfacesGetHandlerFunc(func(params data.DataCocsnInterfacesGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesGet has not yet been implemented") + }), + DataDataCocsnInterfacesInterfaceGetHandler: data.DataCocsnInterfacesInterfaceGetHandlerFunc(func(params data.DataCocsnInterfacesInterfaceGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesInterfaceGet has not yet been implemented") + }), + DataDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetHandler: data.DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetHandlerFunc(func(params data.DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGet has not yet been implemented") + }), + DataDataCocsnInterfacesInterfaceInterfaceNameAddressesGetHandler: data.DataCocsnInterfacesInterfaceInterfaceNameAddressesGetHandlerFunc(func(params data.DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesInterfaceInterfaceNameAddressesGet has not yet been implemented") + }), + DataDataCocsnInterfacesInterfaceInterfaceNameEnabledGetHandler: data.DataCocsnInterfacesInterfaceInterfaceNameEnabledGetHandlerFunc(func(params data.DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesInterfaceInterfaceNameEnabledGet has not yet been implemented") + }), + DataDataCocsnInterfacesInterfaceInterfaceNameGetHandler: data.DataCocsnInterfacesInterfaceInterfaceNameGetHandlerFunc(func(params data.DataCocsnInterfacesInterfaceInterfaceNameGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesInterfaceInterfaceNameGet has not yet been implemented") + }), + DataDataCocsnInterfacesInterfaceInterfaceNameNameGetHandler: data.DataCocsnInterfacesInterfaceInterfaceNameNameGetHandlerFunc(func(params data.DataCocsnInterfacesInterfaceInterfaceNameNameGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesInterfaceInterfaceNameNameGet has not yet been implemented") + }), + DataDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetHandler: data.DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetHandlerFunc(func(params data.DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesInterfaceInterfaceNameOperStatusGet has not yet been implemented") + }), + DataDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetHandler: data.DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetHandlerFunc(func(params data.DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGet has not yet been implemented") + }), + DataDataCocsnInterfacesPatchHandler: data.DataCocsnInterfacesPatchHandlerFunc(func(params data.DataCocsnInterfacesPatchParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesPatch has not yet been implemented") + }), + DataDataCocsnInterfacesPostHandler: data.DataCocsnInterfacesPostHandlerFunc(func(params data.DataCocsnInterfacesPostParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesPost has not yet been implemented") + }), + DataDataCocsnInterfacesPutHandler: data.DataCocsnInterfacesPutHandlerFunc(func(params data.DataCocsnInterfacesPutParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnInterfacesPut has not yet been implemented") + }), + DataDataCocsnRoutesDeleteHandler: data.DataCocsnRoutesDeleteHandlerFunc(func(params data.DataCocsnRoutesDeleteParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesDelete has not yet been implemented") + }), + DataDataCocsnRoutesGetHandler: data.DataCocsnRoutesGetHandlerFunc(func(params data.DataCocsnRoutesGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesGet has not yet been implemented") + }), + DataDataCocsnRoutesPatchHandler: data.DataCocsnRoutesPatchHandlerFunc(func(params data.DataCocsnRoutesPatchParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesPatch has not yet been implemented") + }), + DataDataCocsnRoutesPostHandler: data.DataCocsnRoutesPostHandlerFunc(func(params data.DataCocsnRoutesPostParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesPost has not yet been implemented") + }), + DataDataCocsnRoutesPutHandler: data.DataCocsnRoutesPutHandlerFunc(func(params data.DataCocsnRoutesPutParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesPut has not yet been implemented") + }), + DataDataCocsnRoutesRouteGetHandler: data.DataCocsnRoutesRouteGetHandlerFunc(func(params data.DataCocsnRoutesRouteGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesRouteGet has not yet been implemented") + }), + DataDataCocsnRoutesRouteRouteDestinationDestinationGetHandler: data.DataCocsnRoutesRouteRouteDestinationDestinationGetHandlerFunc(func(params data.DataCocsnRoutesRouteRouteDestinationDestinationGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesRouteRouteDestinationDestinationGet has not yet been implemented") + }), + DataDataCocsnRoutesRouteRouteDestinationExpireGetHandler: data.DataCocsnRoutesRouteRouteDestinationExpireGetHandlerFunc(func(params data.DataCocsnRoutesRouteRouteDestinationExpireGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesRouteRouteDestinationExpireGet has not yet been implemented") + }), + DataDataCocsnRoutesRouteRouteDestinationFlagsGetHandler: data.DataCocsnRoutesRouteRouteDestinationFlagsGetHandlerFunc(func(params data.DataCocsnRoutesRouteRouteDestinationFlagsGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesRouteRouteDestinationFlagsGet has not yet been implemented") + }), + DataDataCocsnRoutesRouteRouteDestinationGatewayGetHandler: data.DataCocsnRoutesRouteRouteDestinationGatewayGetHandlerFunc(func(params data.DataCocsnRoutesRouteRouteDestinationGatewayGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesRouteRouteDestinationGatewayGet has not yet been implemented") + }), + DataDataCocsnRoutesRouteRouteDestinationGetHandler: data.DataCocsnRoutesRouteRouteDestinationGetHandlerFunc(func(params data.DataCocsnRoutesRouteRouteDestinationGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesRouteRouteDestinationGet has not yet been implemented") + }), + DataDataCocsnRoutesRouteRouteDestinationInterfaceGetHandler: data.DataCocsnRoutesRouteRouteDestinationInterfaceGetHandlerFunc(func(params data.DataCocsnRoutesRouteRouteDestinationInterfaceGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataCocsnRoutesRouteRouteDestinationInterfaceGet has not yet been implemented") + }), + DataDataGetHandler: data.DataGetHandlerFunc(func(params data.DataGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataGet has not yet been implemented") + }), + DataDataPatchHandler: data.DataPatchHandlerFunc(func(params data.DataPatchParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataPatch has not yet been implemented") + }), + DataDataPostHandler: data.DataPostHandlerFunc(func(params data.DataPostParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataPost has not yet been implemented") + }), + DataDataPutHandler: data.DataPutHandlerFunc(func(params data.DataPutParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation data.DataPut has not yet been implemented") + }), + OperationsopsOperationsGetHandler: operationsops.OperationsGetHandlerFunc(func(params operationsops.OperationsGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation operationsops.OperationsGet has not yet been implemented") + }), + RootRootGetHandler: root.RootGetHandlerFunc(func(params root.RootGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation root.RootGet has not yet been implemented") + }), + YangLibraryVersionYangLibraryVersionGetHandler: yang_library_version.YangLibraryVersionGetHandlerFunc(func(params yang_library_version.YangLibraryVersionGetParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation yang_library_version.YangLibraryVersionGet has not yet been implemented") + }), + + // Applies when the Authorization header is set with the Basic scheme + BasicAuthAuth: func(user string, pass string) (interface{}, error) { + return nil, errors.NotImplemented("basic auth (basicAuth) has not yet been implemented") + }, + // default authorizer is authorized meaning no requests are blocked + APIAuthorizer: security.Authorized(), + } +} + +/*CocsnAPI This YANG module represents the CoCSN API */ +type CocsnAPI struct { + spec *loads.Document + context *middleware.Context + handlers map[string]map[string]http.Handler + formats strfmt.Registry + customConsumers map[string]runtime.Consumer + customProducers map[string]runtime.Producer + defaultConsumes string + defaultProduces string + Middleware func(middleware.Builder) http.Handler + useSwaggerUI bool + + // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator + // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator + // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator + + // JSONConsumer registers a consumer for the following mime types: + // - application/yang-data+json + JSONConsumer runtime.Consumer + + // JSONProducer registers a producer for the following mime types: + // - application/yang-data+json + JSONProducer runtime.Producer + + // BasicAuthAuth registers a function that takes username and password and returns a principal + // it performs authentication with basic auth + BasicAuthAuth func(string, string) (interface{}, error) + + // APIAuthorizer provides access control (ACL/RBAC/ABAC) by providing access to the request and authenticated principal + APIAuthorizer runtime.Authorizer + + // DataDataCocsnArpTableArpEntryArpEntryAddressAddressGetHandler sets the operation handler for the data cocsn arp table arp entry arp entry address address get operation + DataDataCocsnArpTableArpEntryArpEntryAddressAddressGetHandler data.DataCocsnArpTableArpEntryArpEntryAddressAddressGetHandler + // DataDataCocsnArpTableArpEntryArpEntryAddressGetHandler sets the operation handler for the data cocsn arp table arp entry arp entry address get operation + DataDataCocsnArpTableArpEntryArpEntryAddressGetHandler data.DataCocsnArpTableArpEntryArpEntryAddressGetHandler + // DataDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetHandler sets the operation handler for the data cocsn arp table arp entry arp entry address interface get operation + DataDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetHandler data.DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetHandler + // DataDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetHandler sets the operation handler for the data cocsn arp table arp entry arp entry address phs address get operation + DataDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetHandler data.DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetHandler + // DataDataCocsnArpTableArpEntryGetHandler sets the operation handler for the data cocsn arp table arp entry get operation + DataDataCocsnArpTableArpEntryGetHandler data.DataCocsnArpTableArpEntryGetHandler + // DataDataCocsnArpTableDeleteHandler sets the operation handler for the data cocsn arp table delete operation + DataDataCocsnArpTableDeleteHandler data.DataCocsnArpTableDeleteHandler + // DataDataCocsnArpTableGetHandler sets the operation handler for the data cocsn arp table get operation + DataDataCocsnArpTableGetHandler data.DataCocsnArpTableGetHandler + // DataDataCocsnArpTablePatchHandler sets the operation handler for the data cocsn arp table patch operation + DataDataCocsnArpTablePatchHandler data.DataCocsnArpTablePatchHandler + // DataDataCocsnArpTablePostHandler sets the operation handler for the data cocsn arp table post operation + DataDataCocsnArpTablePostHandler data.DataCocsnArpTablePostHandler + // DataDataCocsnArpTablePutHandler sets the operation handler for the data cocsn arp table put operation + DataDataCocsnArpTablePutHandler data.DataCocsnArpTablePutHandler + // DataDataCocsnInterfacesDeleteHandler sets the operation handler for the data cocsn interfaces delete operation + DataDataCocsnInterfacesDeleteHandler data.DataCocsnInterfacesDeleteHandler + // DataDataCocsnInterfacesGetHandler sets the operation handler for the data cocsn interfaces get operation + DataDataCocsnInterfacesGetHandler data.DataCocsnInterfacesGetHandler + // DataDataCocsnInterfacesInterfaceGetHandler sets the operation handler for the data cocsn interfaces interface get operation + DataDataCocsnInterfacesInterfaceGetHandler data.DataCocsnInterfacesInterfaceGetHandler + // DataDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetHandler sets the operation handler for the data cocsn interfaces interface interface name addresses addresses id get operation + DataDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetHandler data.DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetHandler + // DataDataCocsnInterfacesInterfaceInterfaceNameAddressesGetHandler sets the operation handler for the data cocsn interfaces interface interface name addresses get operation + DataDataCocsnInterfacesInterfaceInterfaceNameAddressesGetHandler data.DataCocsnInterfacesInterfaceInterfaceNameAddressesGetHandler + // DataDataCocsnInterfacesInterfaceInterfaceNameEnabledGetHandler sets the operation handler for the data cocsn interfaces interface interface name enabled get operation + DataDataCocsnInterfacesInterfaceInterfaceNameEnabledGetHandler data.DataCocsnInterfacesInterfaceInterfaceNameEnabledGetHandler + // DataDataCocsnInterfacesInterfaceInterfaceNameGetHandler sets the operation handler for the data cocsn interfaces interface interface name get operation + DataDataCocsnInterfacesInterfaceInterfaceNameGetHandler data.DataCocsnInterfacesInterfaceInterfaceNameGetHandler + // DataDataCocsnInterfacesInterfaceInterfaceNameNameGetHandler sets the operation handler for the data cocsn interfaces interface interface name name get operation + DataDataCocsnInterfacesInterfaceInterfaceNameNameGetHandler data.DataCocsnInterfacesInterfaceInterfaceNameNameGetHandler + // DataDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetHandler sets the operation handler for the data cocsn interfaces interface interface name oper status get operation + DataDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetHandler data.DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetHandler + // DataDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetHandler sets the operation handler for the data cocsn interfaces interface interface name phys address get operation + DataDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetHandler data.DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetHandler + // DataDataCocsnInterfacesPatchHandler sets the operation handler for the data cocsn interfaces patch operation + DataDataCocsnInterfacesPatchHandler data.DataCocsnInterfacesPatchHandler + // DataDataCocsnInterfacesPostHandler sets the operation handler for the data cocsn interfaces post operation + DataDataCocsnInterfacesPostHandler data.DataCocsnInterfacesPostHandler + // DataDataCocsnInterfacesPutHandler sets the operation handler for the data cocsn interfaces put operation + DataDataCocsnInterfacesPutHandler data.DataCocsnInterfacesPutHandler + // DataDataCocsnRoutesDeleteHandler sets the operation handler for the data cocsn routes delete operation + DataDataCocsnRoutesDeleteHandler data.DataCocsnRoutesDeleteHandler + // DataDataCocsnRoutesGetHandler sets the operation handler for the data cocsn routes get operation + DataDataCocsnRoutesGetHandler data.DataCocsnRoutesGetHandler + // DataDataCocsnRoutesPatchHandler sets the operation handler for the data cocsn routes patch operation + DataDataCocsnRoutesPatchHandler data.DataCocsnRoutesPatchHandler + // DataDataCocsnRoutesPostHandler sets the operation handler for the data cocsn routes post operation + DataDataCocsnRoutesPostHandler data.DataCocsnRoutesPostHandler + // DataDataCocsnRoutesPutHandler sets the operation handler for the data cocsn routes put operation + DataDataCocsnRoutesPutHandler data.DataCocsnRoutesPutHandler + // DataDataCocsnRoutesRouteGetHandler sets the operation handler for the data cocsn routes route get operation + DataDataCocsnRoutesRouteGetHandler data.DataCocsnRoutesRouteGetHandler + // DataDataCocsnRoutesRouteRouteDestinationDestinationGetHandler sets the operation handler for the data cocsn routes route route destination destination get operation + DataDataCocsnRoutesRouteRouteDestinationDestinationGetHandler data.DataCocsnRoutesRouteRouteDestinationDestinationGetHandler + // DataDataCocsnRoutesRouteRouteDestinationExpireGetHandler sets the operation handler for the data cocsn routes route route destination expire get operation + DataDataCocsnRoutesRouteRouteDestinationExpireGetHandler data.DataCocsnRoutesRouteRouteDestinationExpireGetHandler + // DataDataCocsnRoutesRouteRouteDestinationFlagsGetHandler sets the operation handler for the data cocsn routes route route destination flags get operation + DataDataCocsnRoutesRouteRouteDestinationFlagsGetHandler data.DataCocsnRoutesRouteRouteDestinationFlagsGetHandler + // DataDataCocsnRoutesRouteRouteDestinationGatewayGetHandler sets the operation handler for the data cocsn routes route route destination gateway get operation + DataDataCocsnRoutesRouteRouteDestinationGatewayGetHandler data.DataCocsnRoutesRouteRouteDestinationGatewayGetHandler + // DataDataCocsnRoutesRouteRouteDestinationGetHandler sets the operation handler for the data cocsn routes route route destination get operation + DataDataCocsnRoutesRouteRouteDestinationGetHandler data.DataCocsnRoutesRouteRouteDestinationGetHandler + // DataDataCocsnRoutesRouteRouteDestinationInterfaceGetHandler sets the operation handler for the data cocsn routes route route destination interface get operation + DataDataCocsnRoutesRouteRouteDestinationInterfaceGetHandler data.DataCocsnRoutesRouteRouteDestinationInterfaceGetHandler + // DataDataGetHandler sets the operation handler for the data get operation + DataDataGetHandler data.DataGetHandler + // DataDataPatchHandler sets the operation handler for the data patch operation + DataDataPatchHandler data.DataPatchHandler + // DataDataPostHandler sets the operation handler for the data post operation + DataDataPostHandler data.DataPostHandler + // DataDataPutHandler sets the operation handler for the data put operation + DataDataPutHandler data.DataPutHandler + // OperationsopsOperationsGetHandler sets the operation handler for the operations get operation + OperationsopsOperationsGetHandler operationsops.OperationsGetHandler + // RootRootGetHandler sets the operation handler for the root get operation + RootRootGetHandler root.RootGetHandler + // YangLibraryVersionYangLibraryVersionGetHandler sets the operation handler for the yang library version get operation + YangLibraryVersionYangLibraryVersionGetHandler yang_library_version.YangLibraryVersionGetHandler + // ServeError is called when an error is received, there is a default handler + // but you can set your own with this + ServeError func(http.ResponseWriter, *http.Request, error) + + // PreServerShutdown is called before the HTTP(S) server is shutdown + // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic + PreServerShutdown func() + + // ServerShutdown is called when the HTTP(S) server is shut down and done + // handling all active connections and does not accept connections any more + ServerShutdown func() + + // Custom command line argument groups with their descriptions + CommandLineOptionsGroups []swag.CommandLineOptionsGroup + + // User defined logger function. + Logger func(string, ...interface{}) +} + +// UseRedoc for documentation at /docs +func (o *CocsnAPI) UseRedoc() { + o.useSwaggerUI = false +} + +// UseSwaggerUI for documentation at /docs +func (o *CocsnAPI) UseSwaggerUI() { + o.useSwaggerUI = true +} + +// SetDefaultProduces sets the default produces media type +func (o *CocsnAPI) SetDefaultProduces(mediaType string) { + o.defaultProduces = mediaType +} + +// SetDefaultConsumes returns the default consumes media type +func (o *CocsnAPI) SetDefaultConsumes(mediaType string) { + o.defaultConsumes = mediaType +} + +// SetSpec sets a spec that will be served for the clients. +func (o *CocsnAPI) SetSpec(spec *loads.Document) { + o.spec = spec +} + +// DefaultProduces returns the default produces media type +func (o *CocsnAPI) DefaultProduces() string { + return o.defaultProduces +} + +// DefaultConsumes returns the default consumes media type +func (o *CocsnAPI) DefaultConsumes() string { + return o.defaultConsumes +} + +// Formats returns the registered string formats +func (o *CocsnAPI) Formats() strfmt.Registry { + return o.formats +} + +// RegisterFormat registers a custom format validator +func (o *CocsnAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { + o.formats.Add(name, format, validator) +} + +// Validate validates the registrations in the CocsnAPI +func (o *CocsnAPI) Validate() error { + var unregistered []string + + if o.JSONConsumer == nil { + unregistered = append(unregistered, "JSONConsumer") + } + + if o.JSONProducer == nil { + unregistered = append(unregistered, "JSONProducer") + } + + if o.BasicAuthAuth == nil { + unregistered = append(unregistered, "BasicAuthAuth") + } + + if o.DataDataCocsnArpTableArpEntryArpEntryAddressAddressGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnArpTableArpEntryArpEntryAddressAddressGetHandler") + } + if o.DataDataCocsnArpTableArpEntryArpEntryAddressGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnArpTableArpEntryArpEntryAddressGetHandler") + } + if o.DataDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetHandler") + } + if o.DataDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetHandler") + } + if o.DataDataCocsnArpTableArpEntryGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnArpTableArpEntryGetHandler") + } + if o.DataDataCocsnArpTableDeleteHandler == nil { + unregistered = append(unregistered, "data.DataCocsnArpTableDeleteHandler") + } + if o.DataDataCocsnArpTableGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnArpTableGetHandler") + } + if o.DataDataCocsnArpTablePatchHandler == nil { + unregistered = append(unregistered, "data.DataCocsnArpTablePatchHandler") + } + if o.DataDataCocsnArpTablePostHandler == nil { + unregistered = append(unregistered, "data.DataCocsnArpTablePostHandler") + } + if o.DataDataCocsnArpTablePutHandler == nil { + unregistered = append(unregistered, "data.DataCocsnArpTablePutHandler") + } + if o.DataDataCocsnInterfacesDeleteHandler == nil { + unregistered = append(unregistered, "data.DataCocsnInterfacesDeleteHandler") + } + if o.DataDataCocsnInterfacesGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnInterfacesGetHandler") + } + if o.DataDataCocsnInterfacesInterfaceGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnInterfacesInterfaceGetHandler") + } + if o.DataDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetHandler") + } + if o.DataDataCocsnInterfacesInterfaceInterfaceNameAddressesGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnInterfacesInterfaceInterfaceNameAddressesGetHandler") + } + if o.DataDataCocsnInterfacesInterfaceInterfaceNameEnabledGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnInterfacesInterfaceInterfaceNameEnabledGetHandler") + } + if o.DataDataCocsnInterfacesInterfaceInterfaceNameGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnInterfacesInterfaceInterfaceNameGetHandler") + } + if o.DataDataCocsnInterfacesInterfaceInterfaceNameNameGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnInterfacesInterfaceInterfaceNameNameGetHandler") + } + if o.DataDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetHandler") + } + if o.DataDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetHandler") + } + if o.DataDataCocsnInterfacesPatchHandler == nil { + unregistered = append(unregistered, "data.DataCocsnInterfacesPatchHandler") + } + if o.DataDataCocsnInterfacesPostHandler == nil { + unregistered = append(unregistered, "data.DataCocsnInterfacesPostHandler") + } + if o.DataDataCocsnInterfacesPutHandler == nil { + unregistered = append(unregistered, "data.DataCocsnInterfacesPutHandler") + } + if o.DataDataCocsnRoutesDeleteHandler == nil { + unregistered = append(unregistered, "data.DataCocsnRoutesDeleteHandler") + } + if o.DataDataCocsnRoutesGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnRoutesGetHandler") + } + if o.DataDataCocsnRoutesPatchHandler == nil { + unregistered = append(unregistered, "data.DataCocsnRoutesPatchHandler") + } + if o.DataDataCocsnRoutesPostHandler == nil { + unregistered = append(unregistered, "data.DataCocsnRoutesPostHandler") + } + if o.DataDataCocsnRoutesPutHandler == nil { + unregistered = append(unregistered, "data.DataCocsnRoutesPutHandler") + } + if o.DataDataCocsnRoutesRouteGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnRoutesRouteGetHandler") + } + if o.DataDataCocsnRoutesRouteRouteDestinationDestinationGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnRoutesRouteRouteDestinationDestinationGetHandler") + } + if o.DataDataCocsnRoutesRouteRouteDestinationExpireGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnRoutesRouteRouteDestinationExpireGetHandler") + } + if o.DataDataCocsnRoutesRouteRouteDestinationFlagsGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnRoutesRouteRouteDestinationFlagsGetHandler") + } + if o.DataDataCocsnRoutesRouteRouteDestinationGatewayGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnRoutesRouteRouteDestinationGatewayGetHandler") + } + if o.DataDataCocsnRoutesRouteRouteDestinationGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnRoutesRouteRouteDestinationGetHandler") + } + if o.DataDataCocsnRoutesRouteRouteDestinationInterfaceGetHandler == nil { + unregistered = append(unregistered, "data.DataCocsnRoutesRouteRouteDestinationInterfaceGetHandler") + } + if o.DataDataGetHandler == nil { + unregistered = append(unregistered, "data.DataGetHandler") + } + if o.DataDataPatchHandler == nil { + unregistered = append(unregistered, "data.DataPatchHandler") + } + if o.DataDataPostHandler == nil { + unregistered = append(unregistered, "data.DataPostHandler") + } + if o.DataDataPutHandler == nil { + unregistered = append(unregistered, "data.DataPutHandler") + } + if o.OperationsopsOperationsGetHandler == nil { + unregistered = append(unregistered, "operationsops.OperationsGetHandler") + } + if o.RootRootGetHandler == nil { + unregistered = append(unregistered, "root.RootGetHandler") + } + if o.YangLibraryVersionYangLibraryVersionGetHandler == nil { + unregistered = append(unregistered, "yang_library_version.YangLibraryVersionGetHandler") + } + + if len(unregistered) > 0 { + return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) + } + + return nil +} + +// ServeErrorFor gets a error handler for a given operation id +func (o *CocsnAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { + return o.ServeError +} + +// AuthenticatorsFor gets the authenticators for the specified security schemes +func (o *CocsnAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { + result := make(map[string]runtime.Authenticator) + for name := range schemes { + switch name { + case "basicAuth": + result[name] = o.BasicAuthenticator(o.BasicAuthAuth) + + } + } + return result +} + +// Authorizer returns the registered authorizer +func (o *CocsnAPI) Authorizer() runtime.Authorizer { + return o.APIAuthorizer +} + +// ConsumersFor gets the consumers for the specified media types. +// MIME type parameters are ignored here. +func (o *CocsnAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { + result := make(map[string]runtime.Consumer, len(mediaTypes)) + for _, mt := range mediaTypes { + switch mt { + case "application/yang-data+json": + result["application/yang-data+json"] = o.JSONConsumer + } + + if c, ok := o.customConsumers[mt]; ok { + result[mt] = c + } + } + return result +} + +// ProducersFor gets the producers for the specified media types. +// MIME type parameters are ignored here. +func (o *CocsnAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { + result := make(map[string]runtime.Producer, len(mediaTypes)) + for _, mt := range mediaTypes { + switch mt { + case "application/yang-data+json": + result["application/yang-data+json"] = o.JSONProducer + } + + if p, ok := o.customProducers[mt]; ok { + result[mt] = p + } + } + return result +} + +// HandlerFor gets a http.Handler for the provided operation method and path +func (o *CocsnAPI) HandlerFor(method, path string) (http.Handler, bool) { + if o.handlers == nil { + return nil, false + } + um := strings.ToUpper(method) + if _, ok := o.handlers[um]; !ok { + return nil, false + } + if path == "/" { + path = "" + } + h, ok := o.handlers[um][path] + return h, ok +} + +// Context returns the middleware context for the cocsn API +func (o *CocsnAPI) Context() *middleware.Context { + if o.context == nil { + o.context = middleware.NewRoutableContext(o.spec, o, nil) + } + + return o.context +} + +func (o *CocsnAPI) initHandlerCache() { + o.Context() // don't care about the result, just that the initialization happened + if o.handlers == nil { + o.handlers = make(map[string]map[string]http.Handler) + } + + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:arp-table/arp-entry={arp-entry-address}/address"] = data.NewDataCocsnArpTableArpEntryArpEntryAddressAddressGet(o.context, o.DataDataCocsnArpTableArpEntryArpEntryAddressAddressGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:arp-table/arp-entry={arp-entry-address}"] = data.NewDataCocsnArpTableArpEntryArpEntryAddressGet(o.context, o.DataDataCocsnArpTableArpEntryArpEntryAddressGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:arp-table/arp-entry={arp-entry-address}/interface"] = data.NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGet(o.context, o.DataDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:arp-table/arp-entry={arp-entry-address}/phs-address"] = data.NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGet(o.context, o.DataDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:arp-table/arp-entry"] = data.NewDataCocsnArpTableArpEntryGet(o.context, o.DataDataCocsnArpTableArpEntryGetHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/data/cocsn:arp-table"] = data.NewDataCocsnArpTableDelete(o.context, o.DataDataCocsnArpTableDeleteHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:arp-table"] = data.NewDataCocsnArpTableGet(o.context, o.DataDataCocsnArpTableGetHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/data/cocsn:arp-table"] = data.NewDataCocsnArpTablePatch(o.context, o.DataDataCocsnArpTablePatchHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data/cocsn:arp-table"] = data.NewDataCocsnArpTablePost(o.context, o.DataDataCocsnArpTablePostHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data/cocsn:arp-table"] = data.NewDataCocsnArpTablePut(o.context, o.DataDataCocsnArpTablePutHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/data/cocsn:interfaces"] = data.NewDataCocsnInterfacesDelete(o.context, o.DataDataCocsnInterfacesDeleteHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:interfaces"] = data.NewDataCocsnInterfacesGet(o.context, o.DataDataCocsnInterfacesGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:interfaces/interface"] = data.NewDataCocsnInterfacesInterfaceGet(o.context, o.DataDataCocsnInterfacesInterfaceGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:interfaces/interface={interface-name}/addresses={addresses-id}"] = data.NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGet(o.context, o.DataDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:interfaces/interface={interface-name}/addresses"] = data.NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGet(o.context, o.DataDataCocsnInterfacesInterfaceInterfaceNameAddressesGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:interfaces/interface={interface-name}/enabled"] = data.NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGet(o.context, o.DataDataCocsnInterfacesInterfaceInterfaceNameEnabledGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:interfaces/interface={interface-name}"] = data.NewDataCocsnInterfacesInterfaceInterfaceNameGet(o.context, o.DataDataCocsnInterfacesInterfaceInterfaceNameGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:interfaces/interface={interface-name}/name"] = data.NewDataCocsnInterfacesInterfaceInterfaceNameNameGet(o.context, o.DataDataCocsnInterfacesInterfaceInterfaceNameNameGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:interfaces/interface={interface-name}/oper-status"] = data.NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGet(o.context, o.DataDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:interfaces/interface={interface-name}/phys-address"] = data.NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGet(o.context, o.DataDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/data/cocsn:interfaces"] = data.NewDataCocsnInterfacesPatch(o.context, o.DataDataCocsnInterfacesPatchHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data/cocsn:interfaces"] = data.NewDataCocsnInterfacesPost(o.context, o.DataDataCocsnInterfacesPostHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data/cocsn:interfaces"] = data.NewDataCocsnInterfacesPut(o.context, o.DataDataCocsnInterfacesPutHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/data/cocsn:routes"] = data.NewDataCocsnRoutesDelete(o.context, o.DataDataCocsnRoutesDeleteHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:routes"] = data.NewDataCocsnRoutesGet(o.context, o.DataDataCocsnRoutesGetHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/data/cocsn:routes"] = data.NewDataCocsnRoutesPatch(o.context, o.DataDataCocsnRoutesPatchHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data/cocsn:routes"] = data.NewDataCocsnRoutesPost(o.context, o.DataDataCocsnRoutesPostHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data/cocsn:routes"] = data.NewDataCocsnRoutesPut(o.context, o.DataDataCocsnRoutesPutHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:routes/route"] = data.NewDataCocsnRoutesRouteGet(o.context, o.DataDataCocsnRoutesRouteGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:routes/route={route-destination}/destination"] = data.NewDataCocsnRoutesRouteRouteDestinationDestinationGet(o.context, o.DataDataCocsnRoutesRouteRouteDestinationDestinationGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:routes/route={route-destination}/expire"] = data.NewDataCocsnRoutesRouteRouteDestinationExpireGet(o.context, o.DataDataCocsnRoutesRouteRouteDestinationExpireGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:routes/route={route-destination}/flags"] = data.NewDataCocsnRoutesRouteRouteDestinationFlagsGet(o.context, o.DataDataCocsnRoutesRouteRouteDestinationFlagsGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:routes/route={route-destination}/gateway"] = data.NewDataCocsnRoutesRouteRouteDestinationGatewayGet(o.context, o.DataDataCocsnRoutesRouteRouteDestinationGatewayGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:routes/route={route-destination}"] = data.NewDataCocsnRoutesRouteRouteDestinationGet(o.context, o.DataDataCocsnRoutesRouteRouteDestinationGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/cocsn:routes/route={route-destination}/interface"] = data.NewDataCocsnRoutesRouteRouteDestinationInterfaceGet(o.context, o.DataDataCocsnRoutesRouteRouteDestinationInterfaceGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data"] = data.NewDataGet(o.context, o.DataDataGetHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/data"] = data.NewDataPatch(o.context, o.DataDataPatchHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data"] = data.NewDataPost(o.context, o.DataDataPostHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data"] = data.NewDataPut(o.context, o.DataDataPutHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/operations"] = operationsops.NewOperationsGet(o.context, o.OperationsopsOperationsGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"][""] = root.NewRootGet(o.context, o.RootRootGetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/yang-library-version"] = yang_library_version.NewYangLibraryVersionGet(o.context, o.YangLibraryVersionYangLibraryVersionGetHandler) +} + +// Serve creates a http handler to serve the API over HTTP +// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) +func (o *CocsnAPI) Serve(builder middleware.Builder) http.Handler { + o.Init() + + if o.Middleware != nil { + return o.Middleware(builder) + } + if o.useSwaggerUI { + return o.context.APIHandlerSwaggerUI(builder) + } + return o.context.APIHandler(builder) +} + +// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit +func (o *CocsnAPI) Init() { + if len(o.handlers) == 0 { + o.initHandlerCache() + } +} + +// RegisterConsumer allows you to add (or override) a consumer for a media type. +func (o *CocsnAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { + o.customConsumers[mediaType] = consumer +} + +// RegisterProducer allows you to add (or override) a producer for a media type. +func (o *CocsnAPI) RegisterProducer(mediaType string, producer runtime.Producer) { + o.customProducers[mediaType] = producer +} + +// AddMiddlewareFor adds a http middleware to existing handler +func (o *CocsnAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { + um := strings.ToUpper(method) + if path == "/" { + path = "" + } + o.Init() + if h, ok := o.handlers[um][path]; ok { + o.handlers[method][path] = builder(h) + } +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_address_get.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_address_get.go new file mode 100644 index 0000000000000000000000000000000000000000..3489eddd62bd7653d486f48ee2894f10c33f9648 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_address_get.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnArpTableArpEntryArpEntryAddressAddressGetHandlerFunc turns a function with the right signature into a data cocsn arp table arp entry arp entry address address get handler +type DataCocsnArpTableArpEntryArpEntryAddressAddressGetHandlerFunc func(DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnArpTableArpEntryArpEntryAddressAddressGetHandlerFunc) Handle(params DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnArpTableArpEntryArpEntryAddressAddressGetHandler interface for that can handle valid data cocsn arp table arp entry arp entry address address get params +type DataCocsnArpTableArpEntryArpEntryAddressAddressGetHandler interface { + Handle(DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressAddressGet creates a new http.Handler for the data cocsn arp table arp entry arp entry address address get operation +func NewDataCocsnArpTableArpEntryArpEntryAddressAddressGet(ctx *middleware.Context, handler DataCocsnArpTableArpEntryArpEntryAddressAddressGetHandler) *DataCocsnArpTableArpEntryArpEntryAddressAddressGet { + return &DataCocsnArpTableArpEntryArpEntryAddressAddressGet{Context: ctx, Handler: handler} +} + +/*DataCocsnArpTableArpEntryArpEntryAddressAddressGet swagger:route GET /data/cocsn:arp-table/arp-entry={arp-entry-address}/address data get dataCocsnArpTableArpEntryArpEntryAddressAddressGet + +IP address of the arp entry + +IP address of the arp entry + +*/ +type DataCocsnArpTableArpEntryArpEntryAddressAddressGet struct { + Context *middleware.Context + Handler DataCocsnArpTableArpEntryArpEntryAddressAddressGetHandler +} + +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_address_get_parameters.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_address_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..be73ff0c29599271904221decc8b751e3b765595 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_address_get_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetParams creates a new DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams object +// with the default values initialized. +func NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetParams() DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams contains all the bound params for the data cocsn arp table arp entry arp entry address address get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_arp_table_arp_entry_arp_entry_address_address_get +type DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*IP address of the arp entry + Required: true + In: path + */ + ArpEntryAddress string + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetParams() beforehand. +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + rArpEntryAddress, rhkArpEntryAddress, _ := route.Params.GetOK("arp-entry-address") + if err := o.bindArpEntryAddress(rArpEntryAddress, rhkArpEntryAddress, route.Formats); err != nil { + res = append(res, err) + } + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindArpEntryAddress binds and validates parameter ArpEntryAddress from path. +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams) bindArpEntryAddress(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.ArpEntryAddress = raw + + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_address_get_responses.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_address_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..79f3fef7edb51f987573b4eb79fd74c119f153b2 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_address_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnArpTableArpEntryArpEntryAddressAddressGetOKCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressAddressGetOK +const DataCocsnArpTableArpEntryArpEntryAddressAddressGetOKCode int = 200 + +/*DataCocsnArpTableArpEntryArpEntryAddressAddressGetOK IP address of the arp entry + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressAddressGetOK +*/ +type DataCocsnArpTableArpEntryArpEntryAddressAddressGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnArpTableArpEntryArpEntryAddressAddress `json:"body,omitempty"` +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetOK creates DataCocsnArpTableArpEntryArpEntryAddressAddressGetOK with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetOK() *DataCocsnArpTableArpEntryArpEntryAddressAddressGetOK { + + return &DataCocsnArpTableArpEntryArpEntryAddressAddressGetOK{} +} + +// WithPayload adds the payload to the data cocsn arp table arp entry arp entry address address get o k response +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetOK) WithPayload(payload *models.DataCocsnArpTableArpEntryArpEntryAddressAddress) *DataCocsnArpTableArpEntryArpEntryAddressAddressGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn arp table arp entry arp entry address address get o k response +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetOK) SetPayload(payload *models.DataCocsnArpTableArpEntryArpEntryAddressAddress) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnArpTableArpEntryArpEntryAddressAddressGetNoContentCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressAddressGetNoContent +const DataCocsnArpTableArpEntryArpEntryAddressAddressGetNoContentCode int = 204 + +/*DataCocsnArpTableArpEntryArpEntryAddressAddressGetNoContent No Content + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressAddressGetNoContent +*/ +type DataCocsnArpTableArpEntryArpEntryAddressAddressGetNoContent struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetNoContent creates DataCocsnArpTableArpEntryArpEntryAddressAddressGetNoContent with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetNoContent() *DataCocsnArpTableArpEntryArpEntryAddressAddressGetNoContent { + + return &DataCocsnArpTableArpEntryArpEntryAddressAddressGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnArpTableArpEntryArpEntryAddressAddressGetBadRequestCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressAddressGetBadRequest +const DataCocsnArpTableArpEntryArpEntryAddressAddressGetBadRequestCode int = 400 + +/*DataCocsnArpTableArpEntryArpEntryAddressAddressGetBadRequest Bad Request + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressAddressGetBadRequest +*/ +type DataCocsnArpTableArpEntryArpEntryAddressAddressGetBadRequest struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetBadRequest creates DataCocsnArpTableArpEntryArpEntryAddressAddressGetBadRequest with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetBadRequest() *DataCocsnArpTableArpEntryArpEntryAddressAddressGetBadRequest { + + return &DataCocsnArpTableArpEntryArpEntryAddressAddressGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnArpTableArpEntryArpEntryAddressAddressGetUnauthorizedCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressAddressGetUnauthorized +const DataCocsnArpTableArpEntryArpEntryAddressAddressGetUnauthorizedCode int = 401 + +/*DataCocsnArpTableArpEntryArpEntryAddressAddressGetUnauthorized Unauthorized + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressAddressGetUnauthorized +*/ +type DataCocsnArpTableArpEntryArpEntryAddressAddressGetUnauthorized struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetUnauthorized creates DataCocsnArpTableArpEntryArpEntryAddressAddressGetUnauthorized with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetUnauthorized() *DataCocsnArpTableArpEntryArpEntryAddressAddressGetUnauthorized { + + return &DataCocsnArpTableArpEntryArpEntryAddressAddressGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnArpTableArpEntryArpEntryAddressAddressGetNotFoundCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressAddressGetNotFound +const DataCocsnArpTableArpEntryArpEntryAddressAddressGetNotFoundCode int = 404 + +/*DataCocsnArpTableArpEntryArpEntryAddressAddressGetNotFound Not Found + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressAddressGetNotFound +*/ +type DataCocsnArpTableArpEntryArpEntryAddressAddressGetNotFound struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetNotFound creates DataCocsnArpTableArpEntryArpEntryAddressAddressGetNotFound with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetNotFound() *DataCocsnArpTableArpEntryArpEntryAddressAddressGetNotFound { + + return &DataCocsnArpTableArpEntryArpEntryAddressAddressGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnArpTableArpEntryArpEntryAddressAddressGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressAddressGetMethodNotAllowed +const DataCocsnArpTableArpEntryArpEntryAddressAddressGetMethodNotAllowedCode int = 405 + +/*DataCocsnArpTableArpEntryArpEntryAddressAddressGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressAddressGetMethodNotAllowed +*/ +type DataCocsnArpTableArpEntryArpEntryAddressAddressGetMethodNotAllowed struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetMethodNotAllowed creates DataCocsnArpTableArpEntryArpEntryAddressAddressGetMethodNotAllowed with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetMethodNotAllowed() *DataCocsnArpTableArpEntryArpEntryAddressAddressGetMethodNotAllowed { + + return &DataCocsnArpTableArpEntryArpEntryAddressAddressGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnArpTableArpEntryArpEntryAddressAddressGetConflictCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressAddressGetConflict +const DataCocsnArpTableArpEntryArpEntryAddressAddressGetConflictCode int = 409 + +/*DataCocsnArpTableArpEntryArpEntryAddressAddressGetConflict Conflict + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressAddressGetConflict +*/ +type DataCocsnArpTableArpEntryArpEntryAddressAddressGetConflict struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetConflict creates DataCocsnArpTableArpEntryArpEntryAddressAddressGetConflict with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressAddressGetConflict() *DataCocsnArpTableArpEntryArpEntryAddressAddressGetConflict { + + return &DataCocsnArpTableArpEntryArpEntryAddressAddressGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_address_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_address_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..3520cbe5450924cab43046050020872dfd0ec865 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_address_get_urlbuilder.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DataCocsnArpTableArpEntryArpEntryAddressAddressGetURL generates an URL for the data cocsn arp table arp entry arp entry address address get operation +type DataCocsnArpTableArpEntryArpEntryAddressAddressGetURL struct { + ArpEntryAddress string + + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetURL) WithBasePath(bp string) *DataCocsnArpTableArpEntryArpEntryAddressAddressGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:arp-table/arp-entry={arp-entry-address}/address" + + arpEntryAddress := o.ArpEntryAddress + if arpEntryAddress != "" { + _path = strings.Replace(_path, "{arp-entry-address}", arpEntryAddress, -1) + } else { + return nil, errors.New("arpEntryAddress is required on DataCocsnArpTableArpEntryArpEntryAddressAddressGetURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnArpTableArpEntryArpEntryAddressAddressGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnArpTableArpEntryArpEntryAddressAddressGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnArpTableArpEntryArpEntryAddressAddressGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_get.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_get.go new file mode 100644 index 0000000000000000000000000000000000000000..5c5355ba68e1c301b286175356160fef629da634 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_get.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnArpTableArpEntryArpEntryAddressGetHandlerFunc turns a function with the right signature into a data cocsn arp table arp entry arp entry address get handler +type DataCocsnArpTableArpEntryArpEntryAddressGetHandlerFunc func(DataCocsnArpTableArpEntryArpEntryAddressGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnArpTableArpEntryArpEntryAddressGetHandlerFunc) Handle(params DataCocsnArpTableArpEntryArpEntryAddressGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnArpTableArpEntryArpEntryAddressGetHandler interface for that can handle valid data cocsn arp table arp entry arp entry address get params +type DataCocsnArpTableArpEntryArpEntryAddressGetHandler interface { + Handle(DataCocsnArpTableArpEntryArpEntryAddressGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressGet creates a new http.Handler for the data cocsn arp table arp entry arp entry address get operation +func NewDataCocsnArpTableArpEntryArpEntryAddressGet(ctx *middleware.Context, handler DataCocsnArpTableArpEntryArpEntryAddressGetHandler) *DataCocsnArpTableArpEntryArpEntryAddressGet { + return &DataCocsnArpTableArpEntryArpEntryAddressGet{Context: ctx, Handler: handler} +} + +/*DataCocsnArpTableArpEntryArpEntryAddressGet swagger:route GET /data/cocsn:arp-table/arp-entry={arp-entry-address} data get dataCocsnArpTableArpEntryArpEntryAddressGet + +DataCocsnArpTableArpEntryArpEntryAddressGet data cocsn arp table arp entry arp entry address get API + +*/ +type DataCocsnArpTableArpEntryArpEntryAddressGet struct { + Context *middleware.Context + Handler DataCocsnArpTableArpEntryArpEntryAddressGetHandler +} + +func (o *DataCocsnArpTableArpEntryArpEntryAddressGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnArpTableArpEntryArpEntryAddressGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_get_parameters.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..e7337591bade27e5cd1469c93373bdcdbca1e821 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_get_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnArpTableArpEntryArpEntryAddressGetParams creates a new DataCocsnArpTableArpEntryArpEntryAddressGetParams object +// with the default values initialized. +func NewDataCocsnArpTableArpEntryArpEntryAddressGetParams() DataCocsnArpTableArpEntryArpEntryAddressGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnArpTableArpEntryArpEntryAddressGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnArpTableArpEntryArpEntryAddressGetParams contains all the bound params for the data cocsn arp table arp entry arp entry address get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_arp_table_arp_entry_arp_entry_address_get +type DataCocsnArpTableArpEntryArpEntryAddressGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*IP address of the arp entry + Required: true + In: path + */ + ArpEntryAddress string + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnArpTableArpEntryArpEntryAddressGetParams() beforehand. +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + rArpEntryAddress, rhkArpEntryAddress, _ := route.Params.GetOK("arp-entry-address") + if err := o.bindArpEntryAddress(rArpEntryAddress, rhkArpEntryAddress, route.Formats); err != nil { + res = append(res, err) + } + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindArpEntryAddress binds and validates parameter ArpEntryAddress from path. +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetParams) bindArpEntryAddress(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.ArpEntryAddress = raw + + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnArpTableArpEntryArpEntryAddressGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnArpTableArpEntryArpEntryAddressGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_get_responses.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..fcfa7d140028f3a5f30b8ed0caaf1cd752cad4e3 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnArpTableArpEntryArpEntryAddressGetOKCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressGetOK +const DataCocsnArpTableArpEntryArpEntryAddressGetOKCode int = 200 + +/*DataCocsnArpTableArpEntryArpEntryAddressGetOK OK + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressGetOK +*/ +type DataCocsnArpTableArpEntryArpEntryAddressGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnArpTableArpEntryArpEntryAddress `json:"body,omitempty"` +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressGetOK creates DataCocsnArpTableArpEntryArpEntryAddressGetOK with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressGetOK() *DataCocsnArpTableArpEntryArpEntryAddressGetOK { + + return &DataCocsnArpTableArpEntryArpEntryAddressGetOK{} +} + +// WithPayload adds the payload to the data cocsn arp table arp entry arp entry address get o k response +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetOK) WithPayload(payload *models.DataCocsnArpTableArpEntryArpEntryAddress) *DataCocsnArpTableArpEntryArpEntryAddressGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn arp table arp entry arp entry address get o k response +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetOK) SetPayload(payload *models.DataCocsnArpTableArpEntryArpEntryAddress) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnArpTableArpEntryArpEntryAddressGetNoContentCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressGetNoContent +const DataCocsnArpTableArpEntryArpEntryAddressGetNoContentCode int = 204 + +/*DataCocsnArpTableArpEntryArpEntryAddressGetNoContent No Content + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressGetNoContent +*/ +type DataCocsnArpTableArpEntryArpEntryAddressGetNoContent struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressGetNoContent creates DataCocsnArpTableArpEntryArpEntryAddressGetNoContent with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressGetNoContent() *DataCocsnArpTableArpEntryArpEntryAddressGetNoContent { + + return &DataCocsnArpTableArpEntryArpEntryAddressGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnArpTableArpEntryArpEntryAddressGetBadRequestCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressGetBadRequest +const DataCocsnArpTableArpEntryArpEntryAddressGetBadRequestCode int = 400 + +/*DataCocsnArpTableArpEntryArpEntryAddressGetBadRequest Bad Request + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressGetBadRequest +*/ +type DataCocsnArpTableArpEntryArpEntryAddressGetBadRequest struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressGetBadRequest creates DataCocsnArpTableArpEntryArpEntryAddressGetBadRequest with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressGetBadRequest() *DataCocsnArpTableArpEntryArpEntryAddressGetBadRequest { + + return &DataCocsnArpTableArpEntryArpEntryAddressGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnArpTableArpEntryArpEntryAddressGetUnauthorizedCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressGetUnauthorized +const DataCocsnArpTableArpEntryArpEntryAddressGetUnauthorizedCode int = 401 + +/*DataCocsnArpTableArpEntryArpEntryAddressGetUnauthorized Unauthorized + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressGetUnauthorized +*/ +type DataCocsnArpTableArpEntryArpEntryAddressGetUnauthorized struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressGetUnauthorized creates DataCocsnArpTableArpEntryArpEntryAddressGetUnauthorized with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressGetUnauthorized() *DataCocsnArpTableArpEntryArpEntryAddressGetUnauthorized { + + return &DataCocsnArpTableArpEntryArpEntryAddressGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnArpTableArpEntryArpEntryAddressGetNotFoundCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressGetNotFound +const DataCocsnArpTableArpEntryArpEntryAddressGetNotFoundCode int = 404 + +/*DataCocsnArpTableArpEntryArpEntryAddressGetNotFound Not Found + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressGetNotFound +*/ +type DataCocsnArpTableArpEntryArpEntryAddressGetNotFound struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressGetNotFound creates DataCocsnArpTableArpEntryArpEntryAddressGetNotFound with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressGetNotFound() *DataCocsnArpTableArpEntryArpEntryAddressGetNotFound { + + return &DataCocsnArpTableArpEntryArpEntryAddressGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnArpTableArpEntryArpEntryAddressGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressGetMethodNotAllowed +const DataCocsnArpTableArpEntryArpEntryAddressGetMethodNotAllowedCode int = 405 + +/*DataCocsnArpTableArpEntryArpEntryAddressGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressGetMethodNotAllowed +*/ +type DataCocsnArpTableArpEntryArpEntryAddressGetMethodNotAllowed struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressGetMethodNotAllowed creates DataCocsnArpTableArpEntryArpEntryAddressGetMethodNotAllowed with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressGetMethodNotAllowed() *DataCocsnArpTableArpEntryArpEntryAddressGetMethodNotAllowed { + + return &DataCocsnArpTableArpEntryArpEntryAddressGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnArpTableArpEntryArpEntryAddressGetConflictCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressGetConflict +const DataCocsnArpTableArpEntryArpEntryAddressGetConflictCode int = 409 + +/*DataCocsnArpTableArpEntryArpEntryAddressGetConflict Conflict + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressGetConflict +*/ +type DataCocsnArpTableArpEntryArpEntryAddressGetConflict struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressGetConflict creates DataCocsnArpTableArpEntryArpEntryAddressGetConflict with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressGetConflict() *DataCocsnArpTableArpEntryArpEntryAddressGetConflict { + + return &DataCocsnArpTableArpEntryArpEntryAddressGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..c6259e84833cd20690b40659303cd09cdd9593e7 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_get_urlbuilder.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DataCocsnArpTableArpEntryArpEntryAddressGetURL generates an URL for the data cocsn arp table arp entry arp entry address get operation +type DataCocsnArpTableArpEntryArpEntryAddressGetURL struct { + ArpEntryAddress string + + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetURL) WithBasePath(bp string) *DataCocsnArpTableArpEntryArpEntryAddressGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:arp-table/arp-entry={arp-entry-address}" + + arpEntryAddress := o.ArpEntryAddress + if arpEntryAddress != "" { + _path = strings.Replace(_path, "{arp-entry-address}", arpEntryAddress, -1) + } else { + return nil, errors.New("arpEntryAddress is required on DataCocsnArpTableArpEntryArpEntryAddressGetURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnArpTableArpEntryArpEntryAddressGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnArpTableArpEntryArpEntryAddressGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnArpTableArpEntryArpEntryAddressGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_interface_get.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_interface_get.go new file mode 100644 index 0000000000000000000000000000000000000000..15b4d862f1f819204cd28d66f0bacc94b9305be2 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_interface_get.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetHandlerFunc turns a function with the right signature into a data cocsn arp table arp entry arp entry address interface get handler +type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetHandlerFunc func(DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetHandlerFunc) Handle(params DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetHandler interface for that can handle valid data cocsn arp table arp entry arp entry address interface get params +type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetHandler interface { + Handle(DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGet creates a new http.Handler for the data cocsn arp table arp entry arp entry address interface get operation +func NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGet(ctx *middleware.Context, handler DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetHandler) *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGet { + return &DataCocsnArpTableArpEntryArpEntryAddressInterfaceGet{Context: ctx, Handler: handler} +} + +/*DataCocsnArpTableArpEntryArpEntryAddressInterfaceGet swagger:route GET /data/cocsn:arp-table/arp-entry={arp-entry-address}/interface data get dataCocsnArpTableArpEntryArpEntryAddressInterfaceGet + +Interface of the arp entry + +Interface of the arp entry + +*/ +type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGet struct { + Context *middleware.Context + Handler DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetHandler +} + +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_interface_get_parameters.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_interface_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6defe0cee5a9764f8a4eac14c7030fedbe1538a6 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_interface_get_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams creates a new DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams object +// with the default values initialized. +func NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams() DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams contains all the bound params for the data cocsn arp table arp entry arp entry address interface get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_arp_table_arp_entry_arp_entry_address_interface_get +type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*IP address of the arp entry + Required: true + In: path + */ + ArpEntryAddress string + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams() beforehand. +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + rArpEntryAddress, rhkArpEntryAddress, _ := route.Params.GetOK("arp-entry-address") + if err := o.bindArpEntryAddress(rArpEntryAddress, rhkArpEntryAddress, route.Formats); err != nil { + res = append(res, err) + } + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindArpEntryAddress binds and validates parameter ArpEntryAddress from path. +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams) bindArpEntryAddress(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.ArpEntryAddress = raw + + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_interface_get_responses.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_interface_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..9b317b5ec19dfb4d90d11183eeadae84167c2ce1 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_interface_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetOKCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetOK +const DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetOKCode int = 200 + +/*DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetOK Interface of the arp entry + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressInterfaceGetOK +*/ +type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnArpTableArpEntryArpEntryAddressInterface `json:"body,omitempty"` +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetOK creates DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetOK with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetOK() *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetOK { + + return &DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetOK{} +} + +// WithPayload adds the payload to the data cocsn arp table arp entry arp entry address interface get o k response +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetOK) WithPayload(payload *models.DataCocsnArpTableArpEntryArpEntryAddressInterface) *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn arp table arp entry arp entry address interface get o k response +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetOK) SetPayload(payload *models.DataCocsnArpTableArpEntryArpEntryAddressInterface) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNoContentCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNoContent +const DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNoContentCode int = 204 + +/*DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNoContent No Content + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNoContent +*/ +type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNoContent struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNoContent creates DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNoContent with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNoContent() *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNoContent { + + return &DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetBadRequestCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetBadRequest +const DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetBadRequestCode int = 400 + +/*DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetBadRequest Bad Request + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressInterfaceGetBadRequest +*/ +type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetBadRequest struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetBadRequest creates DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetBadRequest with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetBadRequest() *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetBadRequest { + + return &DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetUnauthorizedCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetUnauthorized +const DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetUnauthorizedCode int = 401 + +/*DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetUnauthorized Unauthorized + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressInterfaceGetUnauthorized +*/ +type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetUnauthorized struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetUnauthorized creates DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetUnauthorized with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetUnauthorized() *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetUnauthorized { + + return &DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNotFoundCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNotFound +const DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNotFoundCode int = 404 + +/*DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNotFound Not Found + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNotFound +*/ +type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNotFound struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNotFound creates DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNotFound with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNotFound() *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNotFound { + + return &DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetMethodNotAllowed +const DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetMethodNotAllowedCode int = 405 + +/*DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressInterfaceGetMethodNotAllowed +*/ +type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetMethodNotAllowed struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetMethodNotAllowed creates DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetMethodNotAllowed with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetMethodNotAllowed() *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetMethodNotAllowed { + + return &DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetConflictCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetConflict +const DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetConflictCode int = 409 + +/*DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetConflict Conflict + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressInterfaceGetConflict +*/ +type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetConflict struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetConflict creates DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetConflict with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressInterfaceGetConflict() *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetConflict { + + return &DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_interface_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_interface_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..b4d1ab4ae6ab9b3d66bf398ba706267e156df24e --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_interface_get_urlbuilder.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetURL generates an URL for the data cocsn arp table arp entry arp entry address interface get operation +type DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetURL struct { + ArpEntryAddress string + + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetURL) WithBasePath(bp string) *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:arp-table/arp-entry={arp-entry-address}/interface" + + arpEntryAddress := o.ArpEntryAddress + if arpEntryAddress != "" { + _path = strings.Replace(_path, "{arp-entry-address}", arpEntryAddress, -1) + } else { + return nil, errors.New("arpEntryAddress is required on DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnArpTableArpEntryArpEntryAddressInterfaceGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address_get.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address_get.go new file mode 100644 index 0000000000000000000000000000000000000000..8ae7f6e13966e79b82f64b0f13907c589009dbf9 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address_get.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetHandlerFunc turns a function with the right signature into a data cocsn arp table arp entry arp entry address phs address get handler +type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetHandlerFunc func(DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetHandlerFunc) Handle(params DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetHandler interface for that can handle valid data cocsn arp table arp entry arp entry address phs address get params +type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetHandler interface { + Handle(DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGet creates a new http.Handler for the data cocsn arp table arp entry arp entry address phs address get operation +func NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGet(ctx *middleware.Context, handler DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetHandler) *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGet { + return &DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGet{Context: ctx, Handler: handler} +} + +/*DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGet swagger:route GET /data/cocsn:arp-table/arp-entry={arp-entry-address}/phs-address data get dataCocsnArpTableArpEntryArpEntryAddressPhsAddressGet + +MAC address of the arp entry + +MAC address of the arp entry + +*/ +type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGet struct { + Context *middleware.Context + Handler DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetHandler +} + +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address_get_parameters.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..62cdcc17bada3909e3d67fb259a54427f761c765 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address_get_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams creates a new DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams object +// with the default values initialized. +func NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams() DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams contains all the bound params for the data cocsn arp table arp entry arp entry address phs address get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address_get +type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*IP address of the arp entry + Required: true + In: path + */ + ArpEntryAddress string + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams() beforehand. +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + rArpEntryAddress, rhkArpEntryAddress, _ := route.Params.GetOK("arp-entry-address") + if err := o.bindArpEntryAddress(rArpEntryAddress, rhkArpEntryAddress, route.Formats); err != nil { + res = append(res, err) + } + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindArpEntryAddress binds and validates parameter ArpEntryAddress from path. +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams) bindArpEntryAddress(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.ArpEntryAddress = raw + + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address_get_responses.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..0413b772745e1af398ba16c0eb9a92fdc4981a6f --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetOKCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetOK +const DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetOKCode int = 200 + +/*DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetOK MAC address of the arp entry + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetOK +*/ +type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnArpTableArpEntryArpEntryAddressPhsAddress `json:"body,omitempty"` +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetOK creates DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetOK with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetOK() *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetOK { + + return &DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetOK{} +} + +// WithPayload adds the payload to the data cocsn arp table arp entry arp entry address phs address get o k response +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetOK) WithPayload(payload *models.DataCocsnArpTableArpEntryArpEntryAddressPhsAddress) *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn arp table arp entry arp entry address phs address get o k response +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetOK) SetPayload(payload *models.DataCocsnArpTableArpEntryArpEntryAddressPhsAddress) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNoContentCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNoContent +const DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNoContentCode int = 204 + +/*DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNoContent No Content + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNoContent +*/ +type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNoContent struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNoContent creates DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNoContent with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNoContent() *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNoContent { + + return &DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetBadRequestCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetBadRequest +const DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetBadRequestCode int = 400 + +/*DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetBadRequest Bad Request + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetBadRequest +*/ +type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetBadRequest struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetBadRequest creates DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetBadRequest with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetBadRequest() *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetBadRequest { + + return &DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetUnauthorizedCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetUnauthorized +const DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetUnauthorizedCode int = 401 + +/*DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetUnauthorized Unauthorized + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetUnauthorized +*/ +type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetUnauthorized struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetUnauthorized creates DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetUnauthorized with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetUnauthorized() *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetUnauthorized { + + return &DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNotFoundCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNotFound +const DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNotFoundCode int = 404 + +/*DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNotFound Not Found + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNotFound +*/ +type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNotFound struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNotFound creates DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNotFound with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNotFound() *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNotFound { + + return &DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetMethodNotAllowed +const DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetMethodNotAllowedCode int = 405 + +/*DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetMethodNotAllowed +*/ +type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetMethodNotAllowed struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetMethodNotAllowed creates DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetMethodNotAllowed with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetMethodNotAllowed() *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetMethodNotAllowed { + + return &DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetConflictCode is the HTTP code returned for type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetConflict +const DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetConflictCode int = 409 + +/*DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetConflict Conflict + +swagger:response dataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetConflict +*/ +type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetConflict struct { +} + +// NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetConflict creates DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetConflict with default headers values +func NewDataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetConflict() *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetConflict { + + return &DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..bf86a428d0093c91ce3165718fb255d48cf49199 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address_get_urlbuilder.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetURL generates an URL for the data cocsn arp table arp entry arp entry address phs address get operation +type DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetURL struct { + ArpEntryAddress string + + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetURL) WithBasePath(bp string) *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:arp-table/arp-entry={arp-entry-address}/phs-address" + + arpEntryAddress := o.ArpEntryAddress + if arpEntryAddress != "" { + _path = strings.Replace(_path, "{arp-entry-address}", arpEntryAddress, -1) + } else { + return nil, errors.New("arpEntryAddress is required on DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnArpTableArpEntryArpEntryAddressPhsAddressGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_get.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_get.go new file mode 100644 index 0000000000000000000000000000000000000000..3ebefbf8207bc993e4e91f9c1be9886a22c22d8c --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_get.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnArpTableArpEntryGetHandlerFunc turns a function with the right signature into a data cocsn arp table arp entry get handler +type DataCocsnArpTableArpEntryGetHandlerFunc func(DataCocsnArpTableArpEntryGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnArpTableArpEntryGetHandlerFunc) Handle(params DataCocsnArpTableArpEntryGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnArpTableArpEntryGetHandler interface for that can handle valid data cocsn arp table arp entry get params +type DataCocsnArpTableArpEntryGetHandler interface { + Handle(DataCocsnArpTableArpEntryGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnArpTableArpEntryGet creates a new http.Handler for the data cocsn arp table arp entry get operation +func NewDataCocsnArpTableArpEntryGet(ctx *middleware.Context, handler DataCocsnArpTableArpEntryGetHandler) *DataCocsnArpTableArpEntryGet { + return &DataCocsnArpTableArpEntryGet{Context: ctx, Handler: handler} +} + +/*DataCocsnArpTableArpEntryGet swagger:route GET /data/cocsn:arp-table/arp-entry data get dataCocsnArpTableArpEntryGet + +DataCocsnArpTableArpEntryGet data cocsn arp table arp entry get API + +*/ +type DataCocsnArpTableArpEntryGet struct { + Context *middleware.Context + Handler DataCocsnArpTableArpEntryGetHandler +} + +func (o *DataCocsnArpTableArpEntryGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnArpTableArpEntryGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_get_parameters.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..3646fcda0085e6a4f507a834b61860580f4ec153 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_get_parameters.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnArpTableArpEntryGetParams creates a new DataCocsnArpTableArpEntryGetParams object +// with the default values initialized. +func NewDataCocsnArpTableArpEntryGetParams() DataCocsnArpTableArpEntryGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnArpTableArpEntryGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnArpTableArpEntryGetParams contains all the bound params for the data cocsn arp table arp entry get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_arp_table_arp_entry_get +type DataCocsnArpTableArpEntryGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnArpTableArpEntryGetParams() beforehand. +func (o *DataCocsnArpTableArpEntryGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnArpTableArpEntryGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnArpTableArpEntryGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnArpTableArpEntryGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnArpTableArpEntryGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnArpTableArpEntryGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnArpTableArpEntryGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnArpTableArpEntryGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnArpTableArpEntryGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnArpTableArpEntryGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_get_responses.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..6629503d79d6f7dde99cdf5c422ed3f9d37b50e3 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnArpTableArpEntryGetOKCode is the HTTP code returned for type DataCocsnArpTableArpEntryGetOK +const DataCocsnArpTableArpEntryGetOKCode int = 200 + +/*DataCocsnArpTableArpEntryGetOK OK + +swagger:response dataCocsnArpTableArpEntryGetOK +*/ +type DataCocsnArpTableArpEntryGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnArpTableArpEntry `json:"body,omitempty"` +} + +// NewDataCocsnArpTableArpEntryGetOK creates DataCocsnArpTableArpEntryGetOK with default headers values +func NewDataCocsnArpTableArpEntryGetOK() *DataCocsnArpTableArpEntryGetOK { + + return &DataCocsnArpTableArpEntryGetOK{} +} + +// WithPayload adds the payload to the data cocsn arp table arp entry get o k response +func (o *DataCocsnArpTableArpEntryGetOK) WithPayload(payload *models.DataCocsnArpTableArpEntry) *DataCocsnArpTableArpEntryGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn arp table arp entry get o k response +func (o *DataCocsnArpTableArpEntryGetOK) SetPayload(payload *models.DataCocsnArpTableArpEntry) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnArpTableArpEntryGetNoContentCode is the HTTP code returned for type DataCocsnArpTableArpEntryGetNoContent +const DataCocsnArpTableArpEntryGetNoContentCode int = 204 + +/*DataCocsnArpTableArpEntryGetNoContent No Content + +swagger:response dataCocsnArpTableArpEntryGetNoContent +*/ +type DataCocsnArpTableArpEntryGetNoContent struct { +} + +// NewDataCocsnArpTableArpEntryGetNoContent creates DataCocsnArpTableArpEntryGetNoContent with default headers values +func NewDataCocsnArpTableArpEntryGetNoContent() *DataCocsnArpTableArpEntryGetNoContent { + + return &DataCocsnArpTableArpEntryGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnArpTableArpEntryGetBadRequestCode is the HTTP code returned for type DataCocsnArpTableArpEntryGetBadRequest +const DataCocsnArpTableArpEntryGetBadRequestCode int = 400 + +/*DataCocsnArpTableArpEntryGetBadRequest Bad Request + +swagger:response dataCocsnArpTableArpEntryGetBadRequest +*/ +type DataCocsnArpTableArpEntryGetBadRequest struct { +} + +// NewDataCocsnArpTableArpEntryGetBadRequest creates DataCocsnArpTableArpEntryGetBadRequest with default headers values +func NewDataCocsnArpTableArpEntryGetBadRequest() *DataCocsnArpTableArpEntryGetBadRequest { + + return &DataCocsnArpTableArpEntryGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnArpTableArpEntryGetUnauthorizedCode is the HTTP code returned for type DataCocsnArpTableArpEntryGetUnauthorized +const DataCocsnArpTableArpEntryGetUnauthorizedCode int = 401 + +/*DataCocsnArpTableArpEntryGetUnauthorized Unauthorized + +swagger:response dataCocsnArpTableArpEntryGetUnauthorized +*/ +type DataCocsnArpTableArpEntryGetUnauthorized struct { +} + +// NewDataCocsnArpTableArpEntryGetUnauthorized creates DataCocsnArpTableArpEntryGetUnauthorized with default headers values +func NewDataCocsnArpTableArpEntryGetUnauthorized() *DataCocsnArpTableArpEntryGetUnauthorized { + + return &DataCocsnArpTableArpEntryGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnArpTableArpEntryGetNotFoundCode is the HTTP code returned for type DataCocsnArpTableArpEntryGetNotFound +const DataCocsnArpTableArpEntryGetNotFoundCode int = 404 + +/*DataCocsnArpTableArpEntryGetNotFound Not Found + +swagger:response dataCocsnArpTableArpEntryGetNotFound +*/ +type DataCocsnArpTableArpEntryGetNotFound struct { +} + +// NewDataCocsnArpTableArpEntryGetNotFound creates DataCocsnArpTableArpEntryGetNotFound with default headers values +func NewDataCocsnArpTableArpEntryGetNotFound() *DataCocsnArpTableArpEntryGetNotFound { + + return &DataCocsnArpTableArpEntryGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnArpTableArpEntryGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnArpTableArpEntryGetMethodNotAllowed +const DataCocsnArpTableArpEntryGetMethodNotAllowedCode int = 405 + +/*DataCocsnArpTableArpEntryGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnArpTableArpEntryGetMethodNotAllowed +*/ +type DataCocsnArpTableArpEntryGetMethodNotAllowed struct { +} + +// NewDataCocsnArpTableArpEntryGetMethodNotAllowed creates DataCocsnArpTableArpEntryGetMethodNotAllowed with default headers values +func NewDataCocsnArpTableArpEntryGetMethodNotAllowed() *DataCocsnArpTableArpEntryGetMethodNotAllowed { + + return &DataCocsnArpTableArpEntryGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnArpTableArpEntryGetConflictCode is the HTTP code returned for type DataCocsnArpTableArpEntryGetConflict +const DataCocsnArpTableArpEntryGetConflictCode int = 409 + +/*DataCocsnArpTableArpEntryGetConflict Conflict + +swagger:response dataCocsnArpTableArpEntryGetConflict +*/ +type DataCocsnArpTableArpEntryGetConflict struct { +} + +// NewDataCocsnArpTableArpEntryGetConflict creates DataCocsnArpTableArpEntryGetConflict with default headers values +func NewDataCocsnArpTableArpEntryGetConflict() *DataCocsnArpTableArpEntryGetConflict { + + return &DataCocsnArpTableArpEntryGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableArpEntryGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..c03e5b3826441e963d85fe197956bcb18dcc10b1 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_arp_entry_get_urlbuilder.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// DataCocsnArpTableArpEntryGetURL generates an URL for the data cocsn arp table arp entry get operation +type DataCocsnArpTableArpEntryGetURL struct { + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTableArpEntryGetURL) WithBasePath(bp string) *DataCocsnArpTableArpEntryGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTableArpEntryGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnArpTableArpEntryGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:arp-table/arp-entry" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnArpTableArpEntryGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnArpTableArpEntryGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnArpTableArpEntryGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnArpTableArpEntryGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnArpTableArpEntryGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnArpTableArpEntryGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_delete.go b/api/restapi/operations/data/data_cocsn_arp_table_delete.go new file mode 100644 index 0000000000000000000000000000000000000000..a1f2d1adf0a0a5647a585a1048f2ee3da2022db3 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_delete.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnArpTableDeleteHandlerFunc turns a function with the right signature into a data cocsn arp table delete handler +type DataCocsnArpTableDeleteHandlerFunc func(DataCocsnArpTableDeleteParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnArpTableDeleteHandlerFunc) Handle(params DataCocsnArpTableDeleteParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnArpTableDeleteHandler interface for that can handle valid data cocsn arp table delete params +type DataCocsnArpTableDeleteHandler interface { + Handle(DataCocsnArpTableDeleteParams, interface{}) middleware.Responder +} + +// NewDataCocsnArpTableDelete creates a new http.Handler for the data cocsn arp table delete operation +func NewDataCocsnArpTableDelete(ctx *middleware.Context, handler DataCocsnArpTableDeleteHandler) *DataCocsnArpTableDelete { + return &DataCocsnArpTableDelete{Context: ctx, Handler: handler} +} + +/*DataCocsnArpTableDelete swagger:route DELETE /data/cocsn:arp-table data delete dataCocsnArpTableDelete + +DataCocsnArpTableDelete data cocsn arp table delete API + +*/ +type DataCocsnArpTableDelete struct { + Context *middleware.Context + Handler DataCocsnArpTableDeleteHandler +} + +func (o *DataCocsnArpTableDelete) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnArpTableDeleteParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_delete_parameters.go b/api/restapi/operations/data/data_cocsn_arp_table_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6cc8aef6b0c5b1718498ae0b60664e5401953baf --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_delete_parameters.go @@ -0,0 +1,45 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewDataCocsnArpTableDeleteParams creates a new DataCocsnArpTableDeleteParams object +// no default values defined in spec. +func NewDataCocsnArpTableDeleteParams() DataCocsnArpTableDeleteParams { + + return DataCocsnArpTableDeleteParams{} +} + +// DataCocsnArpTableDeleteParams contains all the bound params for the data cocsn arp table delete operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_arp_table_delete +type DataCocsnArpTableDeleteParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnArpTableDeleteParams() beforehand. +func (o *DataCocsnArpTableDeleteParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_delete_responses.go b/api/restapi/operations/data/data_cocsn_arp_table_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..eabace5935a525eaa789f1285c7e3e552fe86fd2 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_delete_responses.go @@ -0,0 +1,36 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DataCocsnArpTableDeleteNoContentCode is the HTTP code returned for type DataCocsnArpTableDeleteNoContent +const DataCocsnArpTableDeleteNoContentCode int = 204 + +/*DataCocsnArpTableDeleteNoContent No Content + +swagger:response dataCocsnArpTableDeleteNoContent +*/ +type DataCocsnArpTableDeleteNoContent struct { +} + +// NewDataCocsnArpTableDeleteNoContent creates DataCocsnArpTableDeleteNoContent with default headers values +func NewDataCocsnArpTableDeleteNoContent() *DataCocsnArpTableDeleteNoContent { + + return &DataCocsnArpTableDeleteNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableDeleteNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_delete_urlbuilder.go b/api/restapi/operations/data/data_cocsn_arp_table_delete_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..97d9492fadc5b7db7990e28695c44b9e8e36a314 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_delete_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// DataCocsnArpTableDeleteURL generates an URL for the data cocsn arp table delete operation +type DataCocsnArpTableDeleteURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTableDeleteURL) WithBasePath(bp string) *DataCocsnArpTableDeleteURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTableDeleteURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnArpTableDeleteURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:arp-table" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnArpTableDeleteURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnArpTableDeleteURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnArpTableDeleteURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnArpTableDeleteURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnArpTableDeleteURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnArpTableDeleteURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_get.go b/api/restapi/operations/data/data_cocsn_arp_table_get.go new file mode 100644 index 0000000000000000000000000000000000000000..dd06581906e78318fa52eedf0fd2302643e3e313 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_get.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnArpTableGetHandlerFunc turns a function with the right signature into a data cocsn arp table get handler +type DataCocsnArpTableGetHandlerFunc func(DataCocsnArpTableGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnArpTableGetHandlerFunc) Handle(params DataCocsnArpTableGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnArpTableGetHandler interface for that can handle valid data cocsn arp table get params +type DataCocsnArpTableGetHandler interface { + Handle(DataCocsnArpTableGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnArpTableGet creates a new http.Handler for the data cocsn arp table get operation +func NewDataCocsnArpTableGet(ctx *middleware.Context, handler DataCocsnArpTableGetHandler) *DataCocsnArpTableGet { + return &DataCocsnArpTableGet{Context: ctx, Handler: handler} +} + +/*DataCocsnArpTableGet swagger:route GET /data/cocsn:arp-table data get dataCocsnArpTableGet + +DataCocsnArpTableGet data cocsn arp table get API + +*/ +type DataCocsnArpTableGet struct { + Context *middleware.Context + Handler DataCocsnArpTableGetHandler +} + +func (o *DataCocsnArpTableGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnArpTableGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_get_parameters.go b/api/restapi/operations/data/data_cocsn_arp_table_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6ebae175ac67907069b0d3d03a17ef2a2670e055 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_get_parameters.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnArpTableGetParams creates a new DataCocsnArpTableGetParams object +// with the default values initialized. +func NewDataCocsnArpTableGetParams() DataCocsnArpTableGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnArpTableGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnArpTableGetParams contains all the bound params for the data cocsn arp table get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_arp_table_get +type DataCocsnArpTableGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnArpTableGetParams() beforehand. +func (o *DataCocsnArpTableGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnArpTableGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnArpTableGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnArpTableGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnArpTableGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnArpTableGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnArpTableGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnArpTableGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnArpTableGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnArpTableGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_get_responses.go b/api/restapi/operations/data/data_cocsn_arp_table_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..52906005c1a37300d6384ca308a344e642e36297 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnArpTableGetOKCode is the HTTP code returned for type DataCocsnArpTableGetOK +const DataCocsnArpTableGetOKCode int = 200 + +/*DataCocsnArpTableGetOK OK + +swagger:response dataCocsnArpTableGetOK +*/ +type DataCocsnArpTableGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnArpTable `json:"body,omitempty"` +} + +// NewDataCocsnArpTableGetOK creates DataCocsnArpTableGetOK with default headers values +func NewDataCocsnArpTableGetOK() *DataCocsnArpTableGetOK { + + return &DataCocsnArpTableGetOK{} +} + +// WithPayload adds the payload to the data cocsn arp table get o k response +func (o *DataCocsnArpTableGetOK) WithPayload(payload *models.DataCocsnArpTable) *DataCocsnArpTableGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn arp table get o k response +func (o *DataCocsnArpTableGetOK) SetPayload(payload *models.DataCocsnArpTable) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnArpTableGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnArpTableGetNoContentCode is the HTTP code returned for type DataCocsnArpTableGetNoContent +const DataCocsnArpTableGetNoContentCode int = 204 + +/*DataCocsnArpTableGetNoContent No Content + +swagger:response dataCocsnArpTableGetNoContent +*/ +type DataCocsnArpTableGetNoContent struct { +} + +// NewDataCocsnArpTableGetNoContent creates DataCocsnArpTableGetNoContent with default headers values +func NewDataCocsnArpTableGetNoContent() *DataCocsnArpTableGetNoContent { + + return &DataCocsnArpTableGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnArpTableGetBadRequestCode is the HTTP code returned for type DataCocsnArpTableGetBadRequest +const DataCocsnArpTableGetBadRequestCode int = 400 + +/*DataCocsnArpTableGetBadRequest Bad Request + +swagger:response dataCocsnArpTableGetBadRequest +*/ +type DataCocsnArpTableGetBadRequest struct { +} + +// NewDataCocsnArpTableGetBadRequest creates DataCocsnArpTableGetBadRequest with default headers values +func NewDataCocsnArpTableGetBadRequest() *DataCocsnArpTableGetBadRequest { + + return &DataCocsnArpTableGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnArpTableGetUnauthorizedCode is the HTTP code returned for type DataCocsnArpTableGetUnauthorized +const DataCocsnArpTableGetUnauthorizedCode int = 401 + +/*DataCocsnArpTableGetUnauthorized Unauthorized + +swagger:response dataCocsnArpTableGetUnauthorized +*/ +type DataCocsnArpTableGetUnauthorized struct { +} + +// NewDataCocsnArpTableGetUnauthorized creates DataCocsnArpTableGetUnauthorized with default headers values +func NewDataCocsnArpTableGetUnauthorized() *DataCocsnArpTableGetUnauthorized { + + return &DataCocsnArpTableGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnArpTableGetNotFoundCode is the HTTP code returned for type DataCocsnArpTableGetNotFound +const DataCocsnArpTableGetNotFoundCode int = 404 + +/*DataCocsnArpTableGetNotFound Not Found + +swagger:response dataCocsnArpTableGetNotFound +*/ +type DataCocsnArpTableGetNotFound struct { +} + +// NewDataCocsnArpTableGetNotFound creates DataCocsnArpTableGetNotFound with default headers values +func NewDataCocsnArpTableGetNotFound() *DataCocsnArpTableGetNotFound { + + return &DataCocsnArpTableGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnArpTableGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnArpTableGetMethodNotAllowed +const DataCocsnArpTableGetMethodNotAllowedCode int = 405 + +/*DataCocsnArpTableGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnArpTableGetMethodNotAllowed +*/ +type DataCocsnArpTableGetMethodNotAllowed struct { +} + +// NewDataCocsnArpTableGetMethodNotAllowed creates DataCocsnArpTableGetMethodNotAllowed with default headers values +func NewDataCocsnArpTableGetMethodNotAllowed() *DataCocsnArpTableGetMethodNotAllowed { + + return &DataCocsnArpTableGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnArpTableGetConflictCode is the HTTP code returned for type DataCocsnArpTableGetConflict +const DataCocsnArpTableGetConflictCode int = 409 + +/*DataCocsnArpTableGetConflict Conflict + +swagger:response dataCocsnArpTableGetConflict +*/ +type DataCocsnArpTableGetConflict struct { +} + +// NewDataCocsnArpTableGetConflict creates DataCocsnArpTableGetConflict with default headers values +func NewDataCocsnArpTableGetConflict() *DataCocsnArpTableGetConflict { + + return &DataCocsnArpTableGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTableGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_arp_table_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..275b266693b6310f67746b43eef499de8a38ab94 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_get_urlbuilder.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// DataCocsnArpTableGetURL generates an URL for the data cocsn arp table get operation +type DataCocsnArpTableGetURL struct { + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTableGetURL) WithBasePath(bp string) *DataCocsnArpTableGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTableGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnArpTableGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:arp-table" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnArpTableGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnArpTableGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnArpTableGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnArpTableGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnArpTableGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnArpTableGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_patch.go b/api/restapi/operations/data/data_cocsn_arp_table_patch.go new file mode 100644 index 0000000000000000000000000000000000000000..7dfe4b85068eef5d11852151b15e24c5e20ec9ec --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_patch.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnArpTablePatchHandlerFunc turns a function with the right signature into a data cocsn arp table patch handler +type DataCocsnArpTablePatchHandlerFunc func(DataCocsnArpTablePatchParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnArpTablePatchHandlerFunc) Handle(params DataCocsnArpTablePatchParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnArpTablePatchHandler interface for that can handle valid data cocsn arp table patch params +type DataCocsnArpTablePatchHandler interface { + Handle(DataCocsnArpTablePatchParams, interface{}) middleware.Responder +} + +// NewDataCocsnArpTablePatch creates a new http.Handler for the data cocsn arp table patch operation +func NewDataCocsnArpTablePatch(ctx *middleware.Context, handler DataCocsnArpTablePatchHandler) *DataCocsnArpTablePatch { + return &DataCocsnArpTablePatch{Context: ctx, Handler: handler} +} + +/*DataCocsnArpTablePatch swagger:route PATCH /data/cocsn:arp-table data patch dataCocsnArpTablePatch + +DataCocsnArpTablePatch data cocsn arp table patch API + +*/ +type DataCocsnArpTablePatch struct { + Context *middleware.Context + Handler DataCocsnArpTablePatchHandler +} + +func (o *DataCocsnArpTablePatch) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnArpTablePatchParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_patch_parameters.go b/api/restapi/operations/data/data_cocsn_arp_table_patch_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..af2fe00335110ec571beafa0f8116fd2f8a8c5ca --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_patch_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// NewDataCocsnArpTablePatchParams creates a new DataCocsnArpTablePatchParams object +// no default values defined in spec. +func NewDataCocsnArpTablePatchParams() DataCocsnArpTablePatchParams { + + return DataCocsnArpTablePatchParams{} +} + +// DataCocsnArpTablePatchParams contains all the bound params for the data cocsn arp table patch operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_arp_table_patch +type DataCocsnArpTablePatchParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + ArpTable *models.DataCocsnArpTable +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnArpTablePatchParams() beforehand. +func (o *DataCocsnArpTablePatchParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.DataCocsnArpTable + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("arpTable", "body", "")) + } else { + res = append(res, errors.NewParseError("arpTable", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.ArpTable = &body + } + } + } else { + res = append(res, errors.Required("arpTable", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_patch_responses.go b/api/restapi/operations/data/data_cocsn_arp_table_patch_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..85851de26d037ff44147cebed1ba8dc7d09b04d1 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_patch_responses.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DataCocsnArpTablePatchNoContentCode is the HTTP code returned for type DataCocsnArpTablePatchNoContent +const DataCocsnArpTablePatchNoContentCode int = 204 + +/*DataCocsnArpTablePatchNoContent container arp-table updated + +swagger:response dataCocsnArpTablePatchNoContent +*/ +type DataCocsnArpTablePatchNoContent struct { +} + +// NewDataCocsnArpTablePatchNoContent creates DataCocsnArpTablePatchNoContent with default headers values +func NewDataCocsnArpTablePatchNoContent() *DataCocsnArpTablePatchNoContent { + + return &DataCocsnArpTablePatchNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePatchNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnArpTablePatchBadRequestCode is the HTTP code returned for type DataCocsnArpTablePatchBadRequest +const DataCocsnArpTablePatchBadRequestCode int = 400 + +/*DataCocsnArpTablePatchBadRequest Bad Request + +swagger:response dataCocsnArpTablePatchBadRequest +*/ +type DataCocsnArpTablePatchBadRequest struct { +} + +// NewDataCocsnArpTablePatchBadRequest creates DataCocsnArpTablePatchBadRequest with default headers values +func NewDataCocsnArpTablePatchBadRequest() *DataCocsnArpTablePatchBadRequest { + + return &DataCocsnArpTablePatchBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePatchBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnArpTablePatchUnauthorizedCode is the HTTP code returned for type DataCocsnArpTablePatchUnauthorized +const DataCocsnArpTablePatchUnauthorizedCode int = 401 + +/*DataCocsnArpTablePatchUnauthorized Unauthorized + +swagger:response dataCocsnArpTablePatchUnauthorized +*/ +type DataCocsnArpTablePatchUnauthorized struct { +} + +// NewDataCocsnArpTablePatchUnauthorized creates DataCocsnArpTablePatchUnauthorized with default headers values +func NewDataCocsnArpTablePatchUnauthorized() *DataCocsnArpTablePatchUnauthorized { + + return &DataCocsnArpTablePatchUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePatchUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnArpTablePatchNotFoundCode is the HTTP code returned for type DataCocsnArpTablePatchNotFound +const DataCocsnArpTablePatchNotFoundCode int = 404 + +/*DataCocsnArpTablePatchNotFound Not Found + +swagger:response dataCocsnArpTablePatchNotFound +*/ +type DataCocsnArpTablePatchNotFound struct { +} + +// NewDataCocsnArpTablePatchNotFound creates DataCocsnArpTablePatchNotFound with default headers values +func NewDataCocsnArpTablePatchNotFound() *DataCocsnArpTablePatchNotFound { + + return &DataCocsnArpTablePatchNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePatchNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnArpTablePatchMethodNotAllowedCode is the HTTP code returned for type DataCocsnArpTablePatchMethodNotAllowed +const DataCocsnArpTablePatchMethodNotAllowedCode int = 405 + +/*DataCocsnArpTablePatchMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnArpTablePatchMethodNotAllowed +*/ +type DataCocsnArpTablePatchMethodNotAllowed struct { +} + +// NewDataCocsnArpTablePatchMethodNotAllowed creates DataCocsnArpTablePatchMethodNotAllowed with default headers values +func NewDataCocsnArpTablePatchMethodNotAllowed() *DataCocsnArpTablePatchMethodNotAllowed { + + return &DataCocsnArpTablePatchMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePatchMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnArpTablePatchConflictCode is the HTTP code returned for type DataCocsnArpTablePatchConflict +const DataCocsnArpTablePatchConflictCode int = 409 + +/*DataCocsnArpTablePatchConflict Conflict + +swagger:response dataCocsnArpTablePatchConflict +*/ +type DataCocsnArpTablePatchConflict struct { +} + +// NewDataCocsnArpTablePatchConflict creates DataCocsnArpTablePatchConflict with default headers values +func NewDataCocsnArpTablePatchConflict() *DataCocsnArpTablePatchConflict { + + return &DataCocsnArpTablePatchConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePatchConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_patch_urlbuilder.go b/api/restapi/operations/data/data_cocsn_arp_table_patch_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..ba660c95549b6acccac9dfc6c4db96908edb9cca --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_patch_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// DataCocsnArpTablePatchURL generates an URL for the data cocsn arp table patch operation +type DataCocsnArpTablePatchURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTablePatchURL) WithBasePath(bp string) *DataCocsnArpTablePatchURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTablePatchURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnArpTablePatchURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:arp-table" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnArpTablePatchURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnArpTablePatchURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnArpTablePatchURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnArpTablePatchURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnArpTablePatchURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnArpTablePatchURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_post.go b/api/restapi/operations/data/data_cocsn_arp_table_post.go new file mode 100644 index 0000000000000000000000000000000000000000..f6420cc14267f733c21f514fba5ff315b0afe646 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_post.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnArpTablePostHandlerFunc turns a function with the right signature into a data cocsn arp table post handler +type DataCocsnArpTablePostHandlerFunc func(DataCocsnArpTablePostParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnArpTablePostHandlerFunc) Handle(params DataCocsnArpTablePostParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnArpTablePostHandler interface for that can handle valid data cocsn arp table post params +type DataCocsnArpTablePostHandler interface { + Handle(DataCocsnArpTablePostParams, interface{}) middleware.Responder +} + +// NewDataCocsnArpTablePost creates a new http.Handler for the data cocsn arp table post operation +func NewDataCocsnArpTablePost(ctx *middleware.Context, handler DataCocsnArpTablePostHandler) *DataCocsnArpTablePost { + return &DataCocsnArpTablePost{Context: ctx, Handler: handler} +} + +/*DataCocsnArpTablePost swagger:route POST /data/cocsn:arp-table data post dataCocsnArpTablePost + +DataCocsnArpTablePost data cocsn arp table post API + +*/ +type DataCocsnArpTablePost struct { + Context *middleware.Context + Handler DataCocsnArpTablePostHandler +} + +func (o *DataCocsnArpTablePost) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnArpTablePostParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_post_parameters.go b/api/restapi/operations/data/data_cocsn_arp_table_post_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..42ff3fb3af85a46dff66614072348aae339cc63e --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_post_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// NewDataCocsnArpTablePostParams creates a new DataCocsnArpTablePostParams object +// no default values defined in spec. +func NewDataCocsnArpTablePostParams() DataCocsnArpTablePostParams { + + return DataCocsnArpTablePostParams{} +} + +// DataCocsnArpTablePostParams contains all the bound params for the data cocsn arp table post operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_arp_table_post +type DataCocsnArpTablePostParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + ArpTable *models.DataCocsnArpTablePost +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnArpTablePostParams() beforehand. +func (o *DataCocsnArpTablePostParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.DataCocsnArpTablePost + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("arpTable", "body", "")) + } else { + res = append(res, errors.NewParseError("arpTable", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.ArpTable = &body + } + } + } else { + res = append(res, errors.Required("arpTable", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_post_responses.go b/api/restapi/operations/data/data_cocsn_arp_table_post_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e1a5b6269e99810dd9fbc80076c4a3ad39661d2e --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_post_responses.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DataCocsnArpTablePostCreatedCode is the HTTP code returned for type DataCocsnArpTablePostCreated +const DataCocsnArpTablePostCreatedCode int = 201 + +/*DataCocsnArpTablePostCreated container arp-table created + +swagger:response dataCocsnArpTablePostCreated +*/ +type DataCocsnArpTablePostCreated struct { +} + +// NewDataCocsnArpTablePostCreated creates DataCocsnArpTablePostCreated with default headers values +func NewDataCocsnArpTablePostCreated() *DataCocsnArpTablePostCreated { + + return &DataCocsnArpTablePostCreated{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePostCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// DataCocsnArpTablePostNoContentCode is the HTTP code returned for type DataCocsnArpTablePostNoContent +const DataCocsnArpTablePostNoContentCode int = 204 + +/*DataCocsnArpTablePostNoContent No Content + +swagger:response dataCocsnArpTablePostNoContent +*/ +type DataCocsnArpTablePostNoContent struct { +} + +// NewDataCocsnArpTablePostNoContent creates DataCocsnArpTablePostNoContent with default headers values +func NewDataCocsnArpTablePostNoContent() *DataCocsnArpTablePostNoContent { + + return &DataCocsnArpTablePostNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePostNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnArpTablePostBadRequestCode is the HTTP code returned for type DataCocsnArpTablePostBadRequest +const DataCocsnArpTablePostBadRequestCode int = 400 + +/*DataCocsnArpTablePostBadRequest Bad Request + +swagger:response dataCocsnArpTablePostBadRequest +*/ +type DataCocsnArpTablePostBadRequest struct { +} + +// NewDataCocsnArpTablePostBadRequest creates DataCocsnArpTablePostBadRequest with default headers values +func NewDataCocsnArpTablePostBadRequest() *DataCocsnArpTablePostBadRequest { + + return &DataCocsnArpTablePostBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePostBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnArpTablePostUnauthorizedCode is the HTTP code returned for type DataCocsnArpTablePostUnauthorized +const DataCocsnArpTablePostUnauthorizedCode int = 401 + +/*DataCocsnArpTablePostUnauthorized Unauthorized + +swagger:response dataCocsnArpTablePostUnauthorized +*/ +type DataCocsnArpTablePostUnauthorized struct { +} + +// NewDataCocsnArpTablePostUnauthorized creates DataCocsnArpTablePostUnauthorized with default headers values +func NewDataCocsnArpTablePostUnauthorized() *DataCocsnArpTablePostUnauthorized { + + return &DataCocsnArpTablePostUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePostUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnArpTablePostNotFoundCode is the HTTP code returned for type DataCocsnArpTablePostNotFound +const DataCocsnArpTablePostNotFoundCode int = 404 + +/*DataCocsnArpTablePostNotFound Not Found + +swagger:response dataCocsnArpTablePostNotFound +*/ +type DataCocsnArpTablePostNotFound struct { +} + +// NewDataCocsnArpTablePostNotFound creates DataCocsnArpTablePostNotFound with default headers values +func NewDataCocsnArpTablePostNotFound() *DataCocsnArpTablePostNotFound { + + return &DataCocsnArpTablePostNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePostNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnArpTablePostMethodNotAllowedCode is the HTTP code returned for type DataCocsnArpTablePostMethodNotAllowed +const DataCocsnArpTablePostMethodNotAllowedCode int = 405 + +/*DataCocsnArpTablePostMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnArpTablePostMethodNotAllowed +*/ +type DataCocsnArpTablePostMethodNotAllowed struct { +} + +// NewDataCocsnArpTablePostMethodNotAllowed creates DataCocsnArpTablePostMethodNotAllowed with default headers values +func NewDataCocsnArpTablePostMethodNotAllowed() *DataCocsnArpTablePostMethodNotAllowed { + + return &DataCocsnArpTablePostMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePostMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnArpTablePostConflictCode is the HTTP code returned for type DataCocsnArpTablePostConflict +const DataCocsnArpTablePostConflictCode int = 409 + +/*DataCocsnArpTablePostConflict Conflict + +swagger:response dataCocsnArpTablePostConflict +*/ +type DataCocsnArpTablePostConflict struct { +} + +// NewDataCocsnArpTablePostConflict creates DataCocsnArpTablePostConflict with default headers values +func NewDataCocsnArpTablePostConflict() *DataCocsnArpTablePostConflict { + + return &DataCocsnArpTablePostConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePostConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_post_urlbuilder.go b/api/restapi/operations/data/data_cocsn_arp_table_post_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..4904f4e475d9d7883cb74687d97fb50df0257186 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_post_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// DataCocsnArpTablePostURL generates an URL for the data cocsn arp table post operation +type DataCocsnArpTablePostURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTablePostURL) WithBasePath(bp string) *DataCocsnArpTablePostURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTablePostURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnArpTablePostURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:arp-table" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnArpTablePostURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnArpTablePostURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnArpTablePostURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnArpTablePostURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnArpTablePostURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnArpTablePostURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_put.go b/api/restapi/operations/data/data_cocsn_arp_table_put.go new file mode 100644 index 0000000000000000000000000000000000000000..7fe090d1c6c3529539366d3087fee8260bcb07a1 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_put.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnArpTablePutHandlerFunc turns a function with the right signature into a data cocsn arp table put handler +type DataCocsnArpTablePutHandlerFunc func(DataCocsnArpTablePutParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnArpTablePutHandlerFunc) Handle(params DataCocsnArpTablePutParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnArpTablePutHandler interface for that can handle valid data cocsn arp table put params +type DataCocsnArpTablePutHandler interface { + Handle(DataCocsnArpTablePutParams, interface{}) middleware.Responder +} + +// NewDataCocsnArpTablePut creates a new http.Handler for the data cocsn arp table put operation +func NewDataCocsnArpTablePut(ctx *middleware.Context, handler DataCocsnArpTablePutHandler) *DataCocsnArpTablePut { + return &DataCocsnArpTablePut{Context: ctx, Handler: handler} +} + +/*DataCocsnArpTablePut swagger:route PUT /data/cocsn:arp-table data put dataCocsnArpTablePut + +DataCocsnArpTablePut data cocsn arp table put API + +*/ +type DataCocsnArpTablePut struct { + Context *middleware.Context + Handler DataCocsnArpTablePutHandler +} + +func (o *DataCocsnArpTablePut) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnArpTablePutParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_put_parameters.go b/api/restapi/operations/data/data_cocsn_arp_table_put_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..1078c37aa1805e57bd1bf265afe1d4e6c9c868b0 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_put_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// NewDataCocsnArpTablePutParams creates a new DataCocsnArpTablePutParams object +// no default values defined in spec. +func NewDataCocsnArpTablePutParams() DataCocsnArpTablePutParams { + + return DataCocsnArpTablePutParams{} +} + +// DataCocsnArpTablePutParams contains all the bound params for the data cocsn arp table put operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_arp_table_put +type DataCocsnArpTablePutParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + ArpTable *models.DataCocsnArpTable +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnArpTablePutParams() beforehand. +func (o *DataCocsnArpTablePutParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.DataCocsnArpTable + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("arpTable", "body", "")) + } else { + res = append(res, errors.NewParseError("arpTable", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.ArpTable = &body + } + } + } else { + res = append(res, errors.Required("arpTable", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_put_responses.go b/api/restapi/operations/data/data_cocsn_arp_table_put_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c5478e9eb3ed1bcc97e04740db0d31464a962491 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_put_responses.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DataCocsnArpTablePutCreatedCode is the HTTP code returned for type DataCocsnArpTablePutCreated +const DataCocsnArpTablePutCreatedCode int = 201 + +/*DataCocsnArpTablePutCreated container arp-table created or replaced + +swagger:response dataCocsnArpTablePutCreated +*/ +type DataCocsnArpTablePutCreated struct { +} + +// NewDataCocsnArpTablePutCreated creates DataCocsnArpTablePutCreated with default headers values +func NewDataCocsnArpTablePutCreated() *DataCocsnArpTablePutCreated { + + return &DataCocsnArpTablePutCreated{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePutCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// DataCocsnArpTablePutNoContentCode is the HTTP code returned for type DataCocsnArpTablePutNoContent +const DataCocsnArpTablePutNoContentCode int = 204 + +/*DataCocsnArpTablePutNoContent No Content + +swagger:response dataCocsnArpTablePutNoContent +*/ +type DataCocsnArpTablePutNoContent struct { +} + +// NewDataCocsnArpTablePutNoContent creates DataCocsnArpTablePutNoContent with default headers values +func NewDataCocsnArpTablePutNoContent() *DataCocsnArpTablePutNoContent { + + return &DataCocsnArpTablePutNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePutNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnArpTablePutBadRequestCode is the HTTP code returned for type DataCocsnArpTablePutBadRequest +const DataCocsnArpTablePutBadRequestCode int = 400 + +/*DataCocsnArpTablePutBadRequest Bad Request + +swagger:response dataCocsnArpTablePutBadRequest +*/ +type DataCocsnArpTablePutBadRequest struct { +} + +// NewDataCocsnArpTablePutBadRequest creates DataCocsnArpTablePutBadRequest with default headers values +func NewDataCocsnArpTablePutBadRequest() *DataCocsnArpTablePutBadRequest { + + return &DataCocsnArpTablePutBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePutBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnArpTablePutUnauthorizedCode is the HTTP code returned for type DataCocsnArpTablePutUnauthorized +const DataCocsnArpTablePutUnauthorizedCode int = 401 + +/*DataCocsnArpTablePutUnauthorized Unauthorized + +swagger:response dataCocsnArpTablePutUnauthorized +*/ +type DataCocsnArpTablePutUnauthorized struct { +} + +// NewDataCocsnArpTablePutUnauthorized creates DataCocsnArpTablePutUnauthorized with default headers values +func NewDataCocsnArpTablePutUnauthorized() *DataCocsnArpTablePutUnauthorized { + + return &DataCocsnArpTablePutUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePutUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnArpTablePutNotFoundCode is the HTTP code returned for type DataCocsnArpTablePutNotFound +const DataCocsnArpTablePutNotFoundCode int = 404 + +/*DataCocsnArpTablePutNotFound Not Found + +swagger:response dataCocsnArpTablePutNotFound +*/ +type DataCocsnArpTablePutNotFound struct { +} + +// NewDataCocsnArpTablePutNotFound creates DataCocsnArpTablePutNotFound with default headers values +func NewDataCocsnArpTablePutNotFound() *DataCocsnArpTablePutNotFound { + + return &DataCocsnArpTablePutNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePutNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnArpTablePutMethodNotAllowedCode is the HTTP code returned for type DataCocsnArpTablePutMethodNotAllowed +const DataCocsnArpTablePutMethodNotAllowedCode int = 405 + +/*DataCocsnArpTablePutMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnArpTablePutMethodNotAllowed +*/ +type DataCocsnArpTablePutMethodNotAllowed struct { +} + +// NewDataCocsnArpTablePutMethodNotAllowed creates DataCocsnArpTablePutMethodNotAllowed with default headers values +func NewDataCocsnArpTablePutMethodNotAllowed() *DataCocsnArpTablePutMethodNotAllowed { + + return &DataCocsnArpTablePutMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePutMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnArpTablePutConflictCode is the HTTP code returned for type DataCocsnArpTablePutConflict +const DataCocsnArpTablePutConflictCode int = 409 + +/*DataCocsnArpTablePutConflict Conflict + +swagger:response dataCocsnArpTablePutConflict +*/ +type DataCocsnArpTablePutConflict struct { +} + +// NewDataCocsnArpTablePutConflict creates DataCocsnArpTablePutConflict with default headers values +func NewDataCocsnArpTablePutConflict() *DataCocsnArpTablePutConflict { + + return &DataCocsnArpTablePutConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnArpTablePutConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_arp_table_put_urlbuilder.go b/api/restapi/operations/data/data_cocsn_arp_table_put_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..335d0ea316b9c16a87905b6fd507c7be13af2953 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_arp_table_put_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// DataCocsnArpTablePutURL generates an URL for the data cocsn arp table put operation +type DataCocsnArpTablePutURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTablePutURL) WithBasePath(bp string) *DataCocsnArpTablePutURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnArpTablePutURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnArpTablePutURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:arp-table" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnArpTablePutURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnArpTablePutURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnArpTablePutURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnArpTablePutURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnArpTablePutURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnArpTablePutURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_delete.go b/api/restapi/operations/data/data_cocsn_interfaces_delete.go new file mode 100644 index 0000000000000000000000000000000000000000..4817f91ccf8cb19e02b7a8bcf94901ba56178f3a --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_delete.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnInterfacesDeleteHandlerFunc turns a function with the right signature into a data cocsn interfaces delete handler +type DataCocsnInterfacesDeleteHandlerFunc func(DataCocsnInterfacesDeleteParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnInterfacesDeleteHandlerFunc) Handle(params DataCocsnInterfacesDeleteParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnInterfacesDeleteHandler interface for that can handle valid data cocsn interfaces delete params +type DataCocsnInterfacesDeleteHandler interface { + Handle(DataCocsnInterfacesDeleteParams, interface{}) middleware.Responder +} + +// NewDataCocsnInterfacesDelete creates a new http.Handler for the data cocsn interfaces delete operation +func NewDataCocsnInterfacesDelete(ctx *middleware.Context, handler DataCocsnInterfacesDeleteHandler) *DataCocsnInterfacesDelete { + return &DataCocsnInterfacesDelete{Context: ctx, Handler: handler} +} + +/*DataCocsnInterfacesDelete swagger:route DELETE /data/cocsn:interfaces data delete dataCocsnInterfacesDelete + +DataCocsnInterfacesDelete data cocsn interfaces delete API + +*/ +type DataCocsnInterfacesDelete struct { + Context *middleware.Context + Handler DataCocsnInterfacesDeleteHandler +} + +func (o *DataCocsnInterfacesDelete) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnInterfacesDeleteParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_delete_parameters.go b/api/restapi/operations/data/data_cocsn_interfaces_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a4a53c7be5ffd072a75a219f678fb821cf3aea5d --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_delete_parameters.go @@ -0,0 +1,45 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewDataCocsnInterfacesDeleteParams creates a new DataCocsnInterfacesDeleteParams object +// no default values defined in spec. +func NewDataCocsnInterfacesDeleteParams() DataCocsnInterfacesDeleteParams { + + return DataCocsnInterfacesDeleteParams{} +} + +// DataCocsnInterfacesDeleteParams contains all the bound params for the data cocsn interfaces delete operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_interfaces_delete +type DataCocsnInterfacesDeleteParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnInterfacesDeleteParams() beforehand. +func (o *DataCocsnInterfacesDeleteParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_delete_responses.go b/api/restapi/operations/data/data_cocsn_interfaces_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b1f92dc9604c0b96ee346029ca38ac4a835bb2b8 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_delete_responses.go @@ -0,0 +1,36 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DataCocsnInterfacesDeleteNoContentCode is the HTTP code returned for type DataCocsnInterfacesDeleteNoContent +const DataCocsnInterfacesDeleteNoContentCode int = 204 + +/*DataCocsnInterfacesDeleteNoContent No Content + +swagger:response dataCocsnInterfacesDeleteNoContent +*/ +type DataCocsnInterfacesDeleteNoContent struct { +} + +// NewDataCocsnInterfacesDeleteNoContent creates DataCocsnInterfacesDeleteNoContent with default headers values +func NewDataCocsnInterfacesDeleteNoContent() *DataCocsnInterfacesDeleteNoContent { + + return &DataCocsnInterfacesDeleteNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesDeleteNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_delete_urlbuilder.go b/api/restapi/operations/data/data_cocsn_interfaces_delete_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..fa61c2f32aa4bbae4e6ecc576c5439671fecb9f8 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_delete_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// DataCocsnInterfacesDeleteURL generates an URL for the data cocsn interfaces delete operation +type DataCocsnInterfacesDeleteURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesDeleteURL) WithBasePath(bp string) *DataCocsnInterfacesDeleteURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesDeleteURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnInterfacesDeleteURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:interfaces" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnInterfacesDeleteURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnInterfacesDeleteURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnInterfacesDeleteURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnInterfacesDeleteURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnInterfacesDeleteURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnInterfacesDeleteURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_get.go b/api/restapi/operations/data/data_cocsn_interfaces_get.go new file mode 100644 index 0000000000000000000000000000000000000000..afe6c7ec5164203f8499aa8d96f4e94208f69e5d --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_get.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnInterfacesGetHandlerFunc turns a function with the right signature into a data cocsn interfaces get handler +type DataCocsnInterfacesGetHandlerFunc func(DataCocsnInterfacesGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnInterfacesGetHandlerFunc) Handle(params DataCocsnInterfacesGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnInterfacesGetHandler interface for that can handle valid data cocsn interfaces get params +type DataCocsnInterfacesGetHandler interface { + Handle(DataCocsnInterfacesGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnInterfacesGet creates a new http.Handler for the data cocsn interfaces get operation +func NewDataCocsnInterfacesGet(ctx *middleware.Context, handler DataCocsnInterfacesGetHandler) *DataCocsnInterfacesGet { + return &DataCocsnInterfacesGet{Context: ctx, Handler: handler} +} + +/*DataCocsnInterfacesGet swagger:route GET /data/cocsn:interfaces data get dataCocsnInterfacesGet + +DataCocsnInterfacesGet data cocsn interfaces get API + +*/ +type DataCocsnInterfacesGet struct { + Context *middleware.Context + Handler DataCocsnInterfacesGetHandler +} + +func (o *DataCocsnInterfacesGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnInterfacesGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_get_parameters.go b/api/restapi/operations/data/data_cocsn_interfaces_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..58a17b37e84786338998041f781551178599a863 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_get_parameters.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnInterfacesGetParams creates a new DataCocsnInterfacesGetParams object +// with the default values initialized. +func NewDataCocsnInterfacesGetParams() DataCocsnInterfacesGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnInterfacesGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnInterfacesGetParams contains all the bound params for the data cocsn interfaces get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_interfaces_get +type DataCocsnInterfacesGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnInterfacesGetParams() beforehand. +func (o *DataCocsnInterfacesGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnInterfacesGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnInterfacesGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnInterfacesGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnInterfacesGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnInterfacesGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnInterfacesGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnInterfacesGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnInterfacesGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnInterfacesGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_get_responses.go b/api/restapi/operations/data/data_cocsn_interfaces_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..47a12c8d305643b3eb4782d2b57bc62d6032c2ab --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnInterfacesGetOKCode is the HTTP code returned for type DataCocsnInterfacesGetOK +const DataCocsnInterfacesGetOKCode int = 200 + +/*DataCocsnInterfacesGetOK OK + +swagger:response dataCocsnInterfacesGetOK +*/ +type DataCocsnInterfacesGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnInterfaces `json:"body,omitempty"` +} + +// NewDataCocsnInterfacesGetOK creates DataCocsnInterfacesGetOK with default headers values +func NewDataCocsnInterfacesGetOK() *DataCocsnInterfacesGetOK { + + return &DataCocsnInterfacesGetOK{} +} + +// WithPayload adds the payload to the data cocsn interfaces get o k response +func (o *DataCocsnInterfacesGetOK) WithPayload(payload *models.DataCocsnInterfaces) *DataCocsnInterfacesGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn interfaces get o k response +func (o *DataCocsnInterfacesGetOK) SetPayload(payload *models.DataCocsnInterfaces) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnInterfacesGetNoContentCode is the HTTP code returned for type DataCocsnInterfacesGetNoContent +const DataCocsnInterfacesGetNoContentCode int = 204 + +/*DataCocsnInterfacesGetNoContent No Content + +swagger:response dataCocsnInterfacesGetNoContent +*/ +type DataCocsnInterfacesGetNoContent struct { +} + +// NewDataCocsnInterfacesGetNoContent creates DataCocsnInterfacesGetNoContent with default headers values +func NewDataCocsnInterfacesGetNoContent() *DataCocsnInterfacesGetNoContent { + + return &DataCocsnInterfacesGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnInterfacesGetBadRequestCode is the HTTP code returned for type DataCocsnInterfacesGetBadRequest +const DataCocsnInterfacesGetBadRequestCode int = 400 + +/*DataCocsnInterfacesGetBadRequest Bad Request + +swagger:response dataCocsnInterfacesGetBadRequest +*/ +type DataCocsnInterfacesGetBadRequest struct { +} + +// NewDataCocsnInterfacesGetBadRequest creates DataCocsnInterfacesGetBadRequest with default headers values +func NewDataCocsnInterfacesGetBadRequest() *DataCocsnInterfacesGetBadRequest { + + return &DataCocsnInterfacesGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnInterfacesGetUnauthorizedCode is the HTTP code returned for type DataCocsnInterfacesGetUnauthorized +const DataCocsnInterfacesGetUnauthorizedCode int = 401 + +/*DataCocsnInterfacesGetUnauthorized Unauthorized + +swagger:response dataCocsnInterfacesGetUnauthorized +*/ +type DataCocsnInterfacesGetUnauthorized struct { +} + +// NewDataCocsnInterfacesGetUnauthorized creates DataCocsnInterfacesGetUnauthorized with default headers values +func NewDataCocsnInterfacesGetUnauthorized() *DataCocsnInterfacesGetUnauthorized { + + return &DataCocsnInterfacesGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnInterfacesGetNotFoundCode is the HTTP code returned for type DataCocsnInterfacesGetNotFound +const DataCocsnInterfacesGetNotFoundCode int = 404 + +/*DataCocsnInterfacesGetNotFound Not Found + +swagger:response dataCocsnInterfacesGetNotFound +*/ +type DataCocsnInterfacesGetNotFound struct { +} + +// NewDataCocsnInterfacesGetNotFound creates DataCocsnInterfacesGetNotFound with default headers values +func NewDataCocsnInterfacesGetNotFound() *DataCocsnInterfacesGetNotFound { + + return &DataCocsnInterfacesGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnInterfacesGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnInterfacesGetMethodNotAllowed +const DataCocsnInterfacesGetMethodNotAllowedCode int = 405 + +/*DataCocsnInterfacesGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnInterfacesGetMethodNotAllowed +*/ +type DataCocsnInterfacesGetMethodNotAllowed struct { +} + +// NewDataCocsnInterfacesGetMethodNotAllowed creates DataCocsnInterfacesGetMethodNotAllowed with default headers values +func NewDataCocsnInterfacesGetMethodNotAllowed() *DataCocsnInterfacesGetMethodNotAllowed { + + return &DataCocsnInterfacesGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnInterfacesGetConflictCode is the HTTP code returned for type DataCocsnInterfacesGetConflict +const DataCocsnInterfacesGetConflictCode int = 409 + +/*DataCocsnInterfacesGetConflict Conflict + +swagger:response dataCocsnInterfacesGetConflict +*/ +type DataCocsnInterfacesGetConflict struct { +} + +// NewDataCocsnInterfacesGetConflict creates DataCocsnInterfacesGetConflict with default headers values +func NewDataCocsnInterfacesGetConflict() *DataCocsnInterfacesGetConflict { + + return &DataCocsnInterfacesGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_interfaces_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..3ce02d45dd8c239d1dacea86dd5acbbaaffd2665 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_get_urlbuilder.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// DataCocsnInterfacesGetURL generates an URL for the data cocsn interfaces get operation +type DataCocsnInterfacesGetURL struct { + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesGetURL) WithBasePath(bp string) *DataCocsnInterfacesGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnInterfacesGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:interfaces" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnInterfacesGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnInterfacesGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnInterfacesGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnInterfacesGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnInterfacesGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnInterfacesGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_get.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_get.go new file mode 100644 index 0000000000000000000000000000000000000000..3e2049440558efd565aaa334f698c13d820c25c3 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_get.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnInterfacesInterfaceGetHandlerFunc turns a function with the right signature into a data cocsn interfaces interface get handler +type DataCocsnInterfacesInterfaceGetHandlerFunc func(DataCocsnInterfacesInterfaceGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnInterfacesInterfaceGetHandlerFunc) Handle(params DataCocsnInterfacesInterfaceGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnInterfacesInterfaceGetHandler interface for that can handle valid data cocsn interfaces interface get params +type DataCocsnInterfacesInterfaceGetHandler interface { + Handle(DataCocsnInterfacesInterfaceGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnInterfacesInterfaceGet creates a new http.Handler for the data cocsn interfaces interface get operation +func NewDataCocsnInterfacesInterfaceGet(ctx *middleware.Context, handler DataCocsnInterfacesInterfaceGetHandler) *DataCocsnInterfacesInterfaceGet { + return &DataCocsnInterfacesInterfaceGet{Context: ctx, Handler: handler} +} + +/*DataCocsnInterfacesInterfaceGet swagger:route GET /data/cocsn:interfaces/interface data get dataCocsnInterfacesInterfaceGet + +DataCocsnInterfacesInterfaceGet data cocsn interfaces interface get API + +*/ +type DataCocsnInterfacesInterfaceGet struct { + Context *middleware.Context + Handler DataCocsnInterfacesInterfaceGetHandler +} + +func (o *DataCocsnInterfacesInterfaceGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnInterfacesInterfaceGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_get_parameters.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..67822b2a9ff0b9395523f4ab4dfb840ac937c156 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_get_parameters.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnInterfacesInterfaceGetParams creates a new DataCocsnInterfacesInterfaceGetParams object +// with the default values initialized. +func NewDataCocsnInterfacesInterfaceGetParams() DataCocsnInterfacesInterfaceGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnInterfacesInterfaceGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnInterfacesInterfaceGetParams contains all the bound params for the data cocsn interfaces interface get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_interfaces_interface_get +type DataCocsnInterfacesInterfaceGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnInterfacesInterfaceGetParams() beforehand. +func (o *DataCocsnInterfacesInterfaceGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnInterfacesInterfaceGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnInterfacesInterfaceGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnInterfacesInterfaceGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnInterfacesInterfaceGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnInterfacesInterfaceGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnInterfacesInterfaceGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnInterfacesInterfaceGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnInterfacesInterfaceGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnInterfacesInterfaceGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_get_responses.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..01fa94483334ceb549d9e3ad0ef5700cda59e04b --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnInterfacesInterfaceGetOKCode is the HTTP code returned for type DataCocsnInterfacesInterfaceGetOK +const DataCocsnInterfacesInterfaceGetOKCode int = 200 + +/*DataCocsnInterfacesInterfaceGetOK OK + +swagger:response dataCocsnInterfacesInterfaceGetOK +*/ +type DataCocsnInterfacesInterfaceGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnInterfacesInterface `json:"body,omitempty"` +} + +// NewDataCocsnInterfacesInterfaceGetOK creates DataCocsnInterfacesInterfaceGetOK with default headers values +func NewDataCocsnInterfacesInterfaceGetOK() *DataCocsnInterfacesInterfaceGetOK { + + return &DataCocsnInterfacesInterfaceGetOK{} +} + +// WithPayload adds the payload to the data cocsn interfaces interface get o k response +func (o *DataCocsnInterfacesInterfaceGetOK) WithPayload(payload *models.DataCocsnInterfacesInterface) *DataCocsnInterfacesInterfaceGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn interfaces interface get o k response +func (o *DataCocsnInterfacesInterfaceGetOK) SetPayload(payload *models.DataCocsnInterfacesInterface) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnInterfacesInterfaceGetNoContentCode is the HTTP code returned for type DataCocsnInterfacesInterfaceGetNoContent +const DataCocsnInterfacesInterfaceGetNoContentCode int = 204 + +/*DataCocsnInterfacesInterfaceGetNoContent No Content + +swagger:response dataCocsnInterfacesInterfaceGetNoContent +*/ +type DataCocsnInterfacesInterfaceGetNoContent struct { +} + +// NewDataCocsnInterfacesInterfaceGetNoContent creates DataCocsnInterfacesInterfaceGetNoContent with default headers values +func NewDataCocsnInterfacesInterfaceGetNoContent() *DataCocsnInterfacesInterfaceGetNoContent { + + return &DataCocsnInterfacesInterfaceGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnInterfacesInterfaceGetBadRequestCode is the HTTP code returned for type DataCocsnInterfacesInterfaceGetBadRequest +const DataCocsnInterfacesInterfaceGetBadRequestCode int = 400 + +/*DataCocsnInterfacesInterfaceGetBadRequest Bad Request + +swagger:response dataCocsnInterfacesInterfaceGetBadRequest +*/ +type DataCocsnInterfacesInterfaceGetBadRequest struct { +} + +// NewDataCocsnInterfacesInterfaceGetBadRequest creates DataCocsnInterfacesInterfaceGetBadRequest with default headers values +func NewDataCocsnInterfacesInterfaceGetBadRequest() *DataCocsnInterfacesInterfaceGetBadRequest { + + return &DataCocsnInterfacesInterfaceGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnInterfacesInterfaceGetUnauthorizedCode is the HTTP code returned for type DataCocsnInterfacesInterfaceGetUnauthorized +const DataCocsnInterfacesInterfaceGetUnauthorizedCode int = 401 + +/*DataCocsnInterfacesInterfaceGetUnauthorized Unauthorized + +swagger:response dataCocsnInterfacesInterfaceGetUnauthorized +*/ +type DataCocsnInterfacesInterfaceGetUnauthorized struct { +} + +// NewDataCocsnInterfacesInterfaceGetUnauthorized creates DataCocsnInterfacesInterfaceGetUnauthorized with default headers values +func NewDataCocsnInterfacesInterfaceGetUnauthorized() *DataCocsnInterfacesInterfaceGetUnauthorized { + + return &DataCocsnInterfacesInterfaceGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnInterfacesInterfaceGetNotFoundCode is the HTTP code returned for type DataCocsnInterfacesInterfaceGetNotFound +const DataCocsnInterfacesInterfaceGetNotFoundCode int = 404 + +/*DataCocsnInterfacesInterfaceGetNotFound Not Found + +swagger:response dataCocsnInterfacesInterfaceGetNotFound +*/ +type DataCocsnInterfacesInterfaceGetNotFound struct { +} + +// NewDataCocsnInterfacesInterfaceGetNotFound creates DataCocsnInterfacesInterfaceGetNotFound with default headers values +func NewDataCocsnInterfacesInterfaceGetNotFound() *DataCocsnInterfacesInterfaceGetNotFound { + + return &DataCocsnInterfacesInterfaceGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnInterfacesInterfaceGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnInterfacesInterfaceGetMethodNotAllowed +const DataCocsnInterfacesInterfaceGetMethodNotAllowedCode int = 405 + +/*DataCocsnInterfacesInterfaceGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnInterfacesInterfaceGetMethodNotAllowed +*/ +type DataCocsnInterfacesInterfaceGetMethodNotAllowed struct { +} + +// NewDataCocsnInterfacesInterfaceGetMethodNotAllowed creates DataCocsnInterfacesInterfaceGetMethodNotAllowed with default headers values +func NewDataCocsnInterfacesInterfaceGetMethodNotAllowed() *DataCocsnInterfacesInterfaceGetMethodNotAllowed { + + return &DataCocsnInterfacesInterfaceGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnInterfacesInterfaceGetConflictCode is the HTTP code returned for type DataCocsnInterfacesInterfaceGetConflict +const DataCocsnInterfacesInterfaceGetConflictCode int = 409 + +/*DataCocsnInterfacesInterfaceGetConflict Conflict + +swagger:response dataCocsnInterfacesInterfaceGetConflict +*/ +type DataCocsnInterfacesInterfaceGetConflict struct { +} + +// NewDataCocsnInterfacesInterfaceGetConflict creates DataCocsnInterfacesInterfaceGetConflict with default headers values +func NewDataCocsnInterfacesInterfaceGetConflict() *DataCocsnInterfacesInterfaceGetConflict { + + return &DataCocsnInterfacesInterfaceGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..846f2838ea2819fee7adc35639f452d9e9f0ef7b --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_get_urlbuilder.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// DataCocsnInterfacesInterfaceGetURL generates an URL for the data cocsn interfaces interface get operation +type DataCocsnInterfacesInterfaceGetURL struct { + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesInterfaceGetURL) WithBasePath(bp string) *DataCocsnInterfacesInterfaceGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesInterfaceGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnInterfacesInterfaceGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:interfaces/interface" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnInterfacesInterfaceGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnInterfacesInterfaceGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnInterfacesInterfaceGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnInterfacesInterfaceGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnInterfacesInterfaceGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnInterfacesInterfaceGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_addresses_id_get.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_addresses_id_get.go new file mode 100644 index 0000000000000000000000000000000000000000..9797fbf7cf87e80176bad3e83228029941758c48 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_addresses_id_get.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetHandlerFunc turns a function with the right signature into a data cocsn interfaces interface interface name addresses addresses id get handler +type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetHandlerFunc func(DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetHandlerFunc) Handle(params DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetHandler interface for that can handle valid data cocsn interfaces interface interface name addresses addresses id get params +type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetHandler interface { + Handle(DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGet creates a new http.Handler for the data cocsn interfaces interface interface name addresses addresses id get operation +func NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGet(ctx *middleware.Context, handler DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetHandler) *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGet { + return &DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGet{Context: ctx, Handler: handler} +} + +/*DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGet swagger:route GET /data/cocsn:interfaces/interface={interface-name}/addresses={addresses-id} data get dataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIdGet + +Interface IP address. Example value: 10.10.10.1 + +Interface IP address. Example value: 10.10.10.1 + +*/ +type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGet struct { + Context *middleware.Context + Handler DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetHandler +} + +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_addresses_id_get_parameters.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_addresses_id_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0264dfa61cb27d8bf2e008b8e2ed2a49fbe74a24 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_addresses_id_get_parameters.go @@ -0,0 +1,285 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams creates a new DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams object +// with the default values initialized. +func NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams() DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams contains all the bound params for the data cocsn interfaces interface interface name addresses addresses id get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_interfaces_interface_interface_name_addresses_addresses_id_get +type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Interface IP address. Example value: 10.10.10.1 + Required: true + In: path + */ + AddressesID string + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*Interface name. Example value: en0 + Required: true + In: path + */ + InterfaceName string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams() beforehand. +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + rAddressesID, rhkAddressesID, _ := route.Params.GetOK("addresses-id") + if err := o.bindAddressesID(rAddressesID, rhkAddressesID, route.Formats); err != nil { + res = append(res, err) + } + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + rInterfaceName, rhkInterfaceName, _ := route.Params.GetOK("interface-name") + if err := o.bindInterfaceName(rInterfaceName, rhkInterfaceName, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindAddressesID binds and validates parameter AddressesID from path. +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams) bindAddressesID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.AddressesID = raw + + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindInterfaceName binds and validates parameter InterfaceName from path. +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams) bindInterfaceName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.InterfaceName = raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_addresses_id_get_responses.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_addresses_id_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..11010b8370ff5b9ab8213176bacdf7b883be79c8 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_addresses_id_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetOKCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetOK +const DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetOKCode int = 200 + +/*DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetOK Interface IP address. Example value: 10.10.10.1 + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIdGetOK +*/ +type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesID `json:"body,omitempty"` +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetOK creates DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetOK with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetOK() *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetOK { + + return &DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetOK{} +} + +// WithPayload adds the payload to the data cocsn interfaces interface interface name addresses addresses Id get o k response +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetOK) WithPayload(payload *models.DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesID) *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn interfaces interface interface name addresses addresses Id get o k response +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetOK) SetPayload(payload *models.DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesID) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNoContentCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNoContent +const DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNoContentCode int = 204 + +/*DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNoContent No Content + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIdGetNoContent +*/ +type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNoContent struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNoContent creates DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNoContent with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNoContent() *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNoContent { + + return &DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetBadRequestCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetBadRequest +const DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetBadRequestCode int = 400 + +/*DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetBadRequest Bad Request + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIdGetBadRequest +*/ +type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetBadRequest struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetBadRequest creates DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetBadRequest with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetBadRequest() *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetBadRequest { + + return &DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetUnauthorizedCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetUnauthorized +const DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetUnauthorizedCode int = 401 + +/*DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetUnauthorized Unauthorized + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIdGetUnauthorized +*/ +type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetUnauthorized struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetUnauthorized creates DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetUnauthorized with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetUnauthorized() *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetUnauthorized { + + return &DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNotFoundCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNotFound +const DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNotFoundCode int = 404 + +/*DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNotFound Not Found + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIdGetNotFound +*/ +type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNotFound struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNotFound creates DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNotFound with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNotFound() *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNotFound { + + return &DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetMethodNotAllowed +const DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetMethodNotAllowedCode int = 405 + +/*DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIdGetMethodNotAllowed +*/ +type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetMethodNotAllowed struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetMethodNotAllowed creates DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetMethodNotAllowed with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetMethodNotAllowed() *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetMethodNotAllowed { + + return &DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetConflictCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetConflict +const DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetConflictCode int = 409 + +/*DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetConflict Conflict + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIdGetConflict +*/ +type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetConflict struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetConflict creates DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetConflict with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetConflict() *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetConflict { + + return &DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_addresses_id_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_addresses_id_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..ee75a35184cffc4cb78a97315459db5bf38a56cf --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_addresses_id_get_urlbuilder.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetURL generates an URL for the data cocsn interfaces interface interface name addresses addresses id get operation +type DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetURL struct { + AddressesID string + InterfaceName string + + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetURL) WithBasePath(bp string) *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:interfaces/interface={interface-name}/addresses={addresses-id}" + + addressesID := o.AddressesID + if addressesID != "" { + _path = strings.Replace(_path, "{addresses-id}", addressesID, -1) + } else { + return nil, errors.New("addressesId is required on DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetURL") + } + + interfaceName := o.InterfaceName + if interfaceName != "" { + _path = strings.Replace(_path, "{interface-name}", interfaceName, -1) + } else { + return nil, errors.New("interfaceName is required on DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesAddressesIDGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_get.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_get.go new file mode 100644 index 0000000000000000000000000000000000000000..bfdeacbb3e49d7c86a69c3fc5f09ff299b27c59d --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_get.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesGetHandlerFunc turns a function with the right signature into a data cocsn interfaces interface interface name addresses get handler +type DataCocsnInterfacesInterfaceInterfaceNameAddressesGetHandlerFunc func(DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnInterfacesInterfaceInterfaceNameAddressesGetHandlerFunc) Handle(params DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesGetHandler interface for that can handle valid data cocsn interfaces interface interface name addresses get params +type DataCocsnInterfacesInterfaceInterfaceNameAddressesGetHandler interface { + Handle(DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGet creates a new http.Handler for the data cocsn interfaces interface interface name addresses get operation +func NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGet(ctx *middleware.Context, handler DataCocsnInterfacesInterfaceInterfaceNameAddressesGetHandler) *DataCocsnInterfacesInterfaceInterfaceNameAddressesGet { + return &DataCocsnInterfacesInterfaceInterfaceNameAddressesGet{Context: ctx, Handler: handler} +} + +/*DataCocsnInterfacesInterfaceInterfaceNameAddressesGet swagger:route GET /data/cocsn:interfaces/interface={interface-name}/addresses data get dataCocsnInterfacesInterfaceInterfaceNameAddressesGet + +Interface IP address. Example value: 10.10.10.1 + +Interface IP address. Example value: 10.10.10.1 + +*/ +type DataCocsnInterfacesInterfaceInterfaceNameAddressesGet struct { + Context *middleware.Context + Handler DataCocsnInterfacesInterfaceInterfaceNameAddressesGetHandler +} + +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_get_parameters.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..91297cec2eb542ea417509a1e3b1f1155d33cdd4 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_get_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams creates a new DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams object +// with the default values initialized. +func NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams() DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams contains all the bound params for the data cocsn interfaces interface interface name addresses get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_interfaces_interface_interface_name_addresses_get +type DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*Interface name. Example value: en0 + Required: true + In: path + */ + InterfaceName string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams() beforehand. +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + rInterfaceName, rhkInterfaceName, _ := route.Params.GetOK("interface-name") + if err := o.bindInterfaceName(rInterfaceName, rhkInterfaceName, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindInterfaceName binds and validates parameter InterfaceName from path. +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams) bindInterfaceName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.InterfaceName = raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_get_responses.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c804563e662abb1bc4ec59eb881b8e841f0e29c9 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesGetOKCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameAddressesGetOK +const DataCocsnInterfacesInterfaceInterfaceNameAddressesGetOKCode int = 200 + +/*DataCocsnInterfacesInterfaceInterfaceNameAddressesGetOK Interface IP address. Example value: 10.10.10.1 + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameAddressesGetOK +*/ +type DataCocsnInterfacesInterfaceInterfaceNameAddressesGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnInterfacesInterfaceInterfaceNameAddresses `json:"body,omitempty"` +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetOK creates DataCocsnInterfacesInterfaceInterfaceNameAddressesGetOK with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetOK() *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetOK { + + return &DataCocsnInterfacesInterfaceInterfaceNameAddressesGetOK{} +} + +// WithPayload adds the payload to the data cocsn interfaces interface interface name addresses get o k response +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetOK) WithPayload(payload *models.DataCocsnInterfacesInterfaceInterfaceNameAddresses) *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn interfaces interface interface name addresses get o k response +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetOK) SetPayload(payload *models.DataCocsnInterfacesInterfaceInterfaceNameAddresses) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesGetNoContentCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameAddressesGetNoContent +const DataCocsnInterfacesInterfaceInterfaceNameAddressesGetNoContentCode int = 204 + +/*DataCocsnInterfacesInterfaceInterfaceNameAddressesGetNoContent No Content + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameAddressesGetNoContent +*/ +type DataCocsnInterfacesInterfaceInterfaceNameAddressesGetNoContent struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetNoContent creates DataCocsnInterfacesInterfaceInterfaceNameAddressesGetNoContent with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetNoContent() *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetNoContent { + + return &DataCocsnInterfacesInterfaceInterfaceNameAddressesGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesGetBadRequestCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameAddressesGetBadRequest +const DataCocsnInterfacesInterfaceInterfaceNameAddressesGetBadRequestCode int = 400 + +/*DataCocsnInterfacesInterfaceInterfaceNameAddressesGetBadRequest Bad Request + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameAddressesGetBadRequest +*/ +type DataCocsnInterfacesInterfaceInterfaceNameAddressesGetBadRequest struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetBadRequest creates DataCocsnInterfacesInterfaceInterfaceNameAddressesGetBadRequest with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetBadRequest() *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetBadRequest { + + return &DataCocsnInterfacesInterfaceInterfaceNameAddressesGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesGetUnauthorizedCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameAddressesGetUnauthorized +const DataCocsnInterfacesInterfaceInterfaceNameAddressesGetUnauthorizedCode int = 401 + +/*DataCocsnInterfacesInterfaceInterfaceNameAddressesGetUnauthorized Unauthorized + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameAddressesGetUnauthorized +*/ +type DataCocsnInterfacesInterfaceInterfaceNameAddressesGetUnauthorized struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetUnauthorized creates DataCocsnInterfacesInterfaceInterfaceNameAddressesGetUnauthorized with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetUnauthorized() *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetUnauthorized { + + return &DataCocsnInterfacesInterfaceInterfaceNameAddressesGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesGetNotFoundCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameAddressesGetNotFound +const DataCocsnInterfacesInterfaceInterfaceNameAddressesGetNotFoundCode int = 404 + +/*DataCocsnInterfacesInterfaceInterfaceNameAddressesGetNotFound Not Found + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameAddressesGetNotFound +*/ +type DataCocsnInterfacesInterfaceInterfaceNameAddressesGetNotFound struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetNotFound creates DataCocsnInterfacesInterfaceInterfaceNameAddressesGetNotFound with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetNotFound() *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetNotFound { + + return &DataCocsnInterfacesInterfaceInterfaceNameAddressesGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameAddressesGetMethodNotAllowed +const DataCocsnInterfacesInterfaceInterfaceNameAddressesGetMethodNotAllowedCode int = 405 + +/*DataCocsnInterfacesInterfaceInterfaceNameAddressesGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameAddressesGetMethodNotAllowed +*/ +type DataCocsnInterfacesInterfaceInterfaceNameAddressesGetMethodNotAllowed struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetMethodNotAllowed creates DataCocsnInterfacesInterfaceInterfaceNameAddressesGetMethodNotAllowed with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetMethodNotAllowed() *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetMethodNotAllowed { + + return &DataCocsnInterfacesInterfaceInterfaceNameAddressesGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesGetConflictCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameAddressesGetConflict +const DataCocsnInterfacesInterfaceInterfaceNameAddressesGetConflictCode int = 409 + +/*DataCocsnInterfacesInterfaceInterfaceNameAddressesGetConflict Conflict + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameAddressesGetConflict +*/ +type DataCocsnInterfacesInterfaceInterfaceNameAddressesGetConflict struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetConflict creates DataCocsnInterfacesInterfaceInterfaceNameAddressesGetConflict with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameAddressesGetConflict() *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetConflict { + + return &DataCocsnInterfacesInterfaceInterfaceNameAddressesGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..a817691c6c572f21f33c64f60b67856590187b1b --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_addresses_get_urlbuilder.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DataCocsnInterfacesInterfaceInterfaceNameAddressesGetURL generates an URL for the data cocsn interfaces interface interface name addresses get operation +type DataCocsnInterfacesInterfaceInterfaceNameAddressesGetURL struct { + InterfaceName string + + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetURL) WithBasePath(bp string) *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:interfaces/interface={interface-name}/addresses" + + interfaceName := o.InterfaceName + if interfaceName != "" { + _path = strings.Replace(_path, "{interface-name}", interfaceName, -1) + } else { + return nil, errors.New("interfaceName is required on DataCocsnInterfacesInterfaceInterfaceNameAddressesGetURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnInterfacesInterfaceInterfaceNameAddressesGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnInterfacesInterfaceInterfaceNameAddressesGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnInterfacesInterfaceInterfaceNameAddressesGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_enabled_get.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_enabled_get.go new file mode 100644 index 0000000000000000000000000000000000000000..407e5676dc7882d3e9dc69d1fd8deb044d6ef640 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_enabled_get.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnInterfacesInterfaceInterfaceNameEnabledGetHandlerFunc turns a function with the right signature into a data cocsn interfaces interface interface name enabled get handler +type DataCocsnInterfacesInterfaceInterfaceNameEnabledGetHandlerFunc func(DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnInterfacesInterfaceInterfaceNameEnabledGetHandlerFunc) Handle(params DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnInterfacesInterfaceInterfaceNameEnabledGetHandler interface for that can handle valid data cocsn interfaces interface interface name enabled get params +type DataCocsnInterfacesInterfaceInterfaceNameEnabledGetHandler interface { + Handle(DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGet creates a new http.Handler for the data cocsn interfaces interface interface name enabled get operation +func NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGet(ctx *middleware.Context, handler DataCocsnInterfacesInterfaceInterfaceNameEnabledGetHandler) *DataCocsnInterfacesInterfaceInterfaceNameEnabledGet { + return &DataCocsnInterfacesInterfaceInterfaceNameEnabledGet{Context: ctx, Handler: handler} +} + +/*DataCocsnInterfacesInterfaceInterfaceNameEnabledGet swagger:route GET /data/cocsn:interfaces/interface={interface-name}/enabled data get dataCocsnInterfacesInterfaceInterfaceNameEnabledGet + +Enable or disable the interface. Example value: true + +Enable or disable the interface. Example value: true + +*/ +type DataCocsnInterfacesInterfaceInterfaceNameEnabledGet struct { + Context *middleware.Context + Handler DataCocsnInterfacesInterfaceInterfaceNameEnabledGetHandler +} + +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_enabled_get_parameters.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_enabled_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..2fa284b0dd725432d6cb1d37bc2adb19d06c7779 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_enabled_get_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams creates a new DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams object +// with the default values initialized. +func NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams() DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams contains all the bound params for the data cocsn interfaces interface interface name enabled get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_interfaces_interface_interface_name_enabled_get +type DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*Interface name. Example value: en0 + Required: true + In: path + */ + InterfaceName string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams() beforehand. +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + rInterfaceName, rhkInterfaceName, _ := route.Params.GetOK("interface-name") + if err := o.bindInterfaceName(rInterfaceName, rhkInterfaceName, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindInterfaceName binds and validates parameter InterfaceName from path. +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams) bindInterfaceName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.InterfaceName = raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_enabled_get_responses.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_enabled_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..600fd31a98aae4183809600aaedbab10386a4d37 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_enabled_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnInterfacesInterfaceInterfaceNameEnabledGetOKCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameEnabledGetOK +const DataCocsnInterfacesInterfaceInterfaceNameEnabledGetOKCode int = 200 + +/*DataCocsnInterfacesInterfaceInterfaceNameEnabledGetOK Enable or disable the interface. Example value: true + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameEnabledGetOK +*/ +type DataCocsnInterfacesInterfaceInterfaceNameEnabledGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnInterfacesInterfaceInterfaceNameEnabled `json:"body,omitempty"` +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetOK creates DataCocsnInterfacesInterfaceInterfaceNameEnabledGetOK with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetOK() *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetOK { + + return &DataCocsnInterfacesInterfaceInterfaceNameEnabledGetOK{} +} + +// WithPayload adds the payload to the data cocsn interfaces interface interface name enabled get o k response +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetOK) WithPayload(payload *models.DataCocsnInterfacesInterfaceInterfaceNameEnabled) *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn interfaces interface interface name enabled get o k response +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetOK) SetPayload(payload *models.DataCocsnInterfacesInterfaceInterfaceNameEnabled) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnInterfacesInterfaceInterfaceNameEnabledGetNoContentCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameEnabledGetNoContent +const DataCocsnInterfacesInterfaceInterfaceNameEnabledGetNoContentCode int = 204 + +/*DataCocsnInterfacesInterfaceInterfaceNameEnabledGetNoContent No Content + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameEnabledGetNoContent +*/ +type DataCocsnInterfacesInterfaceInterfaceNameEnabledGetNoContent struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetNoContent creates DataCocsnInterfacesInterfaceInterfaceNameEnabledGetNoContent with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetNoContent() *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetNoContent { + + return &DataCocsnInterfacesInterfaceInterfaceNameEnabledGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnInterfacesInterfaceInterfaceNameEnabledGetBadRequestCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameEnabledGetBadRequest +const DataCocsnInterfacesInterfaceInterfaceNameEnabledGetBadRequestCode int = 400 + +/*DataCocsnInterfacesInterfaceInterfaceNameEnabledGetBadRequest Bad Request + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameEnabledGetBadRequest +*/ +type DataCocsnInterfacesInterfaceInterfaceNameEnabledGetBadRequest struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetBadRequest creates DataCocsnInterfacesInterfaceInterfaceNameEnabledGetBadRequest with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetBadRequest() *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetBadRequest { + + return &DataCocsnInterfacesInterfaceInterfaceNameEnabledGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnInterfacesInterfaceInterfaceNameEnabledGetUnauthorizedCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameEnabledGetUnauthorized +const DataCocsnInterfacesInterfaceInterfaceNameEnabledGetUnauthorizedCode int = 401 + +/*DataCocsnInterfacesInterfaceInterfaceNameEnabledGetUnauthorized Unauthorized + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameEnabledGetUnauthorized +*/ +type DataCocsnInterfacesInterfaceInterfaceNameEnabledGetUnauthorized struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetUnauthorized creates DataCocsnInterfacesInterfaceInterfaceNameEnabledGetUnauthorized with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetUnauthorized() *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetUnauthorized { + + return &DataCocsnInterfacesInterfaceInterfaceNameEnabledGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnInterfacesInterfaceInterfaceNameEnabledGetNotFoundCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameEnabledGetNotFound +const DataCocsnInterfacesInterfaceInterfaceNameEnabledGetNotFoundCode int = 404 + +/*DataCocsnInterfacesInterfaceInterfaceNameEnabledGetNotFound Not Found + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameEnabledGetNotFound +*/ +type DataCocsnInterfacesInterfaceInterfaceNameEnabledGetNotFound struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetNotFound creates DataCocsnInterfacesInterfaceInterfaceNameEnabledGetNotFound with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetNotFound() *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetNotFound { + + return &DataCocsnInterfacesInterfaceInterfaceNameEnabledGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnInterfacesInterfaceInterfaceNameEnabledGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameEnabledGetMethodNotAllowed +const DataCocsnInterfacesInterfaceInterfaceNameEnabledGetMethodNotAllowedCode int = 405 + +/*DataCocsnInterfacesInterfaceInterfaceNameEnabledGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameEnabledGetMethodNotAllowed +*/ +type DataCocsnInterfacesInterfaceInterfaceNameEnabledGetMethodNotAllowed struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetMethodNotAllowed creates DataCocsnInterfacesInterfaceInterfaceNameEnabledGetMethodNotAllowed with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetMethodNotAllowed() *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetMethodNotAllowed { + + return &DataCocsnInterfacesInterfaceInterfaceNameEnabledGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnInterfacesInterfaceInterfaceNameEnabledGetConflictCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameEnabledGetConflict +const DataCocsnInterfacesInterfaceInterfaceNameEnabledGetConflictCode int = 409 + +/*DataCocsnInterfacesInterfaceInterfaceNameEnabledGetConflict Conflict + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameEnabledGetConflict +*/ +type DataCocsnInterfacesInterfaceInterfaceNameEnabledGetConflict struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetConflict creates DataCocsnInterfacesInterfaceInterfaceNameEnabledGetConflict with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameEnabledGetConflict() *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetConflict { + + return &DataCocsnInterfacesInterfaceInterfaceNameEnabledGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_enabled_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_enabled_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..522084f71336d7448e738f3647a06b73bd3505e6 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_enabled_get_urlbuilder.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DataCocsnInterfacesInterfaceInterfaceNameEnabledGetURL generates an URL for the data cocsn interfaces interface interface name enabled get operation +type DataCocsnInterfacesInterfaceInterfaceNameEnabledGetURL struct { + InterfaceName string + + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetURL) WithBasePath(bp string) *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:interfaces/interface={interface-name}/enabled" + + interfaceName := o.InterfaceName + if interfaceName != "" { + _path = strings.Replace(_path, "{interface-name}", interfaceName, -1) + } else { + return nil, errors.New("interfaceName is required on DataCocsnInterfacesInterfaceInterfaceNameEnabledGetURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnInterfacesInterfaceInterfaceNameEnabledGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnInterfacesInterfaceInterfaceNameEnabledGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnInterfacesInterfaceInterfaceNameEnabledGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_get.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_get.go new file mode 100644 index 0000000000000000000000000000000000000000..d9d5a53c44f248629cd611643481a7bb92900ab9 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_get.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnInterfacesInterfaceInterfaceNameGetHandlerFunc turns a function with the right signature into a data cocsn interfaces interface interface name get handler +type DataCocsnInterfacesInterfaceInterfaceNameGetHandlerFunc func(DataCocsnInterfacesInterfaceInterfaceNameGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnInterfacesInterfaceInterfaceNameGetHandlerFunc) Handle(params DataCocsnInterfacesInterfaceInterfaceNameGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnInterfacesInterfaceInterfaceNameGetHandler interface for that can handle valid data cocsn interfaces interface interface name get params +type DataCocsnInterfacesInterfaceInterfaceNameGetHandler interface { + Handle(DataCocsnInterfacesInterfaceInterfaceNameGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameGet creates a new http.Handler for the data cocsn interfaces interface interface name get operation +func NewDataCocsnInterfacesInterfaceInterfaceNameGet(ctx *middleware.Context, handler DataCocsnInterfacesInterfaceInterfaceNameGetHandler) *DataCocsnInterfacesInterfaceInterfaceNameGet { + return &DataCocsnInterfacesInterfaceInterfaceNameGet{Context: ctx, Handler: handler} +} + +/*DataCocsnInterfacesInterfaceInterfaceNameGet swagger:route GET /data/cocsn:interfaces/interface={interface-name} data get dataCocsnInterfacesInterfaceInterfaceNameGet + +DataCocsnInterfacesInterfaceInterfaceNameGet data cocsn interfaces interface interface name get API + +*/ +type DataCocsnInterfacesInterfaceInterfaceNameGet struct { + Context *middleware.Context + Handler DataCocsnInterfacesInterfaceInterfaceNameGetHandler +} + +func (o *DataCocsnInterfacesInterfaceInterfaceNameGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnInterfacesInterfaceInterfaceNameGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_get_parameters.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..416673612eeb221152fe7f6df0ef115a6d63849e --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_get_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnInterfacesInterfaceInterfaceNameGetParams creates a new DataCocsnInterfacesInterfaceInterfaceNameGetParams object +// with the default values initialized. +func NewDataCocsnInterfacesInterfaceInterfaceNameGetParams() DataCocsnInterfacesInterfaceInterfaceNameGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnInterfacesInterfaceInterfaceNameGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnInterfacesInterfaceInterfaceNameGetParams contains all the bound params for the data cocsn interfaces interface interface name get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_interfaces_interface_interface_name_get +type DataCocsnInterfacesInterfaceInterfaceNameGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*Interface name. Example value: en0 + Required: true + In: path + */ + InterfaceName string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnInterfacesInterfaceInterfaceNameGetParams() beforehand. +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + rInterfaceName, rhkInterfaceName, _ := route.Params.GetOK("interface-name") + if err := o.bindInterfaceName(rInterfaceName, rhkInterfaceName, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnInterfacesInterfaceInterfaceNameGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindInterfaceName binds and validates parameter InterfaceName from path. +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetParams) bindInterfaceName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.InterfaceName = raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnInterfacesInterfaceInterfaceNameGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_get_responses.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4be0e6f1a8c7de3f36aafacb49e7cacb829097ba --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnInterfacesInterfaceInterfaceNameGetOKCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameGetOK +const DataCocsnInterfacesInterfaceInterfaceNameGetOKCode int = 200 + +/*DataCocsnInterfacesInterfaceInterfaceNameGetOK OK + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameGetOK +*/ +type DataCocsnInterfacesInterfaceInterfaceNameGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnInterfacesInterfaceInterfaceName `json:"body,omitempty"` +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameGetOK creates DataCocsnInterfacesInterfaceInterfaceNameGetOK with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameGetOK() *DataCocsnInterfacesInterfaceInterfaceNameGetOK { + + return &DataCocsnInterfacesInterfaceInterfaceNameGetOK{} +} + +// WithPayload adds the payload to the data cocsn interfaces interface interface name get o k response +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetOK) WithPayload(payload *models.DataCocsnInterfacesInterfaceInterfaceName) *DataCocsnInterfacesInterfaceInterfaceNameGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn interfaces interface interface name get o k response +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetOK) SetPayload(payload *models.DataCocsnInterfacesInterfaceInterfaceName) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnInterfacesInterfaceInterfaceNameGetNoContentCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameGetNoContent +const DataCocsnInterfacesInterfaceInterfaceNameGetNoContentCode int = 204 + +/*DataCocsnInterfacesInterfaceInterfaceNameGetNoContent No Content + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameGetNoContent +*/ +type DataCocsnInterfacesInterfaceInterfaceNameGetNoContent struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameGetNoContent creates DataCocsnInterfacesInterfaceInterfaceNameGetNoContent with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameGetNoContent() *DataCocsnInterfacesInterfaceInterfaceNameGetNoContent { + + return &DataCocsnInterfacesInterfaceInterfaceNameGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnInterfacesInterfaceInterfaceNameGetBadRequestCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameGetBadRequest +const DataCocsnInterfacesInterfaceInterfaceNameGetBadRequestCode int = 400 + +/*DataCocsnInterfacesInterfaceInterfaceNameGetBadRequest Bad Request + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameGetBadRequest +*/ +type DataCocsnInterfacesInterfaceInterfaceNameGetBadRequest struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameGetBadRequest creates DataCocsnInterfacesInterfaceInterfaceNameGetBadRequest with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameGetBadRequest() *DataCocsnInterfacesInterfaceInterfaceNameGetBadRequest { + + return &DataCocsnInterfacesInterfaceInterfaceNameGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnInterfacesInterfaceInterfaceNameGetUnauthorizedCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameGetUnauthorized +const DataCocsnInterfacesInterfaceInterfaceNameGetUnauthorizedCode int = 401 + +/*DataCocsnInterfacesInterfaceInterfaceNameGetUnauthorized Unauthorized + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameGetUnauthorized +*/ +type DataCocsnInterfacesInterfaceInterfaceNameGetUnauthorized struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameGetUnauthorized creates DataCocsnInterfacesInterfaceInterfaceNameGetUnauthorized with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameGetUnauthorized() *DataCocsnInterfacesInterfaceInterfaceNameGetUnauthorized { + + return &DataCocsnInterfacesInterfaceInterfaceNameGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnInterfacesInterfaceInterfaceNameGetNotFoundCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameGetNotFound +const DataCocsnInterfacesInterfaceInterfaceNameGetNotFoundCode int = 404 + +/*DataCocsnInterfacesInterfaceInterfaceNameGetNotFound Not Found + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameGetNotFound +*/ +type DataCocsnInterfacesInterfaceInterfaceNameGetNotFound struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameGetNotFound creates DataCocsnInterfacesInterfaceInterfaceNameGetNotFound with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameGetNotFound() *DataCocsnInterfacesInterfaceInterfaceNameGetNotFound { + + return &DataCocsnInterfacesInterfaceInterfaceNameGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnInterfacesInterfaceInterfaceNameGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameGetMethodNotAllowed +const DataCocsnInterfacesInterfaceInterfaceNameGetMethodNotAllowedCode int = 405 + +/*DataCocsnInterfacesInterfaceInterfaceNameGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameGetMethodNotAllowed +*/ +type DataCocsnInterfacesInterfaceInterfaceNameGetMethodNotAllowed struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameGetMethodNotAllowed creates DataCocsnInterfacesInterfaceInterfaceNameGetMethodNotAllowed with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameGetMethodNotAllowed() *DataCocsnInterfacesInterfaceInterfaceNameGetMethodNotAllowed { + + return &DataCocsnInterfacesInterfaceInterfaceNameGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnInterfacesInterfaceInterfaceNameGetConflictCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameGetConflict +const DataCocsnInterfacesInterfaceInterfaceNameGetConflictCode int = 409 + +/*DataCocsnInterfacesInterfaceInterfaceNameGetConflict Conflict + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameGetConflict +*/ +type DataCocsnInterfacesInterfaceInterfaceNameGetConflict struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameGetConflict creates DataCocsnInterfacesInterfaceInterfaceNameGetConflict with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameGetConflict() *DataCocsnInterfacesInterfaceInterfaceNameGetConflict { + + return &DataCocsnInterfacesInterfaceInterfaceNameGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..1e1103e2c6b30e9fc3e4b4b95c1fe188fde63c18 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_get_urlbuilder.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DataCocsnInterfacesInterfaceInterfaceNameGetURL generates an URL for the data cocsn interfaces interface interface name get operation +type DataCocsnInterfacesInterfaceInterfaceNameGetURL struct { + InterfaceName string + + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetURL) WithBasePath(bp string) *DataCocsnInterfacesInterfaceInterfaceNameGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:interfaces/interface={interface-name}" + + interfaceName := o.InterfaceName + if interfaceName != "" { + _path = strings.Replace(_path, "{interface-name}", interfaceName, -1) + } else { + return nil, errors.New("interfaceName is required on DataCocsnInterfacesInterfaceInterfaceNameGetURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnInterfacesInterfaceInterfaceNameGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnInterfacesInterfaceInterfaceNameGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnInterfacesInterfaceInterfaceNameGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_name_get.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_name_get.go new file mode 100644 index 0000000000000000000000000000000000000000..7eb5031e81be5ee883f5abbfaafb6cf8be0bc8af --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_name_get.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnInterfacesInterfaceInterfaceNameNameGetHandlerFunc turns a function with the right signature into a data cocsn interfaces interface interface name name get handler +type DataCocsnInterfacesInterfaceInterfaceNameNameGetHandlerFunc func(DataCocsnInterfacesInterfaceInterfaceNameNameGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnInterfacesInterfaceInterfaceNameNameGetHandlerFunc) Handle(params DataCocsnInterfacesInterfaceInterfaceNameNameGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnInterfacesInterfaceInterfaceNameNameGetHandler interface for that can handle valid data cocsn interfaces interface interface name name get params +type DataCocsnInterfacesInterfaceInterfaceNameNameGetHandler interface { + Handle(DataCocsnInterfacesInterfaceInterfaceNameNameGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameNameGet creates a new http.Handler for the data cocsn interfaces interface interface name name get operation +func NewDataCocsnInterfacesInterfaceInterfaceNameNameGet(ctx *middleware.Context, handler DataCocsnInterfacesInterfaceInterfaceNameNameGetHandler) *DataCocsnInterfacesInterfaceInterfaceNameNameGet { + return &DataCocsnInterfacesInterfaceInterfaceNameNameGet{Context: ctx, Handler: handler} +} + +/*DataCocsnInterfacesInterfaceInterfaceNameNameGet swagger:route GET /data/cocsn:interfaces/interface={interface-name}/name data get dataCocsnInterfacesInterfaceInterfaceNameNameGet + +Interface name. Example value: en0 + +Interface name. Example value: en0 + +*/ +type DataCocsnInterfacesInterfaceInterfaceNameNameGet struct { + Context *middleware.Context + Handler DataCocsnInterfacesInterfaceInterfaceNameNameGetHandler +} + +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnInterfacesInterfaceInterfaceNameNameGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_name_get_parameters.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_name_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c036b05d59b59343c672413df22bf376f65f7f34 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_name_get_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnInterfacesInterfaceInterfaceNameNameGetParams creates a new DataCocsnInterfacesInterfaceInterfaceNameNameGetParams object +// with the default values initialized. +func NewDataCocsnInterfacesInterfaceInterfaceNameNameGetParams() DataCocsnInterfacesInterfaceInterfaceNameNameGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnInterfacesInterfaceInterfaceNameNameGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnInterfacesInterfaceInterfaceNameNameGetParams contains all the bound params for the data cocsn interfaces interface interface name name get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_interfaces_interface_interface_name_name_get +type DataCocsnInterfacesInterfaceInterfaceNameNameGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*Interface name. Example value: en0 + Required: true + In: path + */ + InterfaceName string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnInterfacesInterfaceInterfaceNameNameGetParams() beforehand. +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + rInterfaceName, rhkInterfaceName, _ := route.Params.GetOK("interface-name") + if err := o.bindInterfaceName(rInterfaceName, rhkInterfaceName, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnInterfacesInterfaceInterfaceNameNameGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindInterfaceName binds and validates parameter InterfaceName from path. +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetParams) bindInterfaceName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.InterfaceName = raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnInterfacesInterfaceInterfaceNameNameGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_name_get_responses.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_name_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..ca3370a48fc81a4d10e8b1eef7c829fea8216c0c --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_name_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnInterfacesInterfaceInterfaceNameNameGetOKCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameNameGetOK +const DataCocsnInterfacesInterfaceInterfaceNameNameGetOKCode int = 200 + +/*DataCocsnInterfacesInterfaceInterfaceNameNameGetOK Interface name. Example value: en0 + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameNameGetOK +*/ +type DataCocsnInterfacesInterfaceInterfaceNameNameGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnInterfacesInterfaceInterfaceNameName `json:"body,omitempty"` +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameNameGetOK creates DataCocsnInterfacesInterfaceInterfaceNameNameGetOK with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameNameGetOK() *DataCocsnInterfacesInterfaceInterfaceNameNameGetOK { + + return &DataCocsnInterfacesInterfaceInterfaceNameNameGetOK{} +} + +// WithPayload adds the payload to the data cocsn interfaces interface interface name name get o k response +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetOK) WithPayload(payload *models.DataCocsnInterfacesInterfaceInterfaceNameName) *DataCocsnInterfacesInterfaceInterfaceNameNameGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn interfaces interface interface name name get o k response +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetOK) SetPayload(payload *models.DataCocsnInterfacesInterfaceInterfaceNameName) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnInterfacesInterfaceInterfaceNameNameGetNoContentCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameNameGetNoContent +const DataCocsnInterfacesInterfaceInterfaceNameNameGetNoContentCode int = 204 + +/*DataCocsnInterfacesInterfaceInterfaceNameNameGetNoContent No Content + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameNameGetNoContent +*/ +type DataCocsnInterfacesInterfaceInterfaceNameNameGetNoContent struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameNameGetNoContent creates DataCocsnInterfacesInterfaceInterfaceNameNameGetNoContent with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameNameGetNoContent() *DataCocsnInterfacesInterfaceInterfaceNameNameGetNoContent { + + return &DataCocsnInterfacesInterfaceInterfaceNameNameGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnInterfacesInterfaceInterfaceNameNameGetBadRequestCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameNameGetBadRequest +const DataCocsnInterfacesInterfaceInterfaceNameNameGetBadRequestCode int = 400 + +/*DataCocsnInterfacesInterfaceInterfaceNameNameGetBadRequest Bad Request + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameNameGetBadRequest +*/ +type DataCocsnInterfacesInterfaceInterfaceNameNameGetBadRequest struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameNameGetBadRequest creates DataCocsnInterfacesInterfaceInterfaceNameNameGetBadRequest with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameNameGetBadRequest() *DataCocsnInterfacesInterfaceInterfaceNameNameGetBadRequest { + + return &DataCocsnInterfacesInterfaceInterfaceNameNameGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnInterfacesInterfaceInterfaceNameNameGetUnauthorizedCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameNameGetUnauthorized +const DataCocsnInterfacesInterfaceInterfaceNameNameGetUnauthorizedCode int = 401 + +/*DataCocsnInterfacesInterfaceInterfaceNameNameGetUnauthorized Unauthorized + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameNameGetUnauthorized +*/ +type DataCocsnInterfacesInterfaceInterfaceNameNameGetUnauthorized struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameNameGetUnauthorized creates DataCocsnInterfacesInterfaceInterfaceNameNameGetUnauthorized with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameNameGetUnauthorized() *DataCocsnInterfacesInterfaceInterfaceNameNameGetUnauthorized { + + return &DataCocsnInterfacesInterfaceInterfaceNameNameGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnInterfacesInterfaceInterfaceNameNameGetNotFoundCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameNameGetNotFound +const DataCocsnInterfacesInterfaceInterfaceNameNameGetNotFoundCode int = 404 + +/*DataCocsnInterfacesInterfaceInterfaceNameNameGetNotFound Not Found + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameNameGetNotFound +*/ +type DataCocsnInterfacesInterfaceInterfaceNameNameGetNotFound struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameNameGetNotFound creates DataCocsnInterfacesInterfaceInterfaceNameNameGetNotFound with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameNameGetNotFound() *DataCocsnInterfacesInterfaceInterfaceNameNameGetNotFound { + + return &DataCocsnInterfacesInterfaceInterfaceNameNameGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnInterfacesInterfaceInterfaceNameNameGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameNameGetMethodNotAllowed +const DataCocsnInterfacesInterfaceInterfaceNameNameGetMethodNotAllowedCode int = 405 + +/*DataCocsnInterfacesInterfaceInterfaceNameNameGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameNameGetMethodNotAllowed +*/ +type DataCocsnInterfacesInterfaceInterfaceNameNameGetMethodNotAllowed struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameNameGetMethodNotAllowed creates DataCocsnInterfacesInterfaceInterfaceNameNameGetMethodNotAllowed with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameNameGetMethodNotAllowed() *DataCocsnInterfacesInterfaceInterfaceNameNameGetMethodNotAllowed { + + return &DataCocsnInterfacesInterfaceInterfaceNameNameGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnInterfacesInterfaceInterfaceNameNameGetConflictCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameNameGetConflict +const DataCocsnInterfacesInterfaceInterfaceNameNameGetConflictCode int = 409 + +/*DataCocsnInterfacesInterfaceInterfaceNameNameGetConflict Conflict + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameNameGetConflict +*/ +type DataCocsnInterfacesInterfaceInterfaceNameNameGetConflict struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameNameGetConflict creates DataCocsnInterfacesInterfaceInterfaceNameNameGetConflict with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameNameGetConflict() *DataCocsnInterfacesInterfaceInterfaceNameNameGetConflict { + + return &DataCocsnInterfacesInterfaceInterfaceNameNameGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_name_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_name_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..0dfab86cd94b9163fc33493113be6415a8248227 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_name_get_urlbuilder.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DataCocsnInterfacesInterfaceInterfaceNameNameGetURL generates an URL for the data cocsn interfaces interface interface name name get operation +type DataCocsnInterfacesInterfaceInterfaceNameNameGetURL struct { + InterfaceName string + + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetURL) WithBasePath(bp string) *DataCocsnInterfacesInterfaceInterfaceNameNameGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:interfaces/interface={interface-name}/name" + + interfaceName := o.InterfaceName + if interfaceName != "" { + _path = strings.Replace(_path, "{interface-name}", interfaceName, -1) + } else { + return nil, errors.New("interfaceName is required on DataCocsnInterfacesInterfaceInterfaceNameNameGetURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnInterfacesInterfaceInterfaceNameNameGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnInterfacesInterfaceInterfaceNameNameGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnInterfacesInterfaceInterfaceNameNameGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_oper_status_get.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_oper_status_get.go new file mode 100644 index 0000000000000000000000000000000000000000..dd27b070a7bfa46471088272cdc021c89745eeed --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_oper_status_get.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetHandlerFunc turns a function with the right signature into a data cocsn interfaces interface interface name oper status get handler +type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetHandlerFunc func(DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetHandlerFunc) Handle(params DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetHandler interface for that can handle valid data cocsn interfaces interface interface name oper status get params +type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetHandler interface { + Handle(DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGet creates a new http.Handler for the data cocsn interfaces interface interface name oper status get operation +func NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGet(ctx *middleware.Context, handler DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetHandler) *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGet { + return &DataCocsnInterfacesInterfaceInterfaceNameOperStatusGet{Context: ctx, Handler: handler} +} + +/*DataCocsnInterfacesInterfaceInterfaceNameOperStatusGet swagger:route GET /data/cocsn:interfaces/interface={interface-name}/oper-status data get dataCocsnInterfacesInterfaceInterfaceNameOperStatusGet + +Describes whether the interface is physically up or down + +Describes whether the interface is physically up or down + +*/ +type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGet struct { + Context *middleware.Context + Handler DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetHandler +} + +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_oper_status_get_parameters.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_oper_status_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a9e306e2e1a825d803d65689faa61e13345bd0bf --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_oper_status_get_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams creates a new DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams object +// with the default values initialized. +func NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams() DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams contains all the bound params for the data cocsn interfaces interface interface name oper status get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_interfaces_interface_interface_name_oper_status_get +type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*Interface name. Example value: en0 + Required: true + In: path + */ + InterfaceName string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams() beforehand. +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + rInterfaceName, rhkInterfaceName, _ := route.Params.GetOK("interface-name") + if err := o.bindInterfaceName(rInterfaceName, rhkInterfaceName, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindInterfaceName binds and validates parameter InterfaceName from path. +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams) bindInterfaceName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.InterfaceName = raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_oper_status_get_responses.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_oper_status_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..0629296fef45bd89ec8b861e34ea200d5f7059b5 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_oper_status_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetOKCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetOK +const DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetOKCode int = 200 + +/*DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetOK Describes whether the interface is physically up or down + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameOperStatusGetOK +*/ +type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnInterfacesInterfaceInterfaceNameOperStatus `json:"body,omitempty"` +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetOK creates DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetOK with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetOK() *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetOK { + + return &DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetOK{} +} + +// WithPayload adds the payload to the data cocsn interfaces interface interface name oper status get o k response +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetOK) WithPayload(payload *models.DataCocsnInterfacesInterfaceInterfaceNameOperStatus) *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn interfaces interface interface name oper status get o k response +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetOK) SetPayload(payload *models.DataCocsnInterfacesInterfaceInterfaceNameOperStatus) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNoContentCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNoContent +const DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNoContentCode int = 204 + +/*DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNoContent No Content + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNoContent +*/ +type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNoContent struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNoContent creates DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNoContent with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNoContent() *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNoContent { + + return &DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetBadRequestCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetBadRequest +const DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetBadRequestCode int = 400 + +/*DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetBadRequest Bad Request + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameOperStatusGetBadRequest +*/ +type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetBadRequest struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetBadRequest creates DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetBadRequest with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetBadRequest() *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetBadRequest { + + return &DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetUnauthorizedCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetUnauthorized +const DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetUnauthorizedCode int = 401 + +/*DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetUnauthorized Unauthorized + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameOperStatusGetUnauthorized +*/ +type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetUnauthorized struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetUnauthorized creates DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetUnauthorized with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetUnauthorized() *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetUnauthorized { + + return &DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNotFoundCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNotFound +const DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNotFoundCode int = 404 + +/*DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNotFound Not Found + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNotFound +*/ +type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNotFound struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNotFound creates DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNotFound with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNotFound() *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNotFound { + + return &DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetMethodNotAllowed +const DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetMethodNotAllowedCode int = 405 + +/*DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameOperStatusGetMethodNotAllowed +*/ +type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetMethodNotAllowed struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetMethodNotAllowed creates DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetMethodNotAllowed with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetMethodNotAllowed() *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetMethodNotAllowed { + + return &DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetConflictCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetConflict +const DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetConflictCode int = 409 + +/*DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetConflict Conflict + +swagger:response dataCocsnInterfacesInterfaceInterfaceNameOperStatusGetConflict +*/ +type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetConflict struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetConflict creates DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetConflict with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNameOperStatusGetConflict() *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetConflict { + + return &DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_oper_status_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_oper_status_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..6e4d274a5fd38790bd8600d3e488e81b4c5449c2 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_oper_status_get_urlbuilder.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetURL generates an URL for the data cocsn interfaces interface interface name oper status get operation +type DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetURL struct { + InterfaceName string + + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetURL) WithBasePath(bp string) *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:interfaces/interface={interface-name}/oper-status" + + interfaceName := o.InterfaceName + if interfaceName != "" { + _path = strings.Replace(_path, "{interface-name}", interfaceName, -1) + } else { + return nil, errors.New("interfaceName is required on DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnInterfacesInterfaceInterfaceNameOperStatusGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_phys_address_get.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_phys_address_get.go new file mode 100644 index 0000000000000000000000000000000000000000..2c0f27c42cd5d74d91146fef956127da11f37f97 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_phys_address_get.go @@ -0,0 +1,85 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetHandlerFunc turns a function with the right signature into a data cocsn interfaces interface interface name phys address get handler +type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetHandlerFunc func(DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetHandlerFunc) Handle(params DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetHandler interface for that can handle valid data cocsn interfaces interface interface name phys address get params +type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetHandler interface { + Handle(DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGet creates a new http.Handler for the data cocsn interfaces interface interface name phys address get operation +func NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGet(ctx *middleware.Context, handler DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetHandler) *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGet { + return &DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGet{Context: ctx, Handler: handler} +} + +/*DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGet swagger:route GET /data/cocsn:interfaces/interface={interface-name}/phys-address data get dataCocsnInterfacesInterfaceInterfaceNamePhysAddressGet + +The interface's address at its protocol sub-layer. For +example, for an 802.x interface, this object normally +contains a Media Access Control (MAC) address. The +interface's media-specific modules must define the bit +and byte ordering and the format of the value of this +object. For interfaces that do not have such an address +(e.g., a serial line), this node is not present. + +The interface's address at its protocol sub-layer. For +example, for an 802.x interface, this object normally +contains a Media Access Control (MAC) address. The +interface's media-specific modules must define the bit +and byte ordering and the format of the value of this +object. For interfaces that do not have such an address +(e.g., a serial line), this node is not present. + +*/ +type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGet struct { + Context *middleware.Context + Handler DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetHandler +} + +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_phys_address_get_parameters.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_phys_address_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..bba1dd07b267f267d833f31a133f8d237a4aae2d --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_phys_address_get_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams creates a new DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams object +// with the default values initialized. +func NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams() DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams contains all the bound params for the data cocsn interfaces interface interface name phys address get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_interfaces_interface_interface_name_phys_address_get +type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*Interface name. Example value: en0 + Required: true + In: path + */ + InterfaceName string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams() beforehand. +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + rInterfaceName, rhkInterfaceName, _ := route.Params.GetOK("interface-name") + if err := o.bindInterfaceName(rInterfaceName, rhkInterfaceName, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindInterfaceName binds and validates parameter InterfaceName from path. +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams) bindInterfaceName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.InterfaceName = raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_phys_address_get_responses.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_phys_address_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..fdc238e54f584b9149b3bf80937e5bc9a8f5da22 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_phys_address_get_responses.go @@ -0,0 +1,208 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetOKCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetOK +const DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetOKCode int = 200 + +/*DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetOK The interface's address at its protocol sub-layer. For +example, for an 802.x interface, this object normally +contains a Media Access Control (MAC) address. The +interface's media-specific modules must define the bit +and byte ordering and the format of the value of this +object. For interfaces that do not have such an address +(e.g., a serial line), this node is not present. + +swagger:response dataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetOK +*/ +type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnInterfacesInterfaceInterfaceNamePhysAddress `json:"body,omitempty"` +} + +// NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetOK creates DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetOK with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetOK() *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetOK { + + return &DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetOK{} +} + +// WithPayload adds the payload to the data cocsn interfaces interface interface name phys address get o k response +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetOK) WithPayload(payload *models.DataCocsnInterfacesInterfaceInterfaceNamePhysAddress) *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn interfaces interface interface name phys address get o k response +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetOK) SetPayload(payload *models.DataCocsnInterfacesInterfaceInterfaceNamePhysAddress) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNoContentCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNoContent +const DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNoContentCode int = 204 + +/*DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNoContent No Content + +swagger:response dataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNoContent +*/ +type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNoContent struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNoContent creates DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNoContent with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNoContent() *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNoContent { + + return &DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetBadRequestCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetBadRequest +const DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetBadRequestCode int = 400 + +/*DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetBadRequest Bad Request + +swagger:response dataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetBadRequest +*/ +type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetBadRequest struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetBadRequest creates DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetBadRequest with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetBadRequest() *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetBadRequest { + + return &DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetUnauthorizedCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetUnauthorized +const DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetUnauthorizedCode int = 401 + +/*DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetUnauthorized Unauthorized + +swagger:response dataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetUnauthorized +*/ +type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetUnauthorized struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetUnauthorized creates DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetUnauthorized with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetUnauthorized() *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetUnauthorized { + + return &DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNotFoundCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNotFound +const DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNotFoundCode int = 404 + +/*DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNotFound Not Found + +swagger:response dataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNotFound +*/ +type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNotFound struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNotFound creates DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNotFound with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNotFound() *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNotFound { + + return &DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetMethodNotAllowed +const DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetMethodNotAllowedCode int = 405 + +/*DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetMethodNotAllowed +*/ +type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetMethodNotAllowed struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetMethodNotAllowed creates DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetMethodNotAllowed with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetMethodNotAllowed() *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetMethodNotAllowed { + + return &DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetConflictCode is the HTTP code returned for type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetConflict +const DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetConflictCode int = 409 + +/*DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetConflict Conflict + +swagger:response dataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetConflict +*/ +type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetConflict struct { +} + +// NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetConflict creates DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetConflict with default headers values +func NewDataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetConflict() *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetConflict { + + return &DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_phys_address_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_phys_address_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..c838dd0ee35ac1d35fab01035d2f4c1718ca58f9 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_interface_interface_name_phys_address_get_urlbuilder.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetURL generates an URL for the data cocsn interfaces interface interface name phys address get operation +type DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetURL struct { + InterfaceName string + + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetURL) WithBasePath(bp string) *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:interfaces/interface={interface-name}/phys-address" + + interfaceName := o.InterfaceName + if interfaceName != "" { + _path = strings.Replace(_path, "{interface-name}", interfaceName, -1) + } else { + return nil, errors.New("interfaceName is required on DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnInterfacesInterfaceInterfaceNamePhysAddressGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_patch.go b/api/restapi/operations/data/data_cocsn_interfaces_patch.go new file mode 100644 index 0000000000000000000000000000000000000000..802d8ebc2dc365ed224b3c827175b22ed86adb84 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_patch.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnInterfacesPatchHandlerFunc turns a function with the right signature into a data cocsn interfaces patch handler +type DataCocsnInterfacesPatchHandlerFunc func(DataCocsnInterfacesPatchParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnInterfacesPatchHandlerFunc) Handle(params DataCocsnInterfacesPatchParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnInterfacesPatchHandler interface for that can handle valid data cocsn interfaces patch params +type DataCocsnInterfacesPatchHandler interface { + Handle(DataCocsnInterfacesPatchParams, interface{}) middleware.Responder +} + +// NewDataCocsnInterfacesPatch creates a new http.Handler for the data cocsn interfaces patch operation +func NewDataCocsnInterfacesPatch(ctx *middleware.Context, handler DataCocsnInterfacesPatchHandler) *DataCocsnInterfacesPatch { + return &DataCocsnInterfacesPatch{Context: ctx, Handler: handler} +} + +/*DataCocsnInterfacesPatch swagger:route PATCH /data/cocsn:interfaces data patch dataCocsnInterfacesPatch + +DataCocsnInterfacesPatch data cocsn interfaces patch API + +*/ +type DataCocsnInterfacesPatch struct { + Context *middleware.Context + Handler DataCocsnInterfacesPatchHandler +} + +func (o *DataCocsnInterfacesPatch) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnInterfacesPatchParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_patch_parameters.go b/api/restapi/operations/data/data_cocsn_interfaces_patch_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..fedb501d5d4bd326137e9529bde805fbd424c7e7 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_patch_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// NewDataCocsnInterfacesPatchParams creates a new DataCocsnInterfacesPatchParams object +// no default values defined in spec. +func NewDataCocsnInterfacesPatchParams() DataCocsnInterfacesPatchParams { + + return DataCocsnInterfacesPatchParams{} +} + +// DataCocsnInterfacesPatchParams contains all the bound params for the data cocsn interfaces patch operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_interfaces_patch +type DataCocsnInterfacesPatchParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + Interfaces *models.DataCocsnInterfaces +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnInterfacesPatchParams() beforehand. +func (o *DataCocsnInterfacesPatchParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.DataCocsnInterfaces + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("interfaces", "body", "")) + } else { + res = append(res, errors.NewParseError("interfaces", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Interfaces = &body + } + } + } else { + res = append(res, errors.Required("interfaces", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_patch_responses.go b/api/restapi/operations/data/data_cocsn_interfaces_patch_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c54c72088128f679bd8a7e514c649163e2e8709d --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_patch_responses.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DataCocsnInterfacesPatchNoContentCode is the HTTP code returned for type DataCocsnInterfacesPatchNoContent +const DataCocsnInterfacesPatchNoContentCode int = 204 + +/*DataCocsnInterfacesPatchNoContent container interfaces updated + +swagger:response dataCocsnInterfacesPatchNoContent +*/ +type DataCocsnInterfacesPatchNoContent struct { +} + +// NewDataCocsnInterfacesPatchNoContent creates DataCocsnInterfacesPatchNoContent with default headers values +func NewDataCocsnInterfacesPatchNoContent() *DataCocsnInterfacesPatchNoContent { + + return &DataCocsnInterfacesPatchNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPatchNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnInterfacesPatchBadRequestCode is the HTTP code returned for type DataCocsnInterfacesPatchBadRequest +const DataCocsnInterfacesPatchBadRequestCode int = 400 + +/*DataCocsnInterfacesPatchBadRequest Bad Request + +swagger:response dataCocsnInterfacesPatchBadRequest +*/ +type DataCocsnInterfacesPatchBadRequest struct { +} + +// NewDataCocsnInterfacesPatchBadRequest creates DataCocsnInterfacesPatchBadRequest with default headers values +func NewDataCocsnInterfacesPatchBadRequest() *DataCocsnInterfacesPatchBadRequest { + + return &DataCocsnInterfacesPatchBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPatchBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnInterfacesPatchUnauthorizedCode is the HTTP code returned for type DataCocsnInterfacesPatchUnauthorized +const DataCocsnInterfacesPatchUnauthorizedCode int = 401 + +/*DataCocsnInterfacesPatchUnauthorized Unauthorized + +swagger:response dataCocsnInterfacesPatchUnauthorized +*/ +type DataCocsnInterfacesPatchUnauthorized struct { +} + +// NewDataCocsnInterfacesPatchUnauthorized creates DataCocsnInterfacesPatchUnauthorized with default headers values +func NewDataCocsnInterfacesPatchUnauthorized() *DataCocsnInterfacesPatchUnauthorized { + + return &DataCocsnInterfacesPatchUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPatchUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnInterfacesPatchNotFoundCode is the HTTP code returned for type DataCocsnInterfacesPatchNotFound +const DataCocsnInterfacesPatchNotFoundCode int = 404 + +/*DataCocsnInterfacesPatchNotFound Not Found + +swagger:response dataCocsnInterfacesPatchNotFound +*/ +type DataCocsnInterfacesPatchNotFound struct { +} + +// NewDataCocsnInterfacesPatchNotFound creates DataCocsnInterfacesPatchNotFound with default headers values +func NewDataCocsnInterfacesPatchNotFound() *DataCocsnInterfacesPatchNotFound { + + return &DataCocsnInterfacesPatchNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPatchNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnInterfacesPatchMethodNotAllowedCode is the HTTP code returned for type DataCocsnInterfacesPatchMethodNotAllowed +const DataCocsnInterfacesPatchMethodNotAllowedCode int = 405 + +/*DataCocsnInterfacesPatchMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnInterfacesPatchMethodNotAllowed +*/ +type DataCocsnInterfacesPatchMethodNotAllowed struct { +} + +// NewDataCocsnInterfacesPatchMethodNotAllowed creates DataCocsnInterfacesPatchMethodNotAllowed with default headers values +func NewDataCocsnInterfacesPatchMethodNotAllowed() *DataCocsnInterfacesPatchMethodNotAllowed { + + return &DataCocsnInterfacesPatchMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPatchMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnInterfacesPatchConflictCode is the HTTP code returned for type DataCocsnInterfacesPatchConflict +const DataCocsnInterfacesPatchConflictCode int = 409 + +/*DataCocsnInterfacesPatchConflict Conflict + +swagger:response dataCocsnInterfacesPatchConflict +*/ +type DataCocsnInterfacesPatchConflict struct { +} + +// NewDataCocsnInterfacesPatchConflict creates DataCocsnInterfacesPatchConflict with default headers values +func NewDataCocsnInterfacesPatchConflict() *DataCocsnInterfacesPatchConflict { + + return &DataCocsnInterfacesPatchConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPatchConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_patch_urlbuilder.go b/api/restapi/operations/data/data_cocsn_interfaces_patch_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..7e3bbf6dc579c527f434734c9dd44c3ceece3e88 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_patch_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// DataCocsnInterfacesPatchURL generates an URL for the data cocsn interfaces patch operation +type DataCocsnInterfacesPatchURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesPatchURL) WithBasePath(bp string) *DataCocsnInterfacesPatchURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesPatchURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnInterfacesPatchURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:interfaces" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnInterfacesPatchURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnInterfacesPatchURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnInterfacesPatchURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnInterfacesPatchURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnInterfacesPatchURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnInterfacesPatchURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_post.go b/api/restapi/operations/data/data_cocsn_interfaces_post.go new file mode 100644 index 0000000000000000000000000000000000000000..8d72bde035589fa70e72228af787e3f9b9f5db35 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_post.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnInterfacesPostHandlerFunc turns a function with the right signature into a data cocsn interfaces post handler +type DataCocsnInterfacesPostHandlerFunc func(DataCocsnInterfacesPostParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnInterfacesPostHandlerFunc) Handle(params DataCocsnInterfacesPostParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnInterfacesPostHandler interface for that can handle valid data cocsn interfaces post params +type DataCocsnInterfacesPostHandler interface { + Handle(DataCocsnInterfacesPostParams, interface{}) middleware.Responder +} + +// NewDataCocsnInterfacesPost creates a new http.Handler for the data cocsn interfaces post operation +func NewDataCocsnInterfacesPost(ctx *middleware.Context, handler DataCocsnInterfacesPostHandler) *DataCocsnInterfacesPost { + return &DataCocsnInterfacesPost{Context: ctx, Handler: handler} +} + +/*DataCocsnInterfacesPost swagger:route POST /data/cocsn:interfaces data post dataCocsnInterfacesPost + +DataCocsnInterfacesPost data cocsn interfaces post API + +*/ +type DataCocsnInterfacesPost struct { + Context *middleware.Context + Handler DataCocsnInterfacesPostHandler +} + +func (o *DataCocsnInterfacesPost) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnInterfacesPostParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_post_parameters.go b/api/restapi/operations/data/data_cocsn_interfaces_post_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b1efaafd4630fa311213af5914655576a7a75949 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_post_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// NewDataCocsnInterfacesPostParams creates a new DataCocsnInterfacesPostParams object +// no default values defined in spec. +func NewDataCocsnInterfacesPostParams() DataCocsnInterfacesPostParams { + + return DataCocsnInterfacesPostParams{} +} + +// DataCocsnInterfacesPostParams contains all the bound params for the data cocsn interfaces post operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_interfaces_post +type DataCocsnInterfacesPostParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + Interfaces *models.DataCocsnInterfacesPost +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnInterfacesPostParams() beforehand. +func (o *DataCocsnInterfacesPostParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.DataCocsnInterfacesPost + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("interfaces", "body", "")) + } else { + res = append(res, errors.NewParseError("interfaces", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Interfaces = &body + } + } + } else { + res = append(res, errors.Required("interfaces", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_post_responses.go b/api/restapi/operations/data/data_cocsn_interfaces_post_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..ffe7b77e036beca7a02a63cc2264aeb312069979 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_post_responses.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DataCocsnInterfacesPostCreatedCode is the HTTP code returned for type DataCocsnInterfacesPostCreated +const DataCocsnInterfacesPostCreatedCode int = 201 + +/*DataCocsnInterfacesPostCreated container interfaces created + +swagger:response dataCocsnInterfacesPostCreated +*/ +type DataCocsnInterfacesPostCreated struct { +} + +// NewDataCocsnInterfacesPostCreated creates DataCocsnInterfacesPostCreated with default headers values +func NewDataCocsnInterfacesPostCreated() *DataCocsnInterfacesPostCreated { + + return &DataCocsnInterfacesPostCreated{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPostCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// DataCocsnInterfacesPostNoContentCode is the HTTP code returned for type DataCocsnInterfacesPostNoContent +const DataCocsnInterfacesPostNoContentCode int = 204 + +/*DataCocsnInterfacesPostNoContent No Content + +swagger:response dataCocsnInterfacesPostNoContent +*/ +type DataCocsnInterfacesPostNoContent struct { +} + +// NewDataCocsnInterfacesPostNoContent creates DataCocsnInterfacesPostNoContent with default headers values +func NewDataCocsnInterfacesPostNoContent() *DataCocsnInterfacesPostNoContent { + + return &DataCocsnInterfacesPostNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPostNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnInterfacesPostBadRequestCode is the HTTP code returned for type DataCocsnInterfacesPostBadRequest +const DataCocsnInterfacesPostBadRequestCode int = 400 + +/*DataCocsnInterfacesPostBadRequest Bad Request + +swagger:response dataCocsnInterfacesPostBadRequest +*/ +type DataCocsnInterfacesPostBadRequest struct { +} + +// NewDataCocsnInterfacesPostBadRequest creates DataCocsnInterfacesPostBadRequest with default headers values +func NewDataCocsnInterfacesPostBadRequest() *DataCocsnInterfacesPostBadRequest { + + return &DataCocsnInterfacesPostBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPostBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnInterfacesPostUnauthorizedCode is the HTTP code returned for type DataCocsnInterfacesPostUnauthorized +const DataCocsnInterfacesPostUnauthorizedCode int = 401 + +/*DataCocsnInterfacesPostUnauthorized Unauthorized + +swagger:response dataCocsnInterfacesPostUnauthorized +*/ +type DataCocsnInterfacesPostUnauthorized struct { +} + +// NewDataCocsnInterfacesPostUnauthorized creates DataCocsnInterfacesPostUnauthorized with default headers values +func NewDataCocsnInterfacesPostUnauthorized() *DataCocsnInterfacesPostUnauthorized { + + return &DataCocsnInterfacesPostUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPostUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnInterfacesPostNotFoundCode is the HTTP code returned for type DataCocsnInterfacesPostNotFound +const DataCocsnInterfacesPostNotFoundCode int = 404 + +/*DataCocsnInterfacesPostNotFound Not Found + +swagger:response dataCocsnInterfacesPostNotFound +*/ +type DataCocsnInterfacesPostNotFound struct { +} + +// NewDataCocsnInterfacesPostNotFound creates DataCocsnInterfacesPostNotFound with default headers values +func NewDataCocsnInterfacesPostNotFound() *DataCocsnInterfacesPostNotFound { + + return &DataCocsnInterfacesPostNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPostNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnInterfacesPostMethodNotAllowedCode is the HTTP code returned for type DataCocsnInterfacesPostMethodNotAllowed +const DataCocsnInterfacesPostMethodNotAllowedCode int = 405 + +/*DataCocsnInterfacesPostMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnInterfacesPostMethodNotAllowed +*/ +type DataCocsnInterfacesPostMethodNotAllowed struct { +} + +// NewDataCocsnInterfacesPostMethodNotAllowed creates DataCocsnInterfacesPostMethodNotAllowed with default headers values +func NewDataCocsnInterfacesPostMethodNotAllowed() *DataCocsnInterfacesPostMethodNotAllowed { + + return &DataCocsnInterfacesPostMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPostMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnInterfacesPostConflictCode is the HTTP code returned for type DataCocsnInterfacesPostConflict +const DataCocsnInterfacesPostConflictCode int = 409 + +/*DataCocsnInterfacesPostConflict Conflict + +swagger:response dataCocsnInterfacesPostConflict +*/ +type DataCocsnInterfacesPostConflict struct { +} + +// NewDataCocsnInterfacesPostConflict creates DataCocsnInterfacesPostConflict with default headers values +func NewDataCocsnInterfacesPostConflict() *DataCocsnInterfacesPostConflict { + + return &DataCocsnInterfacesPostConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPostConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_post_urlbuilder.go b/api/restapi/operations/data/data_cocsn_interfaces_post_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..b64c1c30e474819b68a4d2b0cd382ca760b6344a --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_post_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// DataCocsnInterfacesPostURL generates an URL for the data cocsn interfaces post operation +type DataCocsnInterfacesPostURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesPostURL) WithBasePath(bp string) *DataCocsnInterfacesPostURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesPostURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnInterfacesPostURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:interfaces" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnInterfacesPostURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnInterfacesPostURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnInterfacesPostURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnInterfacesPostURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnInterfacesPostURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnInterfacesPostURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_put.go b/api/restapi/operations/data/data_cocsn_interfaces_put.go new file mode 100644 index 0000000000000000000000000000000000000000..b7780360dc5693c00c939fd783a2e7a80e1e1c9e --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_put.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnInterfacesPutHandlerFunc turns a function with the right signature into a data cocsn interfaces put handler +type DataCocsnInterfacesPutHandlerFunc func(DataCocsnInterfacesPutParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnInterfacesPutHandlerFunc) Handle(params DataCocsnInterfacesPutParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnInterfacesPutHandler interface for that can handle valid data cocsn interfaces put params +type DataCocsnInterfacesPutHandler interface { + Handle(DataCocsnInterfacesPutParams, interface{}) middleware.Responder +} + +// NewDataCocsnInterfacesPut creates a new http.Handler for the data cocsn interfaces put operation +func NewDataCocsnInterfacesPut(ctx *middleware.Context, handler DataCocsnInterfacesPutHandler) *DataCocsnInterfacesPut { + return &DataCocsnInterfacesPut{Context: ctx, Handler: handler} +} + +/*DataCocsnInterfacesPut swagger:route PUT /data/cocsn:interfaces data put dataCocsnInterfacesPut + +DataCocsnInterfacesPut data cocsn interfaces put API + +*/ +type DataCocsnInterfacesPut struct { + Context *middleware.Context + Handler DataCocsnInterfacesPutHandler +} + +func (o *DataCocsnInterfacesPut) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnInterfacesPutParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_put_parameters.go b/api/restapi/operations/data/data_cocsn_interfaces_put_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..9d0f464c5e8b9ba0f3eb3ad5c2b698fcb366f996 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_put_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// NewDataCocsnInterfacesPutParams creates a new DataCocsnInterfacesPutParams object +// no default values defined in spec. +func NewDataCocsnInterfacesPutParams() DataCocsnInterfacesPutParams { + + return DataCocsnInterfacesPutParams{} +} + +// DataCocsnInterfacesPutParams contains all the bound params for the data cocsn interfaces put operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_interfaces_put +type DataCocsnInterfacesPutParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + Interfaces *models.DataCocsnInterfaces +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnInterfacesPutParams() beforehand. +func (o *DataCocsnInterfacesPutParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.DataCocsnInterfaces + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("interfaces", "body", "")) + } else { + res = append(res, errors.NewParseError("interfaces", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Interfaces = &body + } + } + } else { + res = append(res, errors.Required("interfaces", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_put_responses.go b/api/restapi/operations/data/data_cocsn_interfaces_put_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f07f2b8a3b1552992d29268a90dcd3cd04f1f00d --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_put_responses.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DataCocsnInterfacesPutCreatedCode is the HTTP code returned for type DataCocsnInterfacesPutCreated +const DataCocsnInterfacesPutCreatedCode int = 201 + +/*DataCocsnInterfacesPutCreated container interfaces created or replaced + +swagger:response dataCocsnInterfacesPutCreated +*/ +type DataCocsnInterfacesPutCreated struct { +} + +// NewDataCocsnInterfacesPutCreated creates DataCocsnInterfacesPutCreated with default headers values +func NewDataCocsnInterfacesPutCreated() *DataCocsnInterfacesPutCreated { + + return &DataCocsnInterfacesPutCreated{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPutCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// DataCocsnInterfacesPutNoContentCode is the HTTP code returned for type DataCocsnInterfacesPutNoContent +const DataCocsnInterfacesPutNoContentCode int = 204 + +/*DataCocsnInterfacesPutNoContent No Content + +swagger:response dataCocsnInterfacesPutNoContent +*/ +type DataCocsnInterfacesPutNoContent struct { +} + +// NewDataCocsnInterfacesPutNoContent creates DataCocsnInterfacesPutNoContent with default headers values +func NewDataCocsnInterfacesPutNoContent() *DataCocsnInterfacesPutNoContent { + + return &DataCocsnInterfacesPutNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPutNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnInterfacesPutBadRequestCode is the HTTP code returned for type DataCocsnInterfacesPutBadRequest +const DataCocsnInterfacesPutBadRequestCode int = 400 + +/*DataCocsnInterfacesPutBadRequest Bad Request + +swagger:response dataCocsnInterfacesPutBadRequest +*/ +type DataCocsnInterfacesPutBadRequest struct { +} + +// NewDataCocsnInterfacesPutBadRequest creates DataCocsnInterfacesPutBadRequest with default headers values +func NewDataCocsnInterfacesPutBadRequest() *DataCocsnInterfacesPutBadRequest { + + return &DataCocsnInterfacesPutBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPutBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnInterfacesPutUnauthorizedCode is the HTTP code returned for type DataCocsnInterfacesPutUnauthorized +const DataCocsnInterfacesPutUnauthorizedCode int = 401 + +/*DataCocsnInterfacesPutUnauthorized Unauthorized + +swagger:response dataCocsnInterfacesPutUnauthorized +*/ +type DataCocsnInterfacesPutUnauthorized struct { +} + +// NewDataCocsnInterfacesPutUnauthorized creates DataCocsnInterfacesPutUnauthorized with default headers values +func NewDataCocsnInterfacesPutUnauthorized() *DataCocsnInterfacesPutUnauthorized { + + return &DataCocsnInterfacesPutUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPutUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnInterfacesPutNotFoundCode is the HTTP code returned for type DataCocsnInterfacesPutNotFound +const DataCocsnInterfacesPutNotFoundCode int = 404 + +/*DataCocsnInterfacesPutNotFound Not Found + +swagger:response dataCocsnInterfacesPutNotFound +*/ +type DataCocsnInterfacesPutNotFound struct { +} + +// NewDataCocsnInterfacesPutNotFound creates DataCocsnInterfacesPutNotFound with default headers values +func NewDataCocsnInterfacesPutNotFound() *DataCocsnInterfacesPutNotFound { + + return &DataCocsnInterfacesPutNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPutNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnInterfacesPutMethodNotAllowedCode is the HTTP code returned for type DataCocsnInterfacesPutMethodNotAllowed +const DataCocsnInterfacesPutMethodNotAllowedCode int = 405 + +/*DataCocsnInterfacesPutMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnInterfacesPutMethodNotAllowed +*/ +type DataCocsnInterfacesPutMethodNotAllowed struct { +} + +// NewDataCocsnInterfacesPutMethodNotAllowed creates DataCocsnInterfacesPutMethodNotAllowed with default headers values +func NewDataCocsnInterfacesPutMethodNotAllowed() *DataCocsnInterfacesPutMethodNotAllowed { + + return &DataCocsnInterfacesPutMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPutMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnInterfacesPutConflictCode is the HTTP code returned for type DataCocsnInterfacesPutConflict +const DataCocsnInterfacesPutConflictCode int = 409 + +/*DataCocsnInterfacesPutConflict Conflict + +swagger:response dataCocsnInterfacesPutConflict +*/ +type DataCocsnInterfacesPutConflict struct { +} + +// NewDataCocsnInterfacesPutConflict creates DataCocsnInterfacesPutConflict with default headers values +func NewDataCocsnInterfacesPutConflict() *DataCocsnInterfacesPutConflict { + + return &DataCocsnInterfacesPutConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnInterfacesPutConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_interfaces_put_urlbuilder.go b/api/restapi/operations/data/data_cocsn_interfaces_put_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..6d8efa8a5c0d9b6aa18f9a496969e819f2f07957 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_interfaces_put_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// DataCocsnInterfacesPutURL generates an URL for the data cocsn interfaces put operation +type DataCocsnInterfacesPutURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesPutURL) WithBasePath(bp string) *DataCocsnInterfacesPutURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnInterfacesPutURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnInterfacesPutURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:interfaces" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnInterfacesPutURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnInterfacesPutURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnInterfacesPutURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnInterfacesPutURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnInterfacesPutURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnInterfacesPutURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_routes_delete.go b/api/restapi/operations/data/data_cocsn_routes_delete.go new file mode 100644 index 0000000000000000000000000000000000000000..a4532eee3e206e7e986bd6b453470c401c59b382 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_delete.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnRoutesDeleteHandlerFunc turns a function with the right signature into a data cocsn routes delete handler +type DataCocsnRoutesDeleteHandlerFunc func(DataCocsnRoutesDeleteParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnRoutesDeleteHandlerFunc) Handle(params DataCocsnRoutesDeleteParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnRoutesDeleteHandler interface for that can handle valid data cocsn routes delete params +type DataCocsnRoutesDeleteHandler interface { + Handle(DataCocsnRoutesDeleteParams, interface{}) middleware.Responder +} + +// NewDataCocsnRoutesDelete creates a new http.Handler for the data cocsn routes delete operation +func NewDataCocsnRoutesDelete(ctx *middleware.Context, handler DataCocsnRoutesDeleteHandler) *DataCocsnRoutesDelete { + return &DataCocsnRoutesDelete{Context: ctx, Handler: handler} +} + +/*DataCocsnRoutesDelete swagger:route DELETE /data/cocsn:routes data delete dataCocsnRoutesDelete + +DataCocsnRoutesDelete data cocsn routes delete API + +*/ +type DataCocsnRoutesDelete struct { + Context *middleware.Context + Handler DataCocsnRoutesDeleteHandler +} + +func (o *DataCocsnRoutesDelete) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnRoutesDeleteParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_routes_delete_parameters.go b/api/restapi/operations/data/data_cocsn_routes_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..96f2bddb8452b1dba601626a7ed587047f61fc57 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_delete_parameters.go @@ -0,0 +1,45 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewDataCocsnRoutesDeleteParams creates a new DataCocsnRoutesDeleteParams object +// no default values defined in spec. +func NewDataCocsnRoutesDeleteParams() DataCocsnRoutesDeleteParams { + + return DataCocsnRoutesDeleteParams{} +} + +// DataCocsnRoutesDeleteParams contains all the bound params for the data cocsn routes delete operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_routes_delete +type DataCocsnRoutesDeleteParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnRoutesDeleteParams() beforehand. +func (o *DataCocsnRoutesDeleteParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_routes_delete_responses.go b/api/restapi/operations/data/data_cocsn_routes_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..bdd918a82d4a5adc2f361734facce8dd62ed248f --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_delete_responses.go @@ -0,0 +1,36 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DataCocsnRoutesDeleteNoContentCode is the HTTP code returned for type DataCocsnRoutesDeleteNoContent +const DataCocsnRoutesDeleteNoContentCode int = 204 + +/*DataCocsnRoutesDeleteNoContent No Content + +swagger:response dataCocsnRoutesDeleteNoContent +*/ +type DataCocsnRoutesDeleteNoContent struct { +} + +// NewDataCocsnRoutesDeleteNoContent creates DataCocsnRoutesDeleteNoContent with default headers values +func NewDataCocsnRoutesDeleteNoContent() *DataCocsnRoutesDeleteNoContent { + + return &DataCocsnRoutesDeleteNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesDeleteNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} diff --git a/api/restapi/operations/data/data_cocsn_routes_delete_urlbuilder.go b/api/restapi/operations/data/data_cocsn_routes_delete_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..33ee37a1c64f51bfc9bb629569605e6d39e8d1d9 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_delete_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// DataCocsnRoutesDeleteURL generates an URL for the data cocsn routes delete operation +type DataCocsnRoutesDeleteURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesDeleteURL) WithBasePath(bp string) *DataCocsnRoutesDeleteURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesDeleteURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnRoutesDeleteURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:routes" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnRoutesDeleteURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnRoutesDeleteURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnRoutesDeleteURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnRoutesDeleteURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnRoutesDeleteURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnRoutesDeleteURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_routes_get.go b/api/restapi/operations/data/data_cocsn_routes_get.go new file mode 100644 index 0000000000000000000000000000000000000000..1e9a4cad4d27d1135790a09698870cd6cbccbfcf --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_get.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnRoutesGetHandlerFunc turns a function with the right signature into a data cocsn routes get handler +type DataCocsnRoutesGetHandlerFunc func(DataCocsnRoutesGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnRoutesGetHandlerFunc) Handle(params DataCocsnRoutesGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnRoutesGetHandler interface for that can handle valid data cocsn routes get params +type DataCocsnRoutesGetHandler interface { + Handle(DataCocsnRoutesGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnRoutesGet creates a new http.Handler for the data cocsn routes get operation +func NewDataCocsnRoutesGet(ctx *middleware.Context, handler DataCocsnRoutesGetHandler) *DataCocsnRoutesGet { + return &DataCocsnRoutesGet{Context: ctx, Handler: handler} +} + +/*DataCocsnRoutesGet swagger:route GET /data/cocsn:routes data get dataCocsnRoutesGet + +DataCocsnRoutesGet data cocsn routes get API + +*/ +type DataCocsnRoutesGet struct { + Context *middleware.Context + Handler DataCocsnRoutesGetHandler +} + +func (o *DataCocsnRoutesGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnRoutesGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_routes_get_parameters.go b/api/restapi/operations/data/data_cocsn_routes_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..566ed9e6e4c05ef62b4f0081b213e22782f7eb87 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_get_parameters.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnRoutesGetParams creates a new DataCocsnRoutesGetParams object +// with the default values initialized. +func NewDataCocsnRoutesGetParams() DataCocsnRoutesGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnRoutesGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnRoutesGetParams contains all the bound params for the data cocsn routes get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_routes_get +type DataCocsnRoutesGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnRoutesGetParams() beforehand. +func (o *DataCocsnRoutesGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnRoutesGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnRoutesGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnRoutesGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnRoutesGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnRoutesGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnRoutesGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnRoutesGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnRoutesGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnRoutesGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_routes_get_responses.go b/api/restapi/operations/data/data_cocsn_routes_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..d9162bd5972eca9165dcc6401d6bc78476b78286 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnRoutesGetOKCode is the HTTP code returned for type DataCocsnRoutesGetOK +const DataCocsnRoutesGetOKCode int = 200 + +/*DataCocsnRoutesGetOK OK + +swagger:response dataCocsnRoutesGetOK +*/ +type DataCocsnRoutesGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnRoutes `json:"body,omitempty"` +} + +// NewDataCocsnRoutesGetOK creates DataCocsnRoutesGetOK with default headers values +func NewDataCocsnRoutesGetOK() *DataCocsnRoutesGetOK { + + return &DataCocsnRoutesGetOK{} +} + +// WithPayload adds the payload to the data cocsn routes get o k response +func (o *DataCocsnRoutesGetOK) WithPayload(payload *models.DataCocsnRoutes) *DataCocsnRoutesGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn routes get o k response +func (o *DataCocsnRoutesGetOK) SetPayload(payload *models.DataCocsnRoutes) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnRoutesGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnRoutesGetNoContentCode is the HTTP code returned for type DataCocsnRoutesGetNoContent +const DataCocsnRoutesGetNoContentCode int = 204 + +/*DataCocsnRoutesGetNoContent No Content + +swagger:response dataCocsnRoutesGetNoContent +*/ +type DataCocsnRoutesGetNoContent struct { +} + +// NewDataCocsnRoutesGetNoContent creates DataCocsnRoutesGetNoContent with default headers values +func NewDataCocsnRoutesGetNoContent() *DataCocsnRoutesGetNoContent { + + return &DataCocsnRoutesGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnRoutesGetBadRequestCode is the HTTP code returned for type DataCocsnRoutesGetBadRequest +const DataCocsnRoutesGetBadRequestCode int = 400 + +/*DataCocsnRoutesGetBadRequest Bad Request + +swagger:response dataCocsnRoutesGetBadRequest +*/ +type DataCocsnRoutesGetBadRequest struct { +} + +// NewDataCocsnRoutesGetBadRequest creates DataCocsnRoutesGetBadRequest with default headers values +func NewDataCocsnRoutesGetBadRequest() *DataCocsnRoutesGetBadRequest { + + return &DataCocsnRoutesGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnRoutesGetUnauthorizedCode is the HTTP code returned for type DataCocsnRoutesGetUnauthorized +const DataCocsnRoutesGetUnauthorizedCode int = 401 + +/*DataCocsnRoutesGetUnauthorized Unauthorized + +swagger:response dataCocsnRoutesGetUnauthorized +*/ +type DataCocsnRoutesGetUnauthorized struct { +} + +// NewDataCocsnRoutesGetUnauthorized creates DataCocsnRoutesGetUnauthorized with default headers values +func NewDataCocsnRoutesGetUnauthorized() *DataCocsnRoutesGetUnauthorized { + + return &DataCocsnRoutesGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnRoutesGetNotFoundCode is the HTTP code returned for type DataCocsnRoutesGetNotFound +const DataCocsnRoutesGetNotFoundCode int = 404 + +/*DataCocsnRoutesGetNotFound Not Found + +swagger:response dataCocsnRoutesGetNotFound +*/ +type DataCocsnRoutesGetNotFound struct { +} + +// NewDataCocsnRoutesGetNotFound creates DataCocsnRoutesGetNotFound with default headers values +func NewDataCocsnRoutesGetNotFound() *DataCocsnRoutesGetNotFound { + + return &DataCocsnRoutesGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnRoutesGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnRoutesGetMethodNotAllowed +const DataCocsnRoutesGetMethodNotAllowedCode int = 405 + +/*DataCocsnRoutesGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnRoutesGetMethodNotAllowed +*/ +type DataCocsnRoutesGetMethodNotAllowed struct { +} + +// NewDataCocsnRoutesGetMethodNotAllowed creates DataCocsnRoutesGetMethodNotAllowed with default headers values +func NewDataCocsnRoutesGetMethodNotAllowed() *DataCocsnRoutesGetMethodNotAllowed { + + return &DataCocsnRoutesGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnRoutesGetConflictCode is the HTTP code returned for type DataCocsnRoutesGetConflict +const DataCocsnRoutesGetConflictCode int = 409 + +/*DataCocsnRoutesGetConflict Conflict + +swagger:response dataCocsnRoutesGetConflict +*/ +type DataCocsnRoutesGetConflict struct { +} + +// NewDataCocsnRoutesGetConflict creates DataCocsnRoutesGetConflict with default headers values +func NewDataCocsnRoutesGetConflict() *DataCocsnRoutesGetConflict { + + return &DataCocsnRoutesGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_routes_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_routes_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..0bb2c6696a3a95c2c16b1c898280344c5a379904 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_get_urlbuilder.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// DataCocsnRoutesGetURL generates an URL for the data cocsn routes get operation +type DataCocsnRoutesGetURL struct { + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesGetURL) WithBasePath(bp string) *DataCocsnRoutesGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnRoutesGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:routes" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnRoutesGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnRoutesGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnRoutesGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnRoutesGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnRoutesGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnRoutesGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_routes_patch.go b/api/restapi/operations/data/data_cocsn_routes_patch.go new file mode 100644 index 0000000000000000000000000000000000000000..9060fa0a53983062d349ada09920756bc5fdbaa4 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_patch.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnRoutesPatchHandlerFunc turns a function with the right signature into a data cocsn routes patch handler +type DataCocsnRoutesPatchHandlerFunc func(DataCocsnRoutesPatchParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnRoutesPatchHandlerFunc) Handle(params DataCocsnRoutesPatchParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnRoutesPatchHandler interface for that can handle valid data cocsn routes patch params +type DataCocsnRoutesPatchHandler interface { + Handle(DataCocsnRoutesPatchParams, interface{}) middleware.Responder +} + +// NewDataCocsnRoutesPatch creates a new http.Handler for the data cocsn routes patch operation +func NewDataCocsnRoutesPatch(ctx *middleware.Context, handler DataCocsnRoutesPatchHandler) *DataCocsnRoutesPatch { + return &DataCocsnRoutesPatch{Context: ctx, Handler: handler} +} + +/*DataCocsnRoutesPatch swagger:route PATCH /data/cocsn:routes data patch dataCocsnRoutesPatch + +DataCocsnRoutesPatch data cocsn routes patch API + +*/ +type DataCocsnRoutesPatch struct { + Context *middleware.Context + Handler DataCocsnRoutesPatchHandler +} + +func (o *DataCocsnRoutesPatch) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnRoutesPatchParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_routes_patch_parameters.go b/api/restapi/operations/data/data_cocsn_routes_patch_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..ce180fcf98f4041db81a1a44320744949009b74f --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_patch_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// NewDataCocsnRoutesPatchParams creates a new DataCocsnRoutesPatchParams object +// no default values defined in spec. +func NewDataCocsnRoutesPatchParams() DataCocsnRoutesPatchParams { + + return DataCocsnRoutesPatchParams{} +} + +// DataCocsnRoutesPatchParams contains all the bound params for the data cocsn routes patch operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_routes_patch +type DataCocsnRoutesPatchParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + Routes *models.DataCocsnRoutes +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnRoutesPatchParams() beforehand. +func (o *DataCocsnRoutesPatchParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.DataCocsnRoutes + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("routes", "body", "")) + } else { + res = append(res, errors.NewParseError("routes", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Routes = &body + } + } + } else { + res = append(res, errors.Required("routes", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_routes_patch_responses.go b/api/restapi/operations/data/data_cocsn_routes_patch_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a889f3a931b83d40c3f27db3044ab408597f0571 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_patch_responses.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DataCocsnRoutesPatchNoContentCode is the HTTP code returned for type DataCocsnRoutesPatchNoContent +const DataCocsnRoutesPatchNoContentCode int = 204 + +/*DataCocsnRoutesPatchNoContent container routes updated + +swagger:response dataCocsnRoutesPatchNoContent +*/ +type DataCocsnRoutesPatchNoContent struct { +} + +// NewDataCocsnRoutesPatchNoContent creates DataCocsnRoutesPatchNoContent with default headers values +func NewDataCocsnRoutesPatchNoContent() *DataCocsnRoutesPatchNoContent { + + return &DataCocsnRoutesPatchNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPatchNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnRoutesPatchBadRequestCode is the HTTP code returned for type DataCocsnRoutesPatchBadRequest +const DataCocsnRoutesPatchBadRequestCode int = 400 + +/*DataCocsnRoutesPatchBadRequest Bad Request + +swagger:response dataCocsnRoutesPatchBadRequest +*/ +type DataCocsnRoutesPatchBadRequest struct { +} + +// NewDataCocsnRoutesPatchBadRequest creates DataCocsnRoutesPatchBadRequest with default headers values +func NewDataCocsnRoutesPatchBadRequest() *DataCocsnRoutesPatchBadRequest { + + return &DataCocsnRoutesPatchBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPatchBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnRoutesPatchUnauthorizedCode is the HTTP code returned for type DataCocsnRoutesPatchUnauthorized +const DataCocsnRoutesPatchUnauthorizedCode int = 401 + +/*DataCocsnRoutesPatchUnauthorized Unauthorized + +swagger:response dataCocsnRoutesPatchUnauthorized +*/ +type DataCocsnRoutesPatchUnauthorized struct { +} + +// NewDataCocsnRoutesPatchUnauthorized creates DataCocsnRoutesPatchUnauthorized with default headers values +func NewDataCocsnRoutesPatchUnauthorized() *DataCocsnRoutesPatchUnauthorized { + + return &DataCocsnRoutesPatchUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPatchUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnRoutesPatchNotFoundCode is the HTTP code returned for type DataCocsnRoutesPatchNotFound +const DataCocsnRoutesPatchNotFoundCode int = 404 + +/*DataCocsnRoutesPatchNotFound Not Found + +swagger:response dataCocsnRoutesPatchNotFound +*/ +type DataCocsnRoutesPatchNotFound struct { +} + +// NewDataCocsnRoutesPatchNotFound creates DataCocsnRoutesPatchNotFound with default headers values +func NewDataCocsnRoutesPatchNotFound() *DataCocsnRoutesPatchNotFound { + + return &DataCocsnRoutesPatchNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPatchNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnRoutesPatchMethodNotAllowedCode is the HTTP code returned for type DataCocsnRoutesPatchMethodNotAllowed +const DataCocsnRoutesPatchMethodNotAllowedCode int = 405 + +/*DataCocsnRoutesPatchMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnRoutesPatchMethodNotAllowed +*/ +type DataCocsnRoutesPatchMethodNotAllowed struct { +} + +// NewDataCocsnRoutesPatchMethodNotAllowed creates DataCocsnRoutesPatchMethodNotAllowed with default headers values +func NewDataCocsnRoutesPatchMethodNotAllowed() *DataCocsnRoutesPatchMethodNotAllowed { + + return &DataCocsnRoutesPatchMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPatchMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnRoutesPatchConflictCode is the HTTP code returned for type DataCocsnRoutesPatchConflict +const DataCocsnRoutesPatchConflictCode int = 409 + +/*DataCocsnRoutesPatchConflict Conflict + +swagger:response dataCocsnRoutesPatchConflict +*/ +type DataCocsnRoutesPatchConflict struct { +} + +// NewDataCocsnRoutesPatchConflict creates DataCocsnRoutesPatchConflict with default headers values +func NewDataCocsnRoutesPatchConflict() *DataCocsnRoutesPatchConflict { + + return &DataCocsnRoutesPatchConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPatchConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_routes_patch_urlbuilder.go b/api/restapi/operations/data/data_cocsn_routes_patch_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..80f2eadcaceacd135ce255f42160b7a766090be6 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_patch_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// DataCocsnRoutesPatchURL generates an URL for the data cocsn routes patch operation +type DataCocsnRoutesPatchURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesPatchURL) WithBasePath(bp string) *DataCocsnRoutesPatchURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesPatchURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnRoutesPatchURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:routes" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnRoutesPatchURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnRoutesPatchURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnRoutesPatchURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnRoutesPatchURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnRoutesPatchURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnRoutesPatchURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_routes_post.go b/api/restapi/operations/data/data_cocsn_routes_post.go new file mode 100644 index 0000000000000000000000000000000000000000..3c000a4ebca32af287f2a2cae6a8e0fe74f92a1e --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_post.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnRoutesPostHandlerFunc turns a function with the right signature into a data cocsn routes post handler +type DataCocsnRoutesPostHandlerFunc func(DataCocsnRoutesPostParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnRoutesPostHandlerFunc) Handle(params DataCocsnRoutesPostParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnRoutesPostHandler interface for that can handle valid data cocsn routes post params +type DataCocsnRoutesPostHandler interface { + Handle(DataCocsnRoutesPostParams, interface{}) middleware.Responder +} + +// NewDataCocsnRoutesPost creates a new http.Handler for the data cocsn routes post operation +func NewDataCocsnRoutesPost(ctx *middleware.Context, handler DataCocsnRoutesPostHandler) *DataCocsnRoutesPost { + return &DataCocsnRoutesPost{Context: ctx, Handler: handler} +} + +/*DataCocsnRoutesPost swagger:route POST /data/cocsn:routes data post dataCocsnRoutesPost + +DataCocsnRoutesPost data cocsn routes post API + +*/ +type DataCocsnRoutesPost struct { + Context *middleware.Context + Handler DataCocsnRoutesPostHandler +} + +func (o *DataCocsnRoutesPost) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnRoutesPostParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_routes_post_parameters.go b/api/restapi/operations/data/data_cocsn_routes_post_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..afb237f2f04c0c4c08f4fd3ad13c196a83116251 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_post_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// NewDataCocsnRoutesPostParams creates a new DataCocsnRoutesPostParams object +// no default values defined in spec. +func NewDataCocsnRoutesPostParams() DataCocsnRoutesPostParams { + + return DataCocsnRoutesPostParams{} +} + +// DataCocsnRoutesPostParams contains all the bound params for the data cocsn routes post operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_routes_post +type DataCocsnRoutesPostParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + Routes *models.DataCocsnRoutesPost +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnRoutesPostParams() beforehand. +func (o *DataCocsnRoutesPostParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.DataCocsnRoutesPost + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("routes", "body", "")) + } else { + res = append(res, errors.NewParseError("routes", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Routes = &body + } + } + } else { + res = append(res, errors.Required("routes", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_routes_post_responses.go b/api/restapi/operations/data/data_cocsn_routes_post_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..09cbb4c99f8dcb0348f77af82b91d754021e90a7 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_post_responses.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DataCocsnRoutesPostCreatedCode is the HTTP code returned for type DataCocsnRoutesPostCreated +const DataCocsnRoutesPostCreatedCode int = 201 + +/*DataCocsnRoutesPostCreated container routes created + +swagger:response dataCocsnRoutesPostCreated +*/ +type DataCocsnRoutesPostCreated struct { +} + +// NewDataCocsnRoutesPostCreated creates DataCocsnRoutesPostCreated with default headers values +func NewDataCocsnRoutesPostCreated() *DataCocsnRoutesPostCreated { + + return &DataCocsnRoutesPostCreated{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPostCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// DataCocsnRoutesPostNoContentCode is the HTTP code returned for type DataCocsnRoutesPostNoContent +const DataCocsnRoutesPostNoContentCode int = 204 + +/*DataCocsnRoutesPostNoContent No Content + +swagger:response dataCocsnRoutesPostNoContent +*/ +type DataCocsnRoutesPostNoContent struct { +} + +// NewDataCocsnRoutesPostNoContent creates DataCocsnRoutesPostNoContent with default headers values +func NewDataCocsnRoutesPostNoContent() *DataCocsnRoutesPostNoContent { + + return &DataCocsnRoutesPostNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPostNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnRoutesPostBadRequestCode is the HTTP code returned for type DataCocsnRoutesPostBadRequest +const DataCocsnRoutesPostBadRequestCode int = 400 + +/*DataCocsnRoutesPostBadRequest Bad Request + +swagger:response dataCocsnRoutesPostBadRequest +*/ +type DataCocsnRoutesPostBadRequest struct { +} + +// NewDataCocsnRoutesPostBadRequest creates DataCocsnRoutesPostBadRequest with default headers values +func NewDataCocsnRoutesPostBadRequest() *DataCocsnRoutesPostBadRequest { + + return &DataCocsnRoutesPostBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPostBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnRoutesPostUnauthorizedCode is the HTTP code returned for type DataCocsnRoutesPostUnauthorized +const DataCocsnRoutesPostUnauthorizedCode int = 401 + +/*DataCocsnRoutesPostUnauthorized Unauthorized + +swagger:response dataCocsnRoutesPostUnauthorized +*/ +type DataCocsnRoutesPostUnauthorized struct { +} + +// NewDataCocsnRoutesPostUnauthorized creates DataCocsnRoutesPostUnauthorized with default headers values +func NewDataCocsnRoutesPostUnauthorized() *DataCocsnRoutesPostUnauthorized { + + return &DataCocsnRoutesPostUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPostUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnRoutesPostNotFoundCode is the HTTP code returned for type DataCocsnRoutesPostNotFound +const DataCocsnRoutesPostNotFoundCode int = 404 + +/*DataCocsnRoutesPostNotFound Not Found + +swagger:response dataCocsnRoutesPostNotFound +*/ +type DataCocsnRoutesPostNotFound struct { +} + +// NewDataCocsnRoutesPostNotFound creates DataCocsnRoutesPostNotFound with default headers values +func NewDataCocsnRoutesPostNotFound() *DataCocsnRoutesPostNotFound { + + return &DataCocsnRoutesPostNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPostNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnRoutesPostMethodNotAllowedCode is the HTTP code returned for type DataCocsnRoutesPostMethodNotAllowed +const DataCocsnRoutesPostMethodNotAllowedCode int = 405 + +/*DataCocsnRoutesPostMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnRoutesPostMethodNotAllowed +*/ +type DataCocsnRoutesPostMethodNotAllowed struct { +} + +// NewDataCocsnRoutesPostMethodNotAllowed creates DataCocsnRoutesPostMethodNotAllowed with default headers values +func NewDataCocsnRoutesPostMethodNotAllowed() *DataCocsnRoutesPostMethodNotAllowed { + + return &DataCocsnRoutesPostMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPostMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnRoutesPostConflictCode is the HTTP code returned for type DataCocsnRoutesPostConflict +const DataCocsnRoutesPostConflictCode int = 409 + +/*DataCocsnRoutesPostConflict Conflict + +swagger:response dataCocsnRoutesPostConflict +*/ +type DataCocsnRoutesPostConflict struct { +} + +// NewDataCocsnRoutesPostConflict creates DataCocsnRoutesPostConflict with default headers values +func NewDataCocsnRoutesPostConflict() *DataCocsnRoutesPostConflict { + + return &DataCocsnRoutesPostConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPostConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_routes_post_urlbuilder.go b/api/restapi/operations/data/data_cocsn_routes_post_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..43936805bfb1b56194fd1ab235fd8c1b2ca36165 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_post_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// DataCocsnRoutesPostURL generates an URL for the data cocsn routes post operation +type DataCocsnRoutesPostURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesPostURL) WithBasePath(bp string) *DataCocsnRoutesPostURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesPostURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnRoutesPostURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:routes" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnRoutesPostURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnRoutesPostURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnRoutesPostURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnRoutesPostURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnRoutesPostURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnRoutesPostURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_routes_put.go b/api/restapi/operations/data/data_cocsn_routes_put.go new file mode 100644 index 0000000000000000000000000000000000000000..bc72c9cc47deecb72ad7c4334a98ae78e316ace6 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_put.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnRoutesPutHandlerFunc turns a function with the right signature into a data cocsn routes put handler +type DataCocsnRoutesPutHandlerFunc func(DataCocsnRoutesPutParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnRoutesPutHandlerFunc) Handle(params DataCocsnRoutesPutParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnRoutesPutHandler interface for that can handle valid data cocsn routes put params +type DataCocsnRoutesPutHandler interface { + Handle(DataCocsnRoutesPutParams, interface{}) middleware.Responder +} + +// NewDataCocsnRoutesPut creates a new http.Handler for the data cocsn routes put operation +func NewDataCocsnRoutesPut(ctx *middleware.Context, handler DataCocsnRoutesPutHandler) *DataCocsnRoutesPut { + return &DataCocsnRoutesPut{Context: ctx, Handler: handler} +} + +/*DataCocsnRoutesPut swagger:route PUT /data/cocsn:routes data put dataCocsnRoutesPut + +DataCocsnRoutesPut data cocsn routes put API + +*/ +type DataCocsnRoutesPut struct { + Context *middleware.Context + Handler DataCocsnRoutesPutHandler +} + +func (o *DataCocsnRoutesPut) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnRoutesPutParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_routes_put_parameters.go b/api/restapi/operations/data/data_cocsn_routes_put_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..5e53fd6f5a696471d05b07bfda9ce820fff02cc2 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_put_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// NewDataCocsnRoutesPutParams creates a new DataCocsnRoutesPutParams object +// no default values defined in spec. +func NewDataCocsnRoutesPutParams() DataCocsnRoutesPutParams { + + return DataCocsnRoutesPutParams{} +} + +// DataCocsnRoutesPutParams contains all the bound params for the data cocsn routes put operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_routes_put +type DataCocsnRoutesPutParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + Routes *models.DataCocsnRoutes +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnRoutesPutParams() beforehand. +func (o *DataCocsnRoutesPutParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.DataCocsnRoutes + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("routes", "body", "")) + } else { + res = append(res, errors.NewParseError("routes", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Routes = &body + } + } + } else { + res = append(res, errors.Required("routes", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_routes_put_responses.go b/api/restapi/operations/data/data_cocsn_routes_put_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..6f5442247a7a7e99a080525f199e5f60ad55a5e1 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_put_responses.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DataCocsnRoutesPutCreatedCode is the HTTP code returned for type DataCocsnRoutesPutCreated +const DataCocsnRoutesPutCreatedCode int = 201 + +/*DataCocsnRoutesPutCreated container routes created or replaced + +swagger:response dataCocsnRoutesPutCreated +*/ +type DataCocsnRoutesPutCreated struct { +} + +// NewDataCocsnRoutesPutCreated creates DataCocsnRoutesPutCreated with default headers values +func NewDataCocsnRoutesPutCreated() *DataCocsnRoutesPutCreated { + + return &DataCocsnRoutesPutCreated{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPutCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// DataCocsnRoutesPutNoContentCode is the HTTP code returned for type DataCocsnRoutesPutNoContent +const DataCocsnRoutesPutNoContentCode int = 204 + +/*DataCocsnRoutesPutNoContent No Content + +swagger:response dataCocsnRoutesPutNoContent +*/ +type DataCocsnRoutesPutNoContent struct { +} + +// NewDataCocsnRoutesPutNoContent creates DataCocsnRoutesPutNoContent with default headers values +func NewDataCocsnRoutesPutNoContent() *DataCocsnRoutesPutNoContent { + + return &DataCocsnRoutesPutNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPutNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnRoutesPutBadRequestCode is the HTTP code returned for type DataCocsnRoutesPutBadRequest +const DataCocsnRoutesPutBadRequestCode int = 400 + +/*DataCocsnRoutesPutBadRequest Bad Request + +swagger:response dataCocsnRoutesPutBadRequest +*/ +type DataCocsnRoutesPutBadRequest struct { +} + +// NewDataCocsnRoutesPutBadRequest creates DataCocsnRoutesPutBadRequest with default headers values +func NewDataCocsnRoutesPutBadRequest() *DataCocsnRoutesPutBadRequest { + + return &DataCocsnRoutesPutBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPutBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnRoutesPutUnauthorizedCode is the HTTP code returned for type DataCocsnRoutesPutUnauthorized +const DataCocsnRoutesPutUnauthorizedCode int = 401 + +/*DataCocsnRoutesPutUnauthorized Unauthorized + +swagger:response dataCocsnRoutesPutUnauthorized +*/ +type DataCocsnRoutesPutUnauthorized struct { +} + +// NewDataCocsnRoutesPutUnauthorized creates DataCocsnRoutesPutUnauthorized with default headers values +func NewDataCocsnRoutesPutUnauthorized() *DataCocsnRoutesPutUnauthorized { + + return &DataCocsnRoutesPutUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPutUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnRoutesPutNotFoundCode is the HTTP code returned for type DataCocsnRoutesPutNotFound +const DataCocsnRoutesPutNotFoundCode int = 404 + +/*DataCocsnRoutesPutNotFound Not Found + +swagger:response dataCocsnRoutesPutNotFound +*/ +type DataCocsnRoutesPutNotFound struct { +} + +// NewDataCocsnRoutesPutNotFound creates DataCocsnRoutesPutNotFound with default headers values +func NewDataCocsnRoutesPutNotFound() *DataCocsnRoutesPutNotFound { + + return &DataCocsnRoutesPutNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPutNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnRoutesPutMethodNotAllowedCode is the HTTP code returned for type DataCocsnRoutesPutMethodNotAllowed +const DataCocsnRoutesPutMethodNotAllowedCode int = 405 + +/*DataCocsnRoutesPutMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnRoutesPutMethodNotAllowed +*/ +type DataCocsnRoutesPutMethodNotAllowed struct { +} + +// NewDataCocsnRoutesPutMethodNotAllowed creates DataCocsnRoutesPutMethodNotAllowed with default headers values +func NewDataCocsnRoutesPutMethodNotAllowed() *DataCocsnRoutesPutMethodNotAllowed { + + return &DataCocsnRoutesPutMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPutMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnRoutesPutConflictCode is the HTTP code returned for type DataCocsnRoutesPutConflict +const DataCocsnRoutesPutConflictCode int = 409 + +/*DataCocsnRoutesPutConflict Conflict + +swagger:response dataCocsnRoutesPutConflict +*/ +type DataCocsnRoutesPutConflict struct { +} + +// NewDataCocsnRoutesPutConflict creates DataCocsnRoutesPutConflict with default headers values +func NewDataCocsnRoutesPutConflict() *DataCocsnRoutesPutConflict { + + return &DataCocsnRoutesPutConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesPutConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_routes_put_urlbuilder.go b/api/restapi/operations/data/data_cocsn_routes_put_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..a2f576d1c05faea699cddc71809c654995789e33 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_put_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// DataCocsnRoutesPutURL generates an URL for the data cocsn routes put operation +type DataCocsnRoutesPutURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesPutURL) WithBasePath(bp string) *DataCocsnRoutesPutURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesPutURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnRoutesPutURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:routes" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnRoutesPutURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnRoutesPutURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnRoutesPutURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnRoutesPutURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnRoutesPutURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnRoutesPutURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_get.go b/api/restapi/operations/data/data_cocsn_routes_route_get.go new file mode 100644 index 0000000000000000000000000000000000000000..90d2438f97dbda8014b7e174dccceccc015cf5ed --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_get.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnRoutesRouteGetHandlerFunc turns a function with the right signature into a data cocsn routes route get handler +type DataCocsnRoutesRouteGetHandlerFunc func(DataCocsnRoutesRouteGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnRoutesRouteGetHandlerFunc) Handle(params DataCocsnRoutesRouteGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnRoutesRouteGetHandler interface for that can handle valid data cocsn routes route get params +type DataCocsnRoutesRouteGetHandler interface { + Handle(DataCocsnRoutesRouteGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnRoutesRouteGet creates a new http.Handler for the data cocsn routes route get operation +func NewDataCocsnRoutesRouteGet(ctx *middleware.Context, handler DataCocsnRoutesRouteGetHandler) *DataCocsnRoutesRouteGet { + return &DataCocsnRoutesRouteGet{Context: ctx, Handler: handler} +} + +/*DataCocsnRoutesRouteGet swagger:route GET /data/cocsn:routes/route data get dataCocsnRoutesRouteGet + +DataCocsnRoutesRouteGet data cocsn routes route get API + +*/ +type DataCocsnRoutesRouteGet struct { + Context *middleware.Context + Handler DataCocsnRoutesRouteGetHandler +} + +func (o *DataCocsnRoutesRouteGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnRoutesRouteGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_get_parameters.go b/api/restapi/operations/data/data_cocsn_routes_route_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..7e2981d4a9fd5637c79693a75f6853884a23f1fe --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_get_parameters.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnRoutesRouteGetParams creates a new DataCocsnRoutesRouteGetParams object +// with the default values initialized. +func NewDataCocsnRoutesRouteGetParams() DataCocsnRoutesRouteGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnRoutesRouteGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnRoutesRouteGetParams contains all the bound params for the data cocsn routes route get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_routes_route_get +type DataCocsnRoutesRouteGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnRoutesRouteGetParams() beforehand. +func (o *DataCocsnRoutesRouteGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnRoutesRouteGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnRoutesRouteGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnRoutesRouteGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnRoutesRouteGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnRoutesRouteGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnRoutesRouteGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnRoutesRouteGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnRoutesRouteGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnRoutesRouteGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_get_responses.go b/api/restapi/operations/data/data_cocsn_routes_route_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..5659d3c90d91cfed3a8798d02bdf01b03283a5e2 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnRoutesRouteGetOKCode is the HTTP code returned for type DataCocsnRoutesRouteGetOK +const DataCocsnRoutesRouteGetOKCode int = 200 + +/*DataCocsnRoutesRouteGetOK OK + +swagger:response dataCocsnRoutesRouteGetOK +*/ +type DataCocsnRoutesRouteGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnRoutesRoute `json:"body,omitempty"` +} + +// NewDataCocsnRoutesRouteGetOK creates DataCocsnRoutesRouteGetOK with default headers values +func NewDataCocsnRoutesRouteGetOK() *DataCocsnRoutesRouteGetOK { + + return &DataCocsnRoutesRouteGetOK{} +} + +// WithPayload adds the payload to the data cocsn routes route get o k response +func (o *DataCocsnRoutesRouteGetOK) WithPayload(payload *models.DataCocsnRoutesRoute) *DataCocsnRoutesRouteGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn routes route get o k response +func (o *DataCocsnRoutesRouteGetOK) SetPayload(payload *models.DataCocsnRoutesRoute) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnRoutesRouteGetNoContentCode is the HTTP code returned for type DataCocsnRoutesRouteGetNoContent +const DataCocsnRoutesRouteGetNoContentCode int = 204 + +/*DataCocsnRoutesRouteGetNoContent No Content + +swagger:response dataCocsnRoutesRouteGetNoContent +*/ +type DataCocsnRoutesRouteGetNoContent struct { +} + +// NewDataCocsnRoutesRouteGetNoContent creates DataCocsnRoutesRouteGetNoContent with default headers values +func NewDataCocsnRoutesRouteGetNoContent() *DataCocsnRoutesRouteGetNoContent { + + return &DataCocsnRoutesRouteGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnRoutesRouteGetBadRequestCode is the HTTP code returned for type DataCocsnRoutesRouteGetBadRequest +const DataCocsnRoutesRouteGetBadRequestCode int = 400 + +/*DataCocsnRoutesRouteGetBadRequest Bad Request + +swagger:response dataCocsnRoutesRouteGetBadRequest +*/ +type DataCocsnRoutesRouteGetBadRequest struct { +} + +// NewDataCocsnRoutesRouteGetBadRequest creates DataCocsnRoutesRouteGetBadRequest with default headers values +func NewDataCocsnRoutesRouteGetBadRequest() *DataCocsnRoutesRouteGetBadRequest { + + return &DataCocsnRoutesRouteGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnRoutesRouteGetUnauthorizedCode is the HTTP code returned for type DataCocsnRoutesRouteGetUnauthorized +const DataCocsnRoutesRouteGetUnauthorizedCode int = 401 + +/*DataCocsnRoutesRouteGetUnauthorized Unauthorized + +swagger:response dataCocsnRoutesRouteGetUnauthorized +*/ +type DataCocsnRoutesRouteGetUnauthorized struct { +} + +// NewDataCocsnRoutesRouteGetUnauthorized creates DataCocsnRoutesRouteGetUnauthorized with default headers values +func NewDataCocsnRoutesRouteGetUnauthorized() *DataCocsnRoutesRouteGetUnauthorized { + + return &DataCocsnRoutesRouteGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnRoutesRouteGetNotFoundCode is the HTTP code returned for type DataCocsnRoutesRouteGetNotFound +const DataCocsnRoutesRouteGetNotFoundCode int = 404 + +/*DataCocsnRoutesRouteGetNotFound Not Found + +swagger:response dataCocsnRoutesRouteGetNotFound +*/ +type DataCocsnRoutesRouteGetNotFound struct { +} + +// NewDataCocsnRoutesRouteGetNotFound creates DataCocsnRoutesRouteGetNotFound with default headers values +func NewDataCocsnRoutesRouteGetNotFound() *DataCocsnRoutesRouteGetNotFound { + + return &DataCocsnRoutesRouteGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnRoutesRouteGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnRoutesRouteGetMethodNotAllowed +const DataCocsnRoutesRouteGetMethodNotAllowedCode int = 405 + +/*DataCocsnRoutesRouteGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnRoutesRouteGetMethodNotAllowed +*/ +type DataCocsnRoutesRouteGetMethodNotAllowed struct { +} + +// NewDataCocsnRoutesRouteGetMethodNotAllowed creates DataCocsnRoutesRouteGetMethodNotAllowed with default headers values +func NewDataCocsnRoutesRouteGetMethodNotAllowed() *DataCocsnRoutesRouteGetMethodNotAllowed { + + return &DataCocsnRoutesRouteGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnRoutesRouteGetConflictCode is the HTTP code returned for type DataCocsnRoutesRouteGetConflict +const DataCocsnRoutesRouteGetConflictCode int = 409 + +/*DataCocsnRoutesRouteGetConflict Conflict + +swagger:response dataCocsnRoutesRouteGetConflict +*/ +type DataCocsnRoutesRouteGetConflict struct { +} + +// NewDataCocsnRoutesRouteGetConflict creates DataCocsnRoutesRouteGetConflict with default headers values +func NewDataCocsnRoutesRouteGetConflict() *DataCocsnRoutesRouteGetConflict { + + return &DataCocsnRoutesRouteGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_routes_route_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..38242697b250d4d5e28ab794130b72cd47044ee7 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_get_urlbuilder.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// DataCocsnRoutesRouteGetURL generates an URL for the data cocsn routes route get operation +type DataCocsnRoutesRouteGetURL struct { + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesRouteGetURL) WithBasePath(bp string) *DataCocsnRoutesRouteGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesRouteGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnRoutesRouteGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:routes/route" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnRoutesRouteGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnRoutesRouteGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnRoutesRouteGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnRoutesRouteGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnRoutesRouteGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnRoutesRouteGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_destination_get.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_destination_get.go new file mode 100644 index 0000000000000000000000000000000000000000..5582bf5462781d4ef525f6fd970bedb3f87c2d44 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_destination_get.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnRoutesRouteRouteDestinationDestinationGetHandlerFunc turns a function with the right signature into a data cocsn routes route route destination destination get handler +type DataCocsnRoutesRouteRouteDestinationDestinationGetHandlerFunc func(DataCocsnRoutesRouteRouteDestinationDestinationGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnRoutesRouteRouteDestinationDestinationGetHandlerFunc) Handle(params DataCocsnRoutesRouteRouteDestinationDestinationGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnRoutesRouteRouteDestinationDestinationGetHandler interface for that can handle valid data cocsn routes route route destination destination get params +type DataCocsnRoutesRouteRouteDestinationDestinationGetHandler interface { + Handle(DataCocsnRoutesRouteRouteDestinationDestinationGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnRoutesRouteRouteDestinationDestinationGet creates a new http.Handler for the data cocsn routes route route destination destination get operation +func NewDataCocsnRoutesRouteRouteDestinationDestinationGet(ctx *middleware.Context, handler DataCocsnRoutesRouteRouteDestinationDestinationGetHandler) *DataCocsnRoutesRouteRouteDestinationDestinationGet { + return &DataCocsnRoutesRouteRouteDestinationDestinationGet{Context: ctx, Handler: handler} +} + +/*DataCocsnRoutesRouteRouteDestinationDestinationGet swagger:route GET /data/cocsn:routes/route={route-destination}/destination data get dataCocsnRoutesRouteRouteDestinationDestinationGet + +Route destination. IP network + +Route destination. IP network + +*/ +type DataCocsnRoutesRouteRouteDestinationDestinationGet struct { + Context *middleware.Context + Handler DataCocsnRoutesRouteRouteDestinationDestinationGetHandler +} + +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnRoutesRouteRouteDestinationDestinationGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_destination_get_parameters.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_destination_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..dfb0de0ac1a8efc501b599ad39108b8ee6c273e8 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_destination_get_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnRoutesRouteRouteDestinationDestinationGetParams creates a new DataCocsnRoutesRouteRouteDestinationDestinationGetParams object +// with the default values initialized. +func NewDataCocsnRoutesRouteRouteDestinationDestinationGetParams() DataCocsnRoutesRouteRouteDestinationDestinationGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnRoutesRouteRouteDestinationDestinationGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnRoutesRouteRouteDestinationDestinationGetParams contains all the bound params for the data cocsn routes route route destination destination get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_routes_route_route_destination_destination_get +type DataCocsnRoutesRouteRouteDestinationDestinationGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*Route destination. IP network + Required: true + In: path + */ + RouteDestination string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnRoutesRouteRouteDestinationDestinationGetParams() beforehand. +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + rRouteDestination, rhkRouteDestination, _ := route.Params.GetOK("route-destination") + if err := o.bindRouteDestination(rRouteDestination, rhkRouteDestination, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnRoutesRouteRouteDestinationDestinationGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindRouteDestination binds and validates parameter RouteDestination from path. +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetParams) bindRouteDestination(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.RouteDestination = raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnRoutesRouteRouteDestinationDestinationGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_destination_get_responses.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_destination_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..8b77bd477d8119815d19f2c4855f2d677ee1ab33 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_destination_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnRoutesRouteRouteDestinationDestinationGetOKCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationDestinationGetOK +const DataCocsnRoutesRouteRouteDestinationDestinationGetOKCode int = 200 + +/*DataCocsnRoutesRouteRouteDestinationDestinationGetOK Route destination. IP network + +swagger:response dataCocsnRoutesRouteRouteDestinationDestinationGetOK +*/ +type DataCocsnRoutesRouteRouteDestinationDestinationGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnRoutesRouteRouteDestinationDestination `json:"body,omitempty"` +} + +// NewDataCocsnRoutesRouteRouteDestinationDestinationGetOK creates DataCocsnRoutesRouteRouteDestinationDestinationGetOK with default headers values +func NewDataCocsnRoutesRouteRouteDestinationDestinationGetOK() *DataCocsnRoutesRouteRouteDestinationDestinationGetOK { + + return &DataCocsnRoutesRouteRouteDestinationDestinationGetOK{} +} + +// WithPayload adds the payload to the data cocsn routes route route destination destination get o k response +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetOK) WithPayload(payload *models.DataCocsnRoutesRouteRouteDestinationDestination) *DataCocsnRoutesRouteRouteDestinationDestinationGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn routes route route destination destination get o k response +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetOK) SetPayload(payload *models.DataCocsnRoutesRouteRouteDestinationDestination) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnRoutesRouteRouteDestinationDestinationGetNoContentCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationDestinationGetNoContent +const DataCocsnRoutesRouteRouteDestinationDestinationGetNoContentCode int = 204 + +/*DataCocsnRoutesRouteRouteDestinationDestinationGetNoContent No Content + +swagger:response dataCocsnRoutesRouteRouteDestinationDestinationGetNoContent +*/ +type DataCocsnRoutesRouteRouteDestinationDestinationGetNoContent struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationDestinationGetNoContent creates DataCocsnRoutesRouteRouteDestinationDestinationGetNoContent with default headers values +func NewDataCocsnRoutesRouteRouteDestinationDestinationGetNoContent() *DataCocsnRoutesRouteRouteDestinationDestinationGetNoContent { + + return &DataCocsnRoutesRouteRouteDestinationDestinationGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnRoutesRouteRouteDestinationDestinationGetBadRequestCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationDestinationGetBadRequest +const DataCocsnRoutesRouteRouteDestinationDestinationGetBadRequestCode int = 400 + +/*DataCocsnRoutesRouteRouteDestinationDestinationGetBadRequest Bad Request + +swagger:response dataCocsnRoutesRouteRouteDestinationDestinationGetBadRequest +*/ +type DataCocsnRoutesRouteRouteDestinationDestinationGetBadRequest struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationDestinationGetBadRequest creates DataCocsnRoutesRouteRouteDestinationDestinationGetBadRequest with default headers values +func NewDataCocsnRoutesRouteRouteDestinationDestinationGetBadRequest() *DataCocsnRoutesRouteRouteDestinationDestinationGetBadRequest { + + return &DataCocsnRoutesRouteRouteDestinationDestinationGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnRoutesRouteRouteDestinationDestinationGetUnauthorizedCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationDestinationGetUnauthorized +const DataCocsnRoutesRouteRouteDestinationDestinationGetUnauthorizedCode int = 401 + +/*DataCocsnRoutesRouteRouteDestinationDestinationGetUnauthorized Unauthorized + +swagger:response dataCocsnRoutesRouteRouteDestinationDestinationGetUnauthorized +*/ +type DataCocsnRoutesRouteRouteDestinationDestinationGetUnauthorized struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationDestinationGetUnauthorized creates DataCocsnRoutesRouteRouteDestinationDestinationGetUnauthorized with default headers values +func NewDataCocsnRoutesRouteRouteDestinationDestinationGetUnauthorized() *DataCocsnRoutesRouteRouteDestinationDestinationGetUnauthorized { + + return &DataCocsnRoutesRouteRouteDestinationDestinationGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnRoutesRouteRouteDestinationDestinationGetNotFoundCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationDestinationGetNotFound +const DataCocsnRoutesRouteRouteDestinationDestinationGetNotFoundCode int = 404 + +/*DataCocsnRoutesRouteRouteDestinationDestinationGetNotFound Not Found + +swagger:response dataCocsnRoutesRouteRouteDestinationDestinationGetNotFound +*/ +type DataCocsnRoutesRouteRouteDestinationDestinationGetNotFound struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationDestinationGetNotFound creates DataCocsnRoutesRouteRouteDestinationDestinationGetNotFound with default headers values +func NewDataCocsnRoutesRouteRouteDestinationDestinationGetNotFound() *DataCocsnRoutesRouteRouteDestinationDestinationGetNotFound { + + return &DataCocsnRoutesRouteRouteDestinationDestinationGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnRoutesRouteRouteDestinationDestinationGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationDestinationGetMethodNotAllowed +const DataCocsnRoutesRouteRouteDestinationDestinationGetMethodNotAllowedCode int = 405 + +/*DataCocsnRoutesRouteRouteDestinationDestinationGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnRoutesRouteRouteDestinationDestinationGetMethodNotAllowed +*/ +type DataCocsnRoutesRouteRouteDestinationDestinationGetMethodNotAllowed struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationDestinationGetMethodNotAllowed creates DataCocsnRoutesRouteRouteDestinationDestinationGetMethodNotAllowed with default headers values +func NewDataCocsnRoutesRouteRouteDestinationDestinationGetMethodNotAllowed() *DataCocsnRoutesRouteRouteDestinationDestinationGetMethodNotAllowed { + + return &DataCocsnRoutesRouteRouteDestinationDestinationGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnRoutesRouteRouteDestinationDestinationGetConflictCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationDestinationGetConflict +const DataCocsnRoutesRouteRouteDestinationDestinationGetConflictCode int = 409 + +/*DataCocsnRoutesRouteRouteDestinationDestinationGetConflict Conflict + +swagger:response dataCocsnRoutesRouteRouteDestinationDestinationGetConflict +*/ +type DataCocsnRoutesRouteRouteDestinationDestinationGetConflict struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationDestinationGetConflict creates DataCocsnRoutesRouteRouteDestinationDestinationGetConflict with default headers values +func NewDataCocsnRoutesRouteRouteDestinationDestinationGetConflict() *DataCocsnRoutesRouteRouteDestinationDestinationGetConflict { + + return &DataCocsnRoutesRouteRouteDestinationDestinationGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_destination_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_destination_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..bfa9ed92c0770160541aecc85de8fcdfbd2d15d4 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_destination_get_urlbuilder.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DataCocsnRoutesRouteRouteDestinationDestinationGetURL generates an URL for the data cocsn routes route route destination destination get operation +type DataCocsnRoutesRouteRouteDestinationDestinationGetURL struct { + RouteDestination string + + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetURL) WithBasePath(bp string) *DataCocsnRoutesRouteRouteDestinationDestinationGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:routes/route={route-destination}/destination" + + routeDestination := o.RouteDestination + if routeDestination != "" { + _path = strings.Replace(_path, "{route-destination}", routeDestination, -1) + } else { + return nil, errors.New("routeDestination is required on DataCocsnRoutesRouteRouteDestinationDestinationGetURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnRoutesRouteRouteDestinationDestinationGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnRoutesRouteRouteDestinationDestinationGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnRoutesRouteRouteDestinationDestinationGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_expire_get.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_expire_get.go new file mode 100644 index 0000000000000000000000000000000000000000..e72009960ba4d4d104bba5d67c3638fb7d232196 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_expire_get.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnRoutesRouteRouteDestinationExpireGetHandlerFunc turns a function with the right signature into a data cocsn routes route route destination expire get handler +type DataCocsnRoutesRouteRouteDestinationExpireGetHandlerFunc func(DataCocsnRoutesRouteRouteDestinationExpireGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnRoutesRouteRouteDestinationExpireGetHandlerFunc) Handle(params DataCocsnRoutesRouteRouteDestinationExpireGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnRoutesRouteRouteDestinationExpireGetHandler interface for that can handle valid data cocsn routes route route destination expire get params +type DataCocsnRoutesRouteRouteDestinationExpireGetHandler interface { + Handle(DataCocsnRoutesRouteRouteDestinationExpireGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnRoutesRouteRouteDestinationExpireGet creates a new http.Handler for the data cocsn routes route route destination expire get operation +func NewDataCocsnRoutesRouteRouteDestinationExpireGet(ctx *middleware.Context, handler DataCocsnRoutesRouteRouteDestinationExpireGetHandler) *DataCocsnRoutesRouteRouteDestinationExpireGet { + return &DataCocsnRoutesRouteRouteDestinationExpireGet{Context: ctx, Handler: handler} +} + +/*DataCocsnRoutesRouteRouteDestinationExpireGet swagger:route GET /data/cocsn:routes/route={route-destination}/expire data get dataCocsnRoutesRouteRouteDestinationExpireGet + +Expiration timer of the route + +Expiration timer of the route + +*/ +type DataCocsnRoutesRouteRouteDestinationExpireGet struct { + Context *middleware.Context + Handler DataCocsnRoutesRouteRouteDestinationExpireGetHandler +} + +func (o *DataCocsnRoutesRouteRouteDestinationExpireGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnRoutesRouteRouteDestinationExpireGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_expire_get_parameters.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_expire_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b21c59e47bee47ff332042388cb2768308029f5b --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_expire_get_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnRoutesRouteRouteDestinationExpireGetParams creates a new DataCocsnRoutesRouteRouteDestinationExpireGetParams object +// with the default values initialized. +func NewDataCocsnRoutesRouteRouteDestinationExpireGetParams() DataCocsnRoutesRouteRouteDestinationExpireGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnRoutesRouteRouteDestinationExpireGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnRoutesRouteRouteDestinationExpireGetParams contains all the bound params for the data cocsn routes route route destination expire get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_routes_route_route_destination_expire_get +type DataCocsnRoutesRouteRouteDestinationExpireGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*Route destination. IP network + Required: true + In: path + */ + RouteDestination string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnRoutesRouteRouteDestinationExpireGetParams() beforehand. +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + rRouteDestination, rhkRouteDestination, _ := route.Params.GetOK("route-destination") + if err := o.bindRouteDestination(rRouteDestination, rhkRouteDestination, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnRoutesRouteRouteDestinationExpireGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindRouteDestination binds and validates parameter RouteDestination from path. +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetParams) bindRouteDestination(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.RouteDestination = raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnRoutesRouteRouteDestinationExpireGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_expire_get_responses.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_expire_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..9dff415edac0358f79975795f8fa7c3a70c8ffb6 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_expire_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnRoutesRouteRouteDestinationExpireGetOKCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationExpireGetOK +const DataCocsnRoutesRouteRouteDestinationExpireGetOKCode int = 200 + +/*DataCocsnRoutesRouteRouteDestinationExpireGetOK Expiration timer of the route + +swagger:response dataCocsnRoutesRouteRouteDestinationExpireGetOK +*/ +type DataCocsnRoutesRouteRouteDestinationExpireGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnRoutesRouteRouteDestinationExpire `json:"body,omitempty"` +} + +// NewDataCocsnRoutesRouteRouteDestinationExpireGetOK creates DataCocsnRoutesRouteRouteDestinationExpireGetOK with default headers values +func NewDataCocsnRoutesRouteRouteDestinationExpireGetOK() *DataCocsnRoutesRouteRouteDestinationExpireGetOK { + + return &DataCocsnRoutesRouteRouteDestinationExpireGetOK{} +} + +// WithPayload adds the payload to the data cocsn routes route route destination expire get o k response +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetOK) WithPayload(payload *models.DataCocsnRoutesRouteRouteDestinationExpire) *DataCocsnRoutesRouteRouteDestinationExpireGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn routes route route destination expire get o k response +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetOK) SetPayload(payload *models.DataCocsnRoutesRouteRouteDestinationExpire) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnRoutesRouteRouteDestinationExpireGetNoContentCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationExpireGetNoContent +const DataCocsnRoutesRouteRouteDestinationExpireGetNoContentCode int = 204 + +/*DataCocsnRoutesRouteRouteDestinationExpireGetNoContent No Content + +swagger:response dataCocsnRoutesRouteRouteDestinationExpireGetNoContent +*/ +type DataCocsnRoutesRouteRouteDestinationExpireGetNoContent struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationExpireGetNoContent creates DataCocsnRoutesRouteRouteDestinationExpireGetNoContent with default headers values +func NewDataCocsnRoutesRouteRouteDestinationExpireGetNoContent() *DataCocsnRoutesRouteRouteDestinationExpireGetNoContent { + + return &DataCocsnRoutesRouteRouteDestinationExpireGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnRoutesRouteRouteDestinationExpireGetBadRequestCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationExpireGetBadRequest +const DataCocsnRoutesRouteRouteDestinationExpireGetBadRequestCode int = 400 + +/*DataCocsnRoutesRouteRouteDestinationExpireGetBadRequest Bad Request + +swagger:response dataCocsnRoutesRouteRouteDestinationExpireGetBadRequest +*/ +type DataCocsnRoutesRouteRouteDestinationExpireGetBadRequest struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationExpireGetBadRequest creates DataCocsnRoutesRouteRouteDestinationExpireGetBadRequest with default headers values +func NewDataCocsnRoutesRouteRouteDestinationExpireGetBadRequest() *DataCocsnRoutesRouteRouteDestinationExpireGetBadRequest { + + return &DataCocsnRoutesRouteRouteDestinationExpireGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnRoutesRouteRouteDestinationExpireGetUnauthorizedCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationExpireGetUnauthorized +const DataCocsnRoutesRouteRouteDestinationExpireGetUnauthorizedCode int = 401 + +/*DataCocsnRoutesRouteRouteDestinationExpireGetUnauthorized Unauthorized + +swagger:response dataCocsnRoutesRouteRouteDestinationExpireGetUnauthorized +*/ +type DataCocsnRoutesRouteRouteDestinationExpireGetUnauthorized struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationExpireGetUnauthorized creates DataCocsnRoutesRouteRouteDestinationExpireGetUnauthorized with default headers values +func NewDataCocsnRoutesRouteRouteDestinationExpireGetUnauthorized() *DataCocsnRoutesRouteRouteDestinationExpireGetUnauthorized { + + return &DataCocsnRoutesRouteRouteDestinationExpireGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnRoutesRouteRouteDestinationExpireGetNotFoundCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationExpireGetNotFound +const DataCocsnRoutesRouteRouteDestinationExpireGetNotFoundCode int = 404 + +/*DataCocsnRoutesRouteRouteDestinationExpireGetNotFound Not Found + +swagger:response dataCocsnRoutesRouteRouteDestinationExpireGetNotFound +*/ +type DataCocsnRoutesRouteRouteDestinationExpireGetNotFound struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationExpireGetNotFound creates DataCocsnRoutesRouteRouteDestinationExpireGetNotFound with default headers values +func NewDataCocsnRoutesRouteRouteDestinationExpireGetNotFound() *DataCocsnRoutesRouteRouteDestinationExpireGetNotFound { + + return &DataCocsnRoutesRouteRouteDestinationExpireGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnRoutesRouteRouteDestinationExpireGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationExpireGetMethodNotAllowed +const DataCocsnRoutesRouteRouteDestinationExpireGetMethodNotAllowedCode int = 405 + +/*DataCocsnRoutesRouteRouteDestinationExpireGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnRoutesRouteRouteDestinationExpireGetMethodNotAllowed +*/ +type DataCocsnRoutesRouteRouteDestinationExpireGetMethodNotAllowed struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationExpireGetMethodNotAllowed creates DataCocsnRoutesRouteRouteDestinationExpireGetMethodNotAllowed with default headers values +func NewDataCocsnRoutesRouteRouteDestinationExpireGetMethodNotAllowed() *DataCocsnRoutesRouteRouteDestinationExpireGetMethodNotAllowed { + + return &DataCocsnRoutesRouteRouteDestinationExpireGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnRoutesRouteRouteDestinationExpireGetConflictCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationExpireGetConflict +const DataCocsnRoutesRouteRouteDestinationExpireGetConflictCode int = 409 + +/*DataCocsnRoutesRouteRouteDestinationExpireGetConflict Conflict + +swagger:response dataCocsnRoutesRouteRouteDestinationExpireGetConflict +*/ +type DataCocsnRoutesRouteRouteDestinationExpireGetConflict struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationExpireGetConflict creates DataCocsnRoutesRouteRouteDestinationExpireGetConflict with default headers values +func NewDataCocsnRoutesRouteRouteDestinationExpireGetConflict() *DataCocsnRoutesRouteRouteDestinationExpireGetConflict { + + return &DataCocsnRoutesRouteRouteDestinationExpireGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_expire_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_expire_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..e88045a3684ff26d03f919f001465d35175b9a08 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_expire_get_urlbuilder.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DataCocsnRoutesRouteRouteDestinationExpireGetURL generates an URL for the data cocsn routes route route destination expire get operation +type DataCocsnRoutesRouteRouteDestinationExpireGetURL struct { + RouteDestination string + + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetURL) WithBasePath(bp string) *DataCocsnRoutesRouteRouteDestinationExpireGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:routes/route={route-destination}/expire" + + routeDestination := o.RouteDestination + if routeDestination != "" { + _path = strings.Replace(_path, "{route-destination}", routeDestination, -1) + } else { + return nil, errors.New("routeDestination is required on DataCocsnRoutesRouteRouteDestinationExpireGetURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnRoutesRouteRouteDestinationExpireGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnRoutesRouteRouteDestinationExpireGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnRoutesRouteRouteDestinationExpireGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_flags_get.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_flags_get.go new file mode 100644 index 0000000000000000000000000000000000000000..5d0ad7edcdda5b82e47d0aacfb978ebb5544bef5 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_flags_get.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnRoutesRouteRouteDestinationFlagsGetHandlerFunc turns a function with the right signature into a data cocsn routes route route destination flags get handler +type DataCocsnRoutesRouteRouteDestinationFlagsGetHandlerFunc func(DataCocsnRoutesRouteRouteDestinationFlagsGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnRoutesRouteRouteDestinationFlagsGetHandlerFunc) Handle(params DataCocsnRoutesRouteRouteDestinationFlagsGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnRoutesRouteRouteDestinationFlagsGetHandler interface for that can handle valid data cocsn routes route route destination flags get params +type DataCocsnRoutesRouteRouteDestinationFlagsGetHandler interface { + Handle(DataCocsnRoutesRouteRouteDestinationFlagsGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnRoutesRouteRouteDestinationFlagsGet creates a new http.Handler for the data cocsn routes route route destination flags get operation +func NewDataCocsnRoutesRouteRouteDestinationFlagsGet(ctx *middleware.Context, handler DataCocsnRoutesRouteRouteDestinationFlagsGetHandler) *DataCocsnRoutesRouteRouteDestinationFlagsGet { + return &DataCocsnRoutesRouteRouteDestinationFlagsGet{Context: ctx, Handler: handler} +} + +/*DataCocsnRoutesRouteRouteDestinationFlagsGet swagger:route GET /data/cocsn:routes/route={route-destination}/flags data get dataCocsnRoutesRouteRouteDestinationFlagsGet + +Flags of the route + +Flags of the route + +*/ +type DataCocsnRoutesRouteRouteDestinationFlagsGet struct { + Context *middleware.Context + Handler DataCocsnRoutesRouteRouteDestinationFlagsGetHandler +} + +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnRoutesRouteRouteDestinationFlagsGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_flags_get_parameters.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_flags_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..35f66ff16c154f767befdefe0c40f59902ee596c --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_flags_get_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnRoutesRouteRouteDestinationFlagsGetParams creates a new DataCocsnRoutesRouteRouteDestinationFlagsGetParams object +// with the default values initialized. +func NewDataCocsnRoutesRouteRouteDestinationFlagsGetParams() DataCocsnRoutesRouteRouteDestinationFlagsGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnRoutesRouteRouteDestinationFlagsGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnRoutesRouteRouteDestinationFlagsGetParams contains all the bound params for the data cocsn routes route route destination flags get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_routes_route_route_destination_flags_get +type DataCocsnRoutesRouteRouteDestinationFlagsGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*Route destination. IP network + Required: true + In: path + */ + RouteDestination string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnRoutesRouteRouteDestinationFlagsGetParams() beforehand. +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + rRouteDestination, rhkRouteDestination, _ := route.Params.GetOK("route-destination") + if err := o.bindRouteDestination(rRouteDestination, rhkRouteDestination, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnRoutesRouteRouteDestinationFlagsGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindRouteDestination binds and validates parameter RouteDestination from path. +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetParams) bindRouteDestination(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.RouteDestination = raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnRoutesRouteRouteDestinationFlagsGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_flags_get_responses.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_flags_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..190a6568317c9957ee73a55adc20d0f06edb0086 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_flags_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnRoutesRouteRouteDestinationFlagsGetOKCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationFlagsGetOK +const DataCocsnRoutesRouteRouteDestinationFlagsGetOKCode int = 200 + +/*DataCocsnRoutesRouteRouteDestinationFlagsGetOK Flags of the route + +swagger:response dataCocsnRoutesRouteRouteDestinationFlagsGetOK +*/ +type DataCocsnRoutesRouteRouteDestinationFlagsGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnRoutesRouteRouteDestinationFlags `json:"body,omitempty"` +} + +// NewDataCocsnRoutesRouteRouteDestinationFlagsGetOK creates DataCocsnRoutesRouteRouteDestinationFlagsGetOK with default headers values +func NewDataCocsnRoutesRouteRouteDestinationFlagsGetOK() *DataCocsnRoutesRouteRouteDestinationFlagsGetOK { + + return &DataCocsnRoutesRouteRouteDestinationFlagsGetOK{} +} + +// WithPayload adds the payload to the data cocsn routes route route destination flags get o k response +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetOK) WithPayload(payload *models.DataCocsnRoutesRouteRouteDestinationFlags) *DataCocsnRoutesRouteRouteDestinationFlagsGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn routes route route destination flags get o k response +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetOK) SetPayload(payload *models.DataCocsnRoutesRouteRouteDestinationFlags) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnRoutesRouteRouteDestinationFlagsGetNoContentCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationFlagsGetNoContent +const DataCocsnRoutesRouteRouteDestinationFlagsGetNoContentCode int = 204 + +/*DataCocsnRoutesRouteRouteDestinationFlagsGetNoContent No Content + +swagger:response dataCocsnRoutesRouteRouteDestinationFlagsGetNoContent +*/ +type DataCocsnRoutesRouteRouteDestinationFlagsGetNoContent struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationFlagsGetNoContent creates DataCocsnRoutesRouteRouteDestinationFlagsGetNoContent with default headers values +func NewDataCocsnRoutesRouteRouteDestinationFlagsGetNoContent() *DataCocsnRoutesRouteRouteDestinationFlagsGetNoContent { + + return &DataCocsnRoutesRouteRouteDestinationFlagsGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnRoutesRouteRouteDestinationFlagsGetBadRequestCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationFlagsGetBadRequest +const DataCocsnRoutesRouteRouteDestinationFlagsGetBadRequestCode int = 400 + +/*DataCocsnRoutesRouteRouteDestinationFlagsGetBadRequest Bad Request + +swagger:response dataCocsnRoutesRouteRouteDestinationFlagsGetBadRequest +*/ +type DataCocsnRoutesRouteRouteDestinationFlagsGetBadRequest struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationFlagsGetBadRequest creates DataCocsnRoutesRouteRouteDestinationFlagsGetBadRequest with default headers values +func NewDataCocsnRoutesRouteRouteDestinationFlagsGetBadRequest() *DataCocsnRoutesRouteRouteDestinationFlagsGetBadRequest { + + return &DataCocsnRoutesRouteRouteDestinationFlagsGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnRoutesRouteRouteDestinationFlagsGetUnauthorizedCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationFlagsGetUnauthorized +const DataCocsnRoutesRouteRouteDestinationFlagsGetUnauthorizedCode int = 401 + +/*DataCocsnRoutesRouteRouteDestinationFlagsGetUnauthorized Unauthorized + +swagger:response dataCocsnRoutesRouteRouteDestinationFlagsGetUnauthorized +*/ +type DataCocsnRoutesRouteRouteDestinationFlagsGetUnauthorized struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationFlagsGetUnauthorized creates DataCocsnRoutesRouteRouteDestinationFlagsGetUnauthorized with default headers values +func NewDataCocsnRoutesRouteRouteDestinationFlagsGetUnauthorized() *DataCocsnRoutesRouteRouteDestinationFlagsGetUnauthorized { + + return &DataCocsnRoutesRouteRouteDestinationFlagsGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnRoutesRouteRouteDestinationFlagsGetNotFoundCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationFlagsGetNotFound +const DataCocsnRoutesRouteRouteDestinationFlagsGetNotFoundCode int = 404 + +/*DataCocsnRoutesRouteRouteDestinationFlagsGetNotFound Not Found + +swagger:response dataCocsnRoutesRouteRouteDestinationFlagsGetNotFound +*/ +type DataCocsnRoutesRouteRouteDestinationFlagsGetNotFound struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationFlagsGetNotFound creates DataCocsnRoutesRouteRouteDestinationFlagsGetNotFound with default headers values +func NewDataCocsnRoutesRouteRouteDestinationFlagsGetNotFound() *DataCocsnRoutesRouteRouteDestinationFlagsGetNotFound { + + return &DataCocsnRoutesRouteRouteDestinationFlagsGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnRoutesRouteRouteDestinationFlagsGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationFlagsGetMethodNotAllowed +const DataCocsnRoutesRouteRouteDestinationFlagsGetMethodNotAllowedCode int = 405 + +/*DataCocsnRoutesRouteRouteDestinationFlagsGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnRoutesRouteRouteDestinationFlagsGetMethodNotAllowed +*/ +type DataCocsnRoutesRouteRouteDestinationFlagsGetMethodNotAllowed struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationFlagsGetMethodNotAllowed creates DataCocsnRoutesRouteRouteDestinationFlagsGetMethodNotAllowed with default headers values +func NewDataCocsnRoutesRouteRouteDestinationFlagsGetMethodNotAllowed() *DataCocsnRoutesRouteRouteDestinationFlagsGetMethodNotAllowed { + + return &DataCocsnRoutesRouteRouteDestinationFlagsGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnRoutesRouteRouteDestinationFlagsGetConflictCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationFlagsGetConflict +const DataCocsnRoutesRouteRouteDestinationFlagsGetConflictCode int = 409 + +/*DataCocsnRoutesRouteRouteDestinationFlagsGetConflict Conflict + +swagger:response dataCocsnRoutesRouteRouteDestinationFlagsGetConflict +*/ +type DataCocsnRoutesRouteRouteDestinationFlagsGetConflict struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationFlagsGetConflict creates DataCocsnRoutesRouteRouteDestinationFlagsGetConflict with default headers values +func NewDataCocsnRoutesRouteRouteDestinationFlagsGetConflict() *DataCocsnRoutesRouteRouteDestinationFlagsGetConflict { + + return &DataCocsnRoutesRouteRouteDestinationFlagsGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_flags_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_flags_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..2148573b80fcaebcc16d95d6d24cd8395468c267 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_flags_get_urlbuilder.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DataCocsnRoutesRouteRouteDestinationFlagsGetURL generates an URL for the data cocsn routes route route destination flags get operation +type DataCocsnRoutesRouteRouteDestinationFlagsGetURL struct { + RouteDestination string + + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetURL) WithBasePath(bp string) *DataCocsnRoutesRouteRouteDestinationFlagsGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:routes/route={route-destination}/flags" + + routeDestination := o.RouteDestination + if routeDestination != "" { + _path = strings.Replace(_path, "{route-destination}", routeDestination, -1) + } else { + return nil, errors.New("routeDestination is required on DataCocsnRoutesRouteRouteDestinationFlagsGetURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnRoutesRouteRouteDestinationFlagsGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnRoutesRouteRouteDestinationFlagsGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnRoutesRouteRouteDestinationFlagsGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_gateway_get.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_gateway_get.go new file mode 100644 index 0000000000000000000000000000000000000000..4f5e112d8688f2c196ec64b831d9ac277d3e8b22 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_gateway_get.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnRoutesRouteRouteDestinationGatewayGetHandlerFunc turns a function with the right signature into a data cocsn routes route route destination gateway get handler +type DataCocsnRoutesRouteRouteDestinationGatewayGetHandlerFunc func(DataCocsnRoutesRouteRouteDestinationGatewayGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnRoutesRouteRouteDestinationGatewayGetHandlerFunc) Handle(params DataCocsnRoutesRouteRouteDestinationGatewayGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnRoutesRouteRouteDestinationGatewayGetHandler interface for that can handle valid data cocsn routes route route destination gateway get params +type DataCocsnRoutesRouteRouteDestinationGatewayGetHandler interface { + Handle(DataCocsnRoutesRouteRouteDestinationGatewayGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnRoutesRouteRouteDestinationGatewayGet creates a new http.Handler for the data cocsn routes route route destination gateway get operation +func NewDataCocsnRoutesRouteRouteDestinationGatewayGet(ctx *middleware.Context, handler DataCocsnRoutesRouteRouteDestinationGatewayGetHandler) *DataCocsnRoutesRouteRouteDestinationGatewayGet { + return &DataCocsnRoutesRouteRouteDestinationGatewayGet{Context: ctx, Handler: handler} +} + +/*DataCocsnRoutesRouteRouteDestinationGatewayGet swagger:route GET /data/cocsn:routes/route={route-destination}/gateway data get dataCocsnRoutesRouteRouteDestinationGatewayGet + +Route gateway. IP address or host name + +Route gateway. IP address or host name + +*/ +type DataCocsnRoutesRouteRouteDestinationGatewayGet struct { + Context *middleware.Context + Handler DataCocsnRoutesRouteRouteDestinationGatewayGetHandler +} + +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnRoutesRouteRouteDestinationGatewayGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_gateway_get_parameters.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_gateway_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..94a496631765681fb66af04b940e6d60ade8b8ed --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_gateway_get_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnRoutesRouteRouteDestinationGatewayGetParams creates a new DataCocsnRoutesRouteRouteDestinationGatewayGetParams object +// with the default values initialized. +func NewDataCocsnRoutesRouteRouteDestinationGatewayGetParams() DataCocsnRoutesRouteRouteDestinationGatewayGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnRoutesRouteRouteDestinationGatewayGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnRoutesRouteRouteDestinationGatewayGetParams contains all the bound params for the data cocsn routes route route destination gateway get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_routes_route_route_destination_gateway_get +type DataCocsnRoutesRouteRouteDestinationGatewayGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*Route destination. IP network + Required: true + In: path + */ + RouteDestination string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnRoutesRouteRouteDestinationGatewayGetParams() beforehand. +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + rRouteDestination, rhkRouteDestination, _ := route.Params.GetOK("route-destination") + if err := o.bindRouteDestination(rRouteDestination, rhkRouteDestination, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnRoutesRouteRouteDestinationGatewayGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindRouteDestination binds and validates parameter RouteDestination from path. +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetParams) bindRouteDestination(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.RouteDestination = raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnRoutesRouteRouteDestinationGatewayGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_gateway_get_responses.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_gateway_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..29b34e402a2ab4170b7d7ecac2ebcbd9c6cd135f --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_gateway_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnRoutesRouteRouteDestinationGatewayGetOKCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationGatewayGetOK +const DataCocsnRoutesRouteRouteDestinationGatewayGetOKCode int = 200 + +/*DataCocsnRoutesRouteRouteDestinationGatewayGetOK Route gateway. IP address or host name + +swagger:response dataCocsnRoutesRouteRouteDestinationGatewayGetOK +*/ +type DataCocsnRoutesRouteRouteDestinationGatewayGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnRoutesRouteRouteDestinationGateway `json:"body,omitempty"` +} + +// NewDataCocsnRoutesRouteRouteDestinationGatewayGetOK creates DataCocsnRoutesRouteRouteDestinationGatewayGetOK with default headers values +func NewDataCocsnRoutesRouteRouteDestinationGatewayGetOK() *DataCocsnRoutesRouteRouteDestinationGatewayGetOK { + + return &DataCocsnRoutesRouteRouteDestinationGatewayGetOK{} +} + +// WithPayload adds the payload to the data cocsn routes route route destination gateway get o k response +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetOK) WithPayload(payload *models.DataCocsnRoutesRouteRouteDestinationGateway) *DataCocsnRoutesRouteRouteDestinationGatewayGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn routes route route destination gateway get o k response +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetOK) SetPayload(payload *models.DataCocsnRoutesRouteRouteDestinationGateway) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnRoutesRouteRouteDestinationGatewayGetNoContentCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationGatewayGetNoContent +const DataCocsnRoutesRouteRouteDestinationGatewayGetNoContentCode int = 204 + +/*DataCocsnRoutesRouteRouteDestinationGatewayGetNoContent No Content + +swagger:response dataCocsnRoutesRouteRouteDestinationGatewayGetNoContent +*/ +type DataCocsnRoutesRouteRouteDestinationGatewayGetNoContent struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationGatewayGetNoContent creates DataCocsnRoutesRouteRouteDestinationGatewayGetNoContent with default headers values +func NewDataCocsnRoutesRouteRouteDestinationGatewayGetNoContent() *DataCocsnRoutesRouteRouteDestinationGatewayGetNoContent { + + return &DataCocsnRoutesRouteRouteDestinationGatewayGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnRoutesRouteRouteDestinationGatewayGetBadRequestCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationGatewayGetBadRequest +const DataCocsnRoutesRouteRouteDestinationGatewayGetBadRequestCode int = 400 + +/*DataCocsnRoutesRouteRouteDestinationGatewayGetBadRequest Bad Request + +swagger:response dataCocsnRoutesRouteRouteDestinationGatewayGetBadRequest +*/ +type DataCocsnRoutesRouteRouteDestinationGatewayGetBadRequest struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationGatewayGetBadRequest creates DataCocsnRoutesRouteRouteDestinationGatewayGetBadRequest with default headers values +func NewDataCocsnRoutesRouteRouteDestinationGatewayGetBadRequest() *DataCocsnRoutesRouteRouteDestinationGatewayGetBadRequest { + + return &DataCocsnRoutesRouteRouteDestinationGatewayGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnRoutesRouteRouteDestinationGatewayGetUnauthorizedCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationGatewayGetUnauthorized +const DataCocsnRoutesRouteRouteDestinationGatewayGetUnauthorizedCode int = 401 + +/*DataCocsnRoutesRouteRouteDestinationGatewayGetUnauthorized Unauthorized + +swagger:response dataCocsnRoutesRouteRouteDestinationGatewayGetUnauthorized +*/ +type DataCocsnRoutesRouteRouteDestinationGatewayGetUnauthorized struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationGatewayGetUnauthorized creates DataCocsnRoutesRouteRouteDestinationGatewayGetUnauthorized with default headers values +func NewDataCocsnRoutesRouteRouteDestinationGatewayGetUnauthorized() *DataCocsnRoutesRouteRouteDestinationGatewayGetUnauthorized { + + return &DataCocsnRoutesRouteRouteDestinationGatewayGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnRoutesRouteRouteDestinationGatewayGetNotFoundCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationGatewayGetNotFound +const DataCocsnRoutesRouteRouteDestinationGatewayGetNotFoundCode int = 404 + +/*DataCocsnRoutesRouteRouteDestinationGatewayGetNotFound Not Found + +swagger:response dataCocsnRoutesRouteRouteDestinationGatewayGetNotFound +*/ +type DataCocsnRoutesRouteRouteDestinationGatewayGetNotFound struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationGatewayGetNotFound creates DataCocsnRoutesRouteRouteDestinationGatewayGetNotFound with default headers values +func NewDataCocsnRoutesRouteRouteDestinationGatewayGetNotFound() *DataCocsnRoutesRouteRouteDestinationGatewayGetNotFound { + + return &DataCocsnRoutesRouteRouteDestinationGatewayGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnRoutesRouteRouteDestinationGatewayGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationGatewayGetMethodNotAllowed +const DataCocsnRoutesRouteRouteDestinationGatewayGetMethodNotAllowedCode int = 405 + +/*DataCocsnRoutesRouteRouteDestinationGatewayGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnRoutesRouteRouteDestinationGatewayGetMethodNotAllowed +*/ +type DataCocsnRoutesRouteRouteDestinationGatewayGetMethodNotAllowed struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationGatewayGetMethodNotAllowed creates DataCocsnRoutesRouteRouteDestinationGatewayGetMethodNotAllowed with default headers values +func NewDataCocsnRoutesRouteRouteDestinationGatewayGetMethodNotAllowed() *DataCocsnRoutesRouteRouteDestinationGatewayGetMethodNotAllowed { + + return &DataCocsnRoutesRouteRouteDestinationGatewayGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnRoutesRouteRouteDestinationGatewayGetConflictCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationGatewayGetConflict +const DataCocsnRoutesRouteRouteDestinationGatewayGetConflictCode int = 409 + +/*DataCocsnRoutesRouteRouteDestinationGatewayGetConflict Conflict + +swagger:response dataCocsnRoutesRouteRouteDestinationGatewayGetConflict +*/ +type DataCocsnRoutesRouteRouteDestinationGatewayGetConflict struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationGatewayGetConflict creates DataCocsnRoutesRouteRouteDestinationGatewayGetConflict with default headers values +func NewDataCocsnRoutesRouteRouteDestinationGatewayGetConflict() *DataCocsnRoutesRouteRouteDestinationGatewayGetConflict { + + return &DataCocsnRoutesRouteRouteDestinationGatewayGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_gateway_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_gateway_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..797fb02f1b10a35495b318be66ed1ccbe3e59c37 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_gateway_get_urlbuilder.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DataCocsnRoutesRouteRouteDestinationGatewayGetURL generates an URL for the data cocsn routes route route destination gateway get operation +type DataCocsnRoutesRouteRouteDestinationGatewayGetURL struct { + RouteDestination string + + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetURL) WithBasePath(bp string) *DataCocsnRoutesRouteRouteDestinationGatewayGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:routes/route={route-destination}/gateway" + + routeDestination := o.RouteDestination + if routeDestination != "" { + _path = strings.Replace(_path, "{route-destination}", routeDestination, -1) + } else { + return nil, errors.New("routeDestination is required on DataCocsnRoutesRouteRouteDestinationGatewayGetURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnRoutesRouteRouteDestinationGatewayGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnRoutesRouteRouteDestinationGatewayGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnRoutesRouteRouteDestinationGatewayGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_get.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_get.go new file mode 100644 index 0000000000000000000000000000000000000000..ebb27e3807d7a2fa81aca7ecb93aa9efee8bd615 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_get.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnRoutesRouteRouteDestinationGetHandlerFunc turns a function with the right signature into a data cocsn routes route route destination get handler +type DataCocsnRoutesRouteRouteDestinationGetHandlerFunc func(DataCocsnRoutesRouteRouteDestinationGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnRoutesRouteRouteDestinationGetHandlerFunc) Handle(params DataCocsnRoutesRouteRouteDestinationGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnRoutesRouteRouteDestinationGetHandler interface for that can handle valid data cocsn routes route route destination get params +type DataCocsnRoutesRouteRouteDestinationGetHandler interface { + Handle(DataCocsnRoutesRouteRouteDestinationGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnRoutesRouteRouteDestinationGet creates a new http.Handler for the data cocsn routes route route destination get operation +func NewDataCocsnRoutesRouteRouteDestinationGet(ctx *middleware.Context, handler DataCocsnRoutesRouteRouteDestinationGetHandler) *DataCocsnRoutesRouteRouteDestinationGet { + return &DataCocsnRoutesRouteRouteDestinationGet{Context: ctx, Handler: handler} +} + +/*DataCocsnRoutesRouteRouteDestinationGet swagger:route GET /data/cocsn:routes/route={route-destination} data get dataCocsnRoutesRouteRouteDestinationGet + +DataCocsnRoutesRouteRouteDestinationGet data cocsn routes route route destination get API + +*/ +type DataCocsnRoutesRouteRouteDestinationGet struct { + Context *middleware.Context + Handler DataCocsnRoutesRouteRouteDestinationGetHandler +} + +func (o *DataCocsnRoutesRouteRouteDestinationGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnRoutesRouteRouteDestinationGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_get_parameters.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8bd7d72010dd25441b0469804c2808c111147bc3 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_get_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnRoutesRouteRouteDestinationGetParams creates a new DataCocsnRoutesRouteRouteDestinationGetParams object +// with the default values initialized. +func NewDataCocsnRoutesRouteRouteDestinationGetParams() DataCocsnRoutesRouteRouteDestinationGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnRoutesRouteRouteDestinationGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnRoutesRouteRouteDestinationGetParams contains all the bound params for the data cocsn routes route route destination get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_routes_route_route_destination_get +type DataCocsnRoutesRouteRouteDestinationGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*Route destination. IP network + Required: true + In: path + */ + RouteDestination string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnRoutesRouteRouteDestinationGetParams() beforehand. +func (o *DataCocsnRoutesRouteRouteDestinationGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + rRouteDestination, rhkRouteDestination, _ := route.Params.GetOK("route-destination") + if err := o.bindRouteDestination(rRouteDestination, rhkRouteDestination, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnRoutesRouteRouteDestinationGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnRoutesRouteRouteDestinationGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnRoutesRouteRouteDestinationGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnRoutesRouteRouteDestinationGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnRoutesRouteRouteDestinationGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnRoutesRouteRouteDestinationGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindRouteDestination binds and validates parameter RouteDestination from path. +func (o *DataCocsnRoutesRouteRouteDestinationGetParams) bindRouteDestination(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.RouteDestination = raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnRoutesRouteRouteDestinationGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnRoutesRouteRouteDestinationGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnRoutesRouteRouteDestinationGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_get_responses.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..47ebca2aa6df60a750c222165ef20b550237da5b --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnRoutesRouteRouteDestinationGetOKCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationGetOK +const DataCocsnRoutesRouteRouteDestinationGetOKCode int = 200 + +/*DataCocsnRoutesRouteRouteDestinationGetOK OK + +swagger:response dataCocsnRoutesRouteRouteDestinationGetOK +*/ +type DataCocsnRoutesRouteRouteDestinationGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnRoutesRouteRouteDestination `json:"body,omitempty"` +} + +// NewDataCocsnRoutesRouteRouteDestinationGetOK creates DataCocsnRoutesRouteRouteDestinationGetOK with default headers values +func NewDataCocsnRoutesRouteRouteDestinationGetOK() *DataCocsnRoutesRouteRouteDestinationGetOK { + + return &DataCocsnRoutesRouteRouteDestinationGetOK{} +} + +// WithPayload adds the payload to the data cocsn routes route route destination get o k response +func (o *DataCocsnRoutesRouteRouteDestinationGetOK) WithPayload(payload *models.DataCocsnRoutesRouteRouteDestination) *DataCocsnRoutesRouteRouteDestinationGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn routes route route destination get o k response +func (o *DataCocsnRoutesRouteRouteDestinationGetOK) SetPayload(payload *models.DataCocsnRoutesRouteRouteDestination) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnRoutesRouteRouteDestinationGetNoContentCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationGetNoContent +const DataCocsnRoutesRouteRouteDestinationGetNoContentCode int = 204 + +/*DataCocsnRoutesRouteRouteDestinationGetNoContent No Content + +swagger:response dataCocsnRoutesRouteRouteDestinationGetNoContent +*/ +type DataCocsnRoutesRouteRouteDestinationGetNoContent struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationGetNoContent creates DataCocsnRoutesRouteRouteDestinationGetNoContent with default headers values +func NewDataCocsnRoutesRouteRouteDestinationGetNoContent() *DataCocsnRoutesRouteRouteDestinationGetNoContent { + + return &DataCocsnRoutesRouteRouteDestinationGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnRoutesRouteRouteDestinationGetBadRequestCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationGetBadRequest +const DataCocsnRoutesRouteRouteDestinationGetBadRequestCode int = 400 + +/*DataCocsnRoutesRouteRouteDestinationGetBadRequest Bad Request + +swagger:response dataCocsnRoutesRouteRouteDestinationGetBadRequest +*/ +type DataCocsnRoutesRouteRouteDestinationGetBadRequest struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationGetBadRequest creates DataCocsnRoutesRouteRouteDestinationGetBadRequest with default headers values +func NewDataCocsnRoutesRouteRouteDestinationGetBadRequest() *DataCocsnRoutesRouteRouteDestinationGetBadRequest { + + return &DataCocsnRoutesRouteRouteDestinationGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnRoutesRouteRouteDestinationGetUnauthorizedCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationGetUnauthorized +const DataCocsnRoutesRouteRouteDestinationGetUnauthorizedCode int = 401 + +/*DataCocsnRoutesRouteRouteDestinationGetUnauthorized Unauthorized + +swagger:response dataCocsnRoutesRouteRouteDestinationGetUnauthorized +*/ +type DataCocsnRoutesRouteRouteDestinationGetUnauthorized struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationGetUnauthorized creates DataCocsnRoutesRouteRouteDestinationGetUnauthorized with default headers values +func NewDataCocsnRoutesRouteRouteDestinationGetUnauthorized() *DataCocsnRoutesRouteRouteDestinationGetUnauthorized { + + return &DataCocsnRoutesRouteRouteDestinationGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnRoutesRouteRouteDestinationGetNotFoundCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationGetNotFound +const DataCocsnRoutesRouteRouteDestinationGetNotFoundCode int = 404 + +/*DataCocsnRoutesRouteRouteDestinationGetNotFound Not Found + +swagger:response dataCocsnRoutesRouteRouteDestinationGetNotFound +*/ +type DataCocsnRoutesRouteRouteDestinationGetNotFound struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationGetNotFound creates DataCocsnRoutesRouteRouteDestinationGetNotFound with default headers values +func NewDataCocsnRoutesRouteRouteDestinationGetNotFound() *DataCocsnRoutesRouteRouteDestinationGetNotFound { + + return &DataCocsnRoutesRouteRouteDestinationGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnRoutesRouteRouteDestinationGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationGetMethodNotAllowed +const DataCocsnRoutesRouteRouteDestinationGetMethodNotAllowedCode int = 405 + +/*DataCocsnRoutesRouteRouteDestinationGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnRoutesRouteRouteDestinationGetMethodNotAllowed +*/ +type DataCocsnRoutesRouteRouteDestinationGetMethodNotAllowed struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationGetMethodNotAllowed creates DataCocsnRoutesRouteRouteDestinationGetMethodNotAllowed with default headers values +func NewDataCocsnRoutesRouteRouteDestinationGetMethodNotAllowed() *DataCocsnRoutesRouteRouteDestinationGetMethodNotAllowed { + + return &DataCocsnRoutesRouteRouteDestinationGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnRoutesRouteRouteDestinationGetConflictCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationGetConflict +const DataCocsnRoutesRouteRouteDestinationGetConflictCode int = 409 + +/*DataCocsnRoutesRouteRouteDestinationGetConflict Conflict + +swagger:response dataCocsnRoutesRouteRouteDestinationGetConflict +*/ +type DataCocsnRoutesRouteRouteDestinationGetConflict struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationGetConflict creates DataCocsnRoutesRouteRouteDestinationGetConflict with default headers values +func NewDataCocsnRoutesRouteRouteDestinationGetConflict() *DataCocsnRoutesRouteRouteDestinationGetConflict { + + return &DataCocsnRoutesRouteRouteDestinationGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..08310ceeaabf64d9df0c0cdc35d7ca539f2333f9 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_get_urlbuilder.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DataCocsnRoutesRouteRouteDestinationGetURL generates an URL for the data cocsn routes route route destination get operation +type DataCocsnRoutesRouteRouteDestinationGetURL struct { + RouteDestination string + + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesRouteRouteDestinationGetURL) WithBasePath(bp string) *DataCocsnRoutesRouteRouteDestinationGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesRouteRouteDestinationGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnRoutesRouteRouteDestinationGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:routes/route={route-destination}" + + routeDestination := o.RouteDestination + if routeDestination != "" { + _path = strings.Replace(_path, "{route-destination}", routeDestination, -1) + } else { + return nil, errors.New("routeDestination is required on DataCocsnRoutesRouteRouteDestinationGetURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnRoutesRouteRouteDestinationGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnRoutesRouteRouteDestinationGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnRoutesRouteRouteDestinationGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnRoutesRouteRouteDestinationGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnRoutesRouteRouteDestinationGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnRoutesRouteRouteDestinationGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_interface_get.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_interface_get.go new file mode 100644 index 0000000000000000000000000000000000000000..e9e91d597f9b1b43b088657c155f3283dfb5a937 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_interface_get.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataCocsnRoutesRouteRouteDestinationInterfaceGetHandlerFunc turns a function with the right signature into a data cocsn routes route route destination interface get handler +type DataCocsnRoutesRouteRouteDestinationInterfaceGetHandlerFunc func(DataCocsnRoutesRouteRouteDestinationInterfaceGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataCocsnRoutesRouteRouteDestinationInterfaceGetHandlerFunc) Handle(params DataCocsnRoutesRouteRouteDestinationInterfaceGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataCocsnRoutesRouteRouteDestinationInterfaceGetHandler interface for that can handle valid data cocsn routes route route destination interface get params +type DataCocsnRoutesRouteRouteDestinationInterfaceGetHandler interface { + Handle(DataCocsnRoutesRouteRouteDestinationInterfaceGetParams, interface{}) middleware.Responder +} + +// NewDataCocsnRoutesRouteRouteDestinationInterfaceGet creates a new http.Handler for the data cocsn routes route route destination interface get operation +func NewDataCocsnRoutesRouteRouteDestinationInterfaceGet(ctx *middleware.Context, handler DataCocsnRoutesRouteRouteDestinationInterfaceGetHandler) *DataCocsnRoutesRouteRouteDestinationInterfaceGet { + return &DataCocsnRoutesRouteRouteDestinationInterfaceGet{Context: ctx, Handler: handler} +} + +/*DataCocsnRoutesRouteRouteDestinationInterfaceGet swagger:route GET /data/cocsn:routes/route={route-destination}/interface data get dataCocsnRoutesRouteRouteDestinationInterfaceGet + +Interface used for the route + +Interface used for the route + +*/ +type DataCocsnRoutesRouteRouteDestinationInterfaceGet struct { + Context *middleware.Context + Handler DataCocsnRoutesRouteRouteDestinationInterfaceGetHandler +} + +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataCocsnRoutesRouteRouteDestinationInterfaceGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_interface_get_parameters.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_interface_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..3c5f7b8890bc50f59d5934556aa29deed7035e74 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_interface_get_parameters.go @@ -0,0 +1,260 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDataCocsnRoutesRouteRouteDestinationInterfaceGetParams creates a new DataCocsnRoutesRouteRouteDestinationInterfaceGetParams object +// with the default values initialized. +func NewDataCocsnRoutesRouteRouteDestinationInterfaceGetParams() DataCocsnRoutesRouteRouteDestinationInterfaceGetParams { + + var ( + // initialize parameters with default values + + contentDefault = string("config") + + withDefaultsDefault = string("report-all") + ) + + return DataCocsnRoutesRouteRouteDestinationInterfaceGetParams{ + Content: &contentDefault, + + WithDefaults: &withDefaultsDefault, + } +} + +// DataCocsnRoutesRouteRouteDestinationInterfaceGetParams contains all the bound params for the data cocsn routes route route destination interface get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_cocsn_routes_route_route_destination_interface_get +type DataCocsnRoutesRouteRouteDestinationInterfaceGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*controlling descendant nodes in response + In: query + Default: "config" + */ + Content *string + /*limit the depth of nodes in response + In: query + */ + Depth *uint16 + /*optionally identify specific data nodes in response + In: query + */ + Fields *string + /*xpath expression to filter data nodes in response + In: query + */ + Filter *string + /*Route destination. IP network + Required: true + In: path + */ + RouteDestination string + /*controlling default values in response + In: query + Default: "report-all" + */ + WithDefaults *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataCocsnRoutesRouteRouteDestinationInterfaceGetParams() beforehand. +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qContent, qhkContent, _ := qs.GetOK("content") + if err := o.bindContent(qContent, qhkContent, route.Formats); err != nil { + res = append(res, err) + } + + qDepth, qhkDepth, _ := qs.GetOK("depth") + if err := o.bindDepth(qDepth, qhkDepth, route.Formats); err != nil { + res = append(res, err) + } + + qFields, qhkFields, _ := qs.GetOK("fields") + if err := o.bindFields(qFields, qhkFields, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + rRouteDestination, rhkRouteDestination, _ := route.Params.GetOK("route-destination") + if err := o.bindRouteDestination(rRouteDestination, rhkRouteDestination, route.Formats); err != nil { + res = append(res, err) + } + + qWithDefaults, qhkWithDefaults, _ := qs.GetOK("with-defaults") + if err := o.bindWithDefaults(qWithDefaults, qhkWithDefaults, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindContent binds and validates parameter Content from query. +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetParams) bindContent(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnRoutesRouteRouteDestinationInterfaceGetParams() + return nil + } + + o.Content = &raw + + if err := o.validateContent(formats); err != nil { + return err + } + + return nil +} + +// validateContent carries on validations for parameter Content +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetParams) validateContent(formats strfmt.Registry) error { + + if err := validate.EnumCase("content", "query", *o.Content, []interface{}{"config", "nonconfig", "all"}, true); err != nil { + return err + } + + return nil +} + +// bindDepth binds and validates parameter Depth from query. +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetParams) bindDepth(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertUint16(raw) + if err != nil { + return errors.InvalidType("depth", "query", "uint16", raw) + } + o.Depth = &value + + return nil +} + +// bindFields binds and validates parameter Fields from query. +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetParams) bindFields(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Fields = &raw + + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + return nil + } + + o.Filter = &raw + + return nil +} + +// bindRouteDestination binds and validates parameter RouteDestination from path. +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetParams) bindRouteDestination(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.RouteDestination = raw + + return nil +} + +// bindWithDefaults binds and validates parameter WithDefaults from query. +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetParams) bindWithDefaults(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDataCocsnRoutesRouteRouteDestinationInterfaceGetParams() + return nil + } + + o.WithDefaults = &raw + + if err := o.validateWithDefaults(formats); err != nil { + return err + } + + return nil +} + +// validateWithDefaults carries on validations for parameter WithDefaults +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetParams) validateWithDefaults(formats strfmt.Registry) error { + + if err := validate.EnumCase("with-defaults", "query", *o.WithDefaults, []interface{}{"report-all", "trim", "explicit", "report-all-tagged"}, true); err != nil { + return err + } + + return nil +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_interface_get_responses.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_interface_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..dcff89fcb086b65eab532e3437483ce970e9a989 --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_interface_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataCocsnRoutesRouteRouteDestinationInterfaceGetOKCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationInterfaceGetOK +const DataCocsnRoutesRouteRouteDestinationInterfaceGetOKCode int = 200 + +/*DataCocsnRoutesRouteRouteDestinationInterfaceGetOK Interface used for the route + +swagger:response dataCocsnRoutesRouteRouteDestinationInterfaceGetOK +*/ +type DataCocsnRoutesRouteRouteDestinationInterfaceGetOK struct { + + /* + In: Body + */ + Payload *models.DataCocsnRoutesRouteRouteDestinationInterface `json:"body,omitempty"` +} + +// NewDataCocsnRoutesRouteRouteDestinationInterfaceGetOK creates DataCocsnRoutesRouteRouteDestinationInterfaceGetOK with default headers values +func NewDataCocsnRoutesRouteRouteDestinationInterfaceGetOK() *DataCocsnRoutesRouteRouteDestinationInterfaceGetOK { + + return &DataCocsnRoutesRouteRouteDestinationInterfaceGetOK{} +} + +// WithPayload adds the payload to the data cocsn routes route route destination interface get o k response +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetOK) WithPayload(payload *models.DataCocsnRoutesRouteRouteDestinationInterface) *DataCocsnRoutesRouteRouteDestinationInterfaceGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data cocsn routes route route destination interface get o k response +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetOK) SetPayload(payload *models.DataCocsnRoutesRouteRouteDestinationInterface) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataCocsnRoutesRouteRouteDestinationInterfaceGetNoContentCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationInterfaceGetNoContent +const DataCocsnRoutesRouteRouteDestinationInterfaceGetNoContentCode int = 204 + +/*DataCocsnRoutesRouteRouteDestinationInterfaceGetNoContent No Content + +swagger:response dataCocsnRoutesRouteRouteDestinationInterfaceGetNoContent +*/ +type DataCocsnRoutesRouteRouteDestinationInterfaceGetNoContent struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationInterfaceGetNoContent creates DataCocsnRoutesRouteRouteDestinationInterfaceGetNoContent with default headers values +func NewDataCocsnRoutesRouteRouteDestinationInterfaceGetNoContent() *DataCocsnRoutesRouteRouteDestinationInterfaceGetNoContent { + + return &DataCocsnRoutesRouteRouteDestinationInterfaceGetNoContent{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataCocsnRoutesRouteRouteDestinationInterfaceGetBadRequestCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationInterfaceGetBadRequest +const DataCocsnRoutesRouteRouteDestinationInterfaceGetBadRequestCode int = 400 + +/*DataCocsnRoutesRouteRouteDestinationInterfaceGetBadRequest Bad Request + +swagger:response dataCocsnRoutesRouteRouteDestinationInterfaceGetBadRequest +*/ +type DataCocsnRoutesRouteRouteDestinationInterfaceGetBadRequest struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationInterfaceGetBadRequest creates DataCocsnRoutesRouteRouteDestinationInterfaceGetBadRequest with default headers values +func NewDataCocsnRoutesRouteRouteDestinationInterfaceGetBadRequest() *DataCocsnRoutesRouteRouteDestinationInterfaceGetBadRequest { + + return &DataCocsnRoutesRouteRouteDestinationInterfaceGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataCocsnRoutesRouteRouteDestinationInterfaceGetUnauthorizedCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationInterfaceGetUnauthorized +const DataCocsnRoutesRouteRouteDestinationInterfaceGetUnauthorizedCode int = 401 + +/*DataCocsnRoutesRouteRouteDestinationInterfaceGetUnauthorized Unauthorized + +swagger:response dataCocsnRoutesRouteRouteDestinationInterfaceGetUnauthorized +*/ +type DataCocsnRoutesRouteRouteDestinationInterfaceGetUnauthorized struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationInterfaceGetUnauthorized creates DataCocsnRoutesRouteRouteDestinationInterfaceGetUnauthorized with default headers values +func NewDataCocsnRoutesRouteRouteDestinationInterfaceGetUnauthorized() *DataCocsnRoutesRouteRouteDestinationInterfaceGetUnauthorized { + + return &DataCocsnRoutesRouteRouteDestinationInterfaceGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataCocsnRoutesRouteRouteDestinationInterfaceGetNotFoundCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationInterfaceGetNotFound +const DataCocsnRoutesRouteRouteDestinationInterfaceGetNotFoundCode int = 404 + +/*DataCocsnRoutesRouteRouteDestinationInterfaceGetNotFound Not Found + +swagger:response dataCocsnRoutesRouteRouteDestinationInterfaceGetNotFound +*/ +type DataCocsnRoutesRouteRouteDestinationInterfaceGetNotFound struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationInterfaceGetNotFound creates DataCocsnRoutesRouteRouteDestinationInterfaceGetNotFound with default headers values +func NewDataCocsnRoutesRouteRouteDestinationInterfaceGetNotFound() *DataCocsnRoutesRouteRouteDestinationInterfaceGetNotFound { + + return &DataCocsnRoutesRouteRouteDestinationInterfaceGetNotFound{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataCocsnRoutesRouteRouteDestinationInterfaceGetMethodNotAllowedCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationInterfaceGetMethodNotAllowed +const DataCocsnRoutesRouteRouteDestinationInterfaceGetMethodNotAllowedCode int = 405 + +/*DataCocsnRoutesRouteRouteDestinationInterfaceGetMethodNotAllowed Method Not Allowed + +swagger:response dataCocsnRoutesRouteRouteDestinationInterfaceGetMethodNotAllowed +*/ +type DataCocsnRoutesRouteRouteDestinationInterfaceGetMethodNotAllowed struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationInterfaceGetMethodNotAllowed creates DataCocsnRoutesRouteRouteDestinationInterfaceGetMethodNotAllowed with default headers values +func NewDataCocsnRoutesRouteRouteDestinationInterfaceGetMethodNotAllowed() *DataCocsnRoutesRouteRouteDestinationInterfaceGetMethodNotAllowed { + + return &DataCocsnRoutesRouteRouteDestinationInterfaceGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataCocsnRoutesRouteRouteDestinationInterfaceGetConflictCode is the HTTP code returned for type DataCocsnRoutesRouteRouteDestinationInterfaceGetConflict +const DataCocsnRoutesRouteRouteDestinationInterfaceGetConflictCode int = 409 + +/*DataCocsnRoutesRouteRouteDestinationInterfaceGetConflict Conflict + +swagger:response dataCocsnRoutesRouteRouteDestinationInterfaceGetConflict +*/ +type DataCocsnRoutesRouteRouteDestinationInterfaceGetConflict struct { +} + +// NewDataCocsnRoutesRouteRouteDestinationInterfaceGetConflict creates DataCocsnRoutesRouteRouteDestinationInterfaceGetConflict with default headers values +func NewDataCocsnRoutesRouteRouteDestinationInterfaceGetConflict() *DataCocsnRoutesRouteRouteDestinationInterfaceGetConflict { + + return &DataCocsnRoutesRouteRouteDestinationInterfaceGetConflict{} +} + +// WriteResponse to the client +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_cocsn_routes_route_route_destination_interface_get_urlbuilder.go b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_interface_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..88f368218191a0db30807e6c008fd431c2069fdc --- /dev/null +++ b/api/restapi/operations/data/data_cocsn_routes_route_route_destination_interface_get_urlbuilder.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DataCocsnRoutesRouteRouteDestinationInterfaceGetURL generates an URL for the data cocsn routes route route destination interface get operation +type DataCocsnRoutesRouteRouteDestinationInterfaceGetURL struct { + RouteDestination string + + Content *string + Depth *uint16 + Fields *string + Filter *string + WithDefaults *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetURL) WithBasePath(bp string) *DataCocsnRoutesRouteRouteDestinationInterfaceGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/cocsn:routes/route={route-destination}/interface" + + routeDestination := o.RouteDestination + if routeDestination != "" { + _path = strings.Replace(_path, "{route-destination}", routeDestination, -1) + } else { + return nil, errors.New("routeDestination is required on DataCocsnRoutesRouteRouteDestinationInterfaceGetURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var contentQ string + if o.Content != nil { + contentQ = *o.Content + } + if contentQ != "" { + qs.Set("content", contentQ) + } + + var depthQ string + if o.Depth != nil { + depthQ = swag.FormatUint16(*o.Depth) + } + if depthQ != "" { + qs.Set("depth", depthQ) + } + + var fieldsQ string + if o.Fields != nil { + fieldsQ = *o.Fields + } + if fieldsQ != "" { + qs.Set("fields", fieldsQ) + } + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var withDefaultsQ string + if o.WithDefaults != nil { + withDefaultsQ = *o.WithDefaults + } + if withDefaultsQ != "" { + qs.Set("with-defaults", withDefaultsQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataCocsnRoutesRouteRouteDestinationInterfaceGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataCocsnRoutesRouteRouteDestinationInterfaceGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataCocsnRoutesRouteRouteDestinationInterfaceGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_get.go b/api/restapi/operations/data/data_get.go new file mode 100644 index 0000000000000000000000000000000000000000..284cf651974d4aa4c39e21b57d6fa2cf8428e1a0 --- /dev/null +++ b/api/restapi/operations/data/data_get.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataGetHandlerFunc turns a function with the right signature into a data get handler +type DataGetHandlerFunc func(DataGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataGetHandlerFunc) Handle(params DataGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataGetHandler interface for that can handle valid data get params +type DataGetHandler interface { + Handle(DataGetParams, interface{}) middleware.Responder +} + +// NewDataGet creates a new http.Handler for the data get operation +func NewDataGet(ctx *middleware.Context, handler DataGetHandler) *DataGet { + return &DataGet{Context: ctx, Handler: handler} +} + +/*DataGet swagger:route GET /data data get dataGet + +This YANG module represents the CoCSN API + +This YANG module represents the CoCSN API + +*/ +type DataGet struct { + Context *middleware.Context + Handler DataGetHandler +} + +func (o *DataGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_get_parameters.go b/api/restapi/operations/data/data_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..62c7b267793077d333adbbea3d30c6c5efeb9500 --- /dev/null +++ b/api/restapi/operations/data/data_get_parameters.go @@ -0,0 +1,45 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewDataGetParams creates a new DataGetParams object +// no default values defined in spec. +func NewDataGetParams() DataGetParams { + + return DataGetParams{} +} + +// DataGetParams contains all the bound params for the data get operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_get +type DataGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataGetParams() beforehand. +func (o *DataGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/data/data_get_responses.go b/api/restapi/operations/data/data_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..6a2671991c0f871a9b757e061e4643de7b14cb9d --- /dev/null +++ b/api/restapi/operations/data/data_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// DataGetOKCode is the HTTP code returned for type DataGetOK +const DataGetOKCode int = 200 + +/*DataGetOK This YANG module represents the CoCSN API + +swagger:response dataGetOK +*/ +type DataGetOK struct { + + /* + In: Body + */ + Payload *models.Data `json:"body,omitempty"` +} + +// NewDataGetOK creates DataGetOK with default headers values +func NewDataGetOK() *DataGetOK { + + return &DataGetOK{} +} + +// WithPayload adds the payload to the data get o k response +func (o *DataGetOK) WithPayload(payload *models.Data) *DataGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the data get o k response +func (o *DataGetOK) SetPayload(payload *models.Data) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DataGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DataGetNoContentCode is the HTTP code returned for type DataGetNoContent +const DataGetNoContentCode int = 204 + +/*DataGetNoContent No Content + +swagger:response dataGetNoContent +*/ +type DataGetNoContent struct { +} + +// NewDataGetNoContent creates DataGetNoContent with default headers values +func NewDataGetNoContent() *DataGetNoContent { + + return &DataGetNoContent{} +} + +// WriteResponse to the client +func (o *DataGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataGetBadRequestCode is the HTTP code returned for type DataGetBadRequest +const DataGetBadRequestCode int = 400 + +/*DataGetBadRequest Bad Request + +swagger:response dataGetBadRequest +*/ +type DataGetBadRequest struct { +} + +// NewDataGetBadRequest creates DataGetBadRequest with default headers values +func NewDataGetBadRequest() *DataGetBadRequest { + + return &DataGetBadRequest{} +} + +// WriteResponse to the client +func (o *DataGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataGetUnauthorizedCode is the HTTP code returned for type DataGetUnauthorized +const DataGetUnauthorizedCode int = 401 + +/*DataGetUnauthorized Unauthorized + +swagger:response dataGetUnauthorized +*/ +type DataGetUnauthorized struct { +} + +// NewDataGetUnauthorized creates DataGetUnauthorized with default headers values +func NewDataGetUnauthorized() *DataGetUnauthorized { + + return &DataGetUnauthorized{} +} + +// WriteResponse to the client +func (o *DataGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataGetNotFoundCode is the HTTP code returned for type DataGetNotFound +const DataGetNotFoundCode int = 404 + +/*DataGetNotFound Not Found + +swagger:response dataGetNotFound +*/ +type DataGetNotFound struct { +} + +// NewDataGetNotFound creates DataGetNotFound with default headers values +func NewDataGetNotFound() *DataGetNotFound { + + return &DataGetNotFound{} +} + +// WriteResponse to the client +func (o *DataGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataGetMethodNotAllowedCode is the HTTP code returned for type DataGetMethodNotAllowed +const DataGetMethodNotAllowedCode int = 405 + +/*DataGetMethodNotAllowed Method Not Allowed + +swagger:response dataGetMethodNotAllowed +*/ +type DataGetMethodNotAllowed struct { +} + +// NewDataGetMethodNotAllowed creates DataGetMethodNotAllowed with default headers values +func NewDataGetMethodNotAllowed() *DataGetMethodNotAllowed { + + return &DataGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataGetConflictCode is the HTTP code returned for type DataGetConflict +const DataGetConflictCode int = 409 + +/*DataGetConflict Conflict + +swagger:response dataGetConflict +*/ +type DataGetConflict struct { +} + +// NewDataGetConflict creates DataGetConflict with default headers values +func NewDataGetConflict() *DataGetConflict { + + return &DataGetConflict{} +} + +// WriteResponse to the client +func (o *DataGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_get_urlbuilder.go b/api/restapi/operations/data/data_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..8113739eb0bb958232f8f08d51088140128ed86d --- /dev/null +++ b/api/restapi/operations/data/data_get_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// DataGetURL generates an URL for the data get operation +type DataGetURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataGetURL) WithBasePath(bp string) *DataGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_patch.go b/api/restapi/operations/data/data_patch.go new file mode 100644 index 0000000000000000000000000000000000000000..db50497a761b206f5898e5f10591e5f89232f3e9 --- /dev/null +++ b/api/restapi/operations/data/data_patch.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataPatchHandlerFunc turns a function with the right signature into a data patch handler +type DataPatchHandlerFunc func(DataPatchParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataPatchHandlerFunc) Handle(params DataPatchParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataPatchHandler interface for that can handle valid data patch params +type DataPatchHandler interface { + Handle(DataPatchParams, interface{}) middleware.Responder +} + +// NewDataPatch creates a new http.Handler for the data patch operation +func NewDataPatch(ctx *middleware.Context, handler DataPatchHandler) *DataPatch { + return &DataPatch{Context: ctx, Handler: handler} +} + +/*DataPatch swagger:route PATCH /data data patch dataPatch + +This YANG module represents the CoCSN API + +This YANG module represents the CoCSN API + +*/ +type DataPatch struct { + Context *middleware.Context + Handler DataPatchHandler +} + +func (o *DataPatch) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataPatchParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_patch_parameters.go b/api/restapi/operations/data/data_patch_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..ecd021ad546873a171dd3a89569b309a346d3075 --- /dev/null +++ b/api/restapi/operations/data/data_patch_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// NewDataPatchParams creates a new DataPatchParams object +// no default values defined in spec. +func NewDataPatchParams() DataPatchParams { + + return DataPatchParams{} +} + +// DataPatchParams contains all the bound params for the data patch operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_patch +type DataPatchParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*This YANG module represents the CoCSN API + Required: true + In: body + */ + Data *models.DataPutPatch +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataPatchParams() beforehand. +func (o *DataPatchParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.DataPutPatch + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("data", "body", "")) + } else { + res = append(res, errors.NewParseError("data", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Data = &body + } + } + } else { + res = append(res, errors.Required("data", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/data/data_patch_responses.go b/api/restapi/operations/data/data_patch_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..9465fe42ff9032f0ea8a9e256990a3c299d8cb76 --- /dev/null +++ b/api/restapi/operations/data/data_patch_responses.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DataPatchNoContentCode is the HTTP code returned for type DataPatchNoContent +const DataPatchNoContentCode int = 204 + +/*DataPatchNoContent This YANG module represents the CoCSN API + +swagger:response dataPatchNoContent +*/ +type DataPatchNoContent struct { +} + +// NewDataPatchNoContent creates DataPatchNoContent with default headers values +func NewDataPatchNoContent() *DataPatchNoContent { + + return &DataPatchNoContent{} +} + +// WriteResponse to the client +func (o *DataPatchNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DataPatchBadRequestCode is the HTTP code returned for type DataPatchBadRequest +const DataPatchBadRequestCode int = 400 + +/*DataPatchBadRequest Bad Request + +swagger:response dataPatchBadRequest +*/ +type DataPatchBadRequest struct { +} + +// NewDataPatchBadRequest creates DataPatchBadRequest with default headers values +func NewDataPatchBadRequest() *DataPatchBadRequest { + + return &DataPatchBadRequest{} +} + +// WriteResponse to the client +func (o *DataPatchBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataPatchUnauthorizedCode is the HTTP code returned for type DataPatchUnauthorized +const DataPatchUnauthorizedCode int = 401 + +/*DataPatchUnauthorized Unauthorized + +swagger:response dataPatchUnauthorized +*/ +type DataPatchUnauthorized struct { +} + +// NewDataPatchUnauthorized creates DataPatchUnauthorized with default headers values +func NewDataPatchUnauthorized() *DataPatchUnauthorized { + + return &DataPatchUnauthorized{} +} + +// WriteResponse to the client +func (o *DataPatchUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataPatchNotFoundCode is the HTTP code returned for type DataPatchNotFound +const DataPatchNotFoundCode int = 404 + +/*DataPatchNotFound Not Found + +swagger:response dataPatchNotFound +*/ +type DataPatchNotFound struct { +} + +// NewDataPatchNotFound creates DataPatchNotFound with default headers values +func NewDataPatchNotFound() *DataPatchNotFound { + + return &DataPatchNotFound{} +} + +// WriteResponse to the client +func (o *DataPatchNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataPatchMethodNotAllowedCode is the HTTP code returned for type DataPatchMethodNotAllowed +const DataPatchMethodNotAllowedCode int = 405 + +/*DataPatchMethodNotAllowed Method Not Allowed + +swagger:response dataPatchMethodNotAllowed +*/ +type DataPatchMethodNotAllowed struct { +} + +// NewDataPatchMethodNotAllowed creates DataPatchMethodNotAllowed with default headers values +func NewDataPatchMethodNotAllowed() *DataPatchMethodNotAllowed { + + return &DataPatchMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataPatchMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataPatchConflictCode is the HTTP code returned for type DataPatchConflict +const DataPatchConflictCode int = 409 + +/*DataPatchConflict Conflict + +swagger:response dataPatchConflict +*/ +type DataPatchConflict struct { +} + +// NewDataPatchConflict creates DataPatchConflict with default headers values +func NewDataPatchConflict() *DataPatchConflict { + + return &DataPatchConflict{} +} + +// WriteResponse to the client +func (o *DataPatchConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_patch_urlbuilder.go b/api/restapi/operations/data/data_patch_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..f2bad9776f4d2caab8220bea72d64fada5c06342 --- /dev/null +++ b/api/restapi/operations/data/data_patch_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// DataPatchURL generates an URL for the data patch operation +type DataPatchURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataPatchURL) WithBasePath(bp string) *DataPatchURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataPatchURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataPatchURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataPatchURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataPatchURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataPatchURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataPatchURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataPatchURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataPatchURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_post.go b/api/restapi/operations/data/data_post.go new file mode 100644 index 0000000000000000000000000000000000000000..3f01e573d97f19b2daaa82c1959352a2096f3b58 --- /dev/null +++ b/api/restapi/operations/data/data_post.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataPostHandlerFunc turns a function with the right signature into a data post handler +type DataPostHandlerFunc func(DataPostParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataPostHandlerFunc) Handle(params DataPostParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataPostHandler interface for that can handle valid data post params +type DataPostHandler interface { + Handle(DataPostParams, interface{}) middleware.Responder +} + +// NewDataPost creates a new http.Handler for the data post operation +func NewDataPost(ctx *middleware.Context, handler DataPostHandler) *DataPost { + return &DataPost{Context: ctx, Handler: handler} +} + +/*DataPost swagger:route POST /data data post dataPost + +This YANG module represents the CoCSN API + +This YANG module represents the CoCSN API + +*/ +type DataPost struct { + Context *middleware.Context + Handler DataPostHandler +} + +func (o *DataPost) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataPostParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_post_parameters.go b/api/restapi/operations/data/data_post_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b6702a14d6b10cb7bd243bab75927566958009c9 --- /dev/null +++ b/api/restapi/operations/data/data_post_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// NewDataPostParams creates a new DataPostParams object +// no default values defined in spec. +func NewDataPostParams() DataPostParams { + + return DataPostParams{} +} + +// DataPostParams contains all the bound params for the data post operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_post +type DataPostParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*This YANG module represents the CoCSN API + Required: true + In: body + */ + Data *models.DataPost +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataPostParams() beforehand. +func (o *DataPostParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.DataPost + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("data", "body", "")) + } else { + res = append(res, errors.NewParseError("data", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Data = &body + } + } + } else { + res = append(res, errors.Required("data", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/data/data_post_responses.go b/api/restapi/operations/data/data_post_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..929236e0f49b5f10916b89fe5efef9fb4efb9004 --- /dev/null +++ b/api/restapi/operations/data/data_post_responses.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DataPostCreatedCode is the HTTP code returned for type DataPostCreated +const DataPostCreatedCode int = 201 + +/*DataPostCreated This YANG module represents the CoCSN API + +swagger:response dataPostCreated +*/ +type DataPostCreated struct { +} + +// NewDataPostCreated creates DataPostCreated with default headers values +func NewDataPostCreated() *DataPostCreated { + + return &DataPostCreated{} +} + +// WriteResponse to the client +func (o *DataPostCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// DataPostBadRequestCode is the HTTP code returned for type DataPostBadRequest +const DataPostBadRequestCode int = 400 + +/*DataPostBadRequest Bad Request + +swagger:response dataPostBadRequest +*/ +type DataPostBadRequest struct { +} + +// NewDataPostBadRequest creates DataPostBadRequest with default headers values +func NewDataPostBadRequest() *DataPostBadRequest { + + return &DataPostBadRequest{} +} + +// WriteResponse to the client +func (o *DataPostBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataPostUnauthorizedCode is the HTTP code returned for type DataPostUnauthorized +const DataPostUnauthorizedCode int = 401 + +/*DataPostUnauthorized Unauthorized + +swagger:response dataPostUnauthorized +*/ +type DataPostUnauthorized struct { +} + +// NewDataPostUnauthorized creates DataPostUnauthorized with default headers values +func NewDataPostUnauthorized() *DataPostUnauthorized { + + return &DataPostUnauthorized{} +} + +// WriteResponse to the client +func (o *DataPostUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataPostNotFoundCode is the HTTP code returned for type DataPostNotFound +const DataPostNotFoundCode int = 404 + +/*DataPostNotFound Not Found + +swagger:response dataPostNotFound +*/ +type DataPostNotFound struct { +} + +// NewDataPostNotFound creates DataPostNotFound with default headers values +func NewDataPostNotFound() *DataPostNotFound { + + return &DataPostNotFound{} +} + +// WriteResponse to the client +func (o *DataPostNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataPostMethodNotAllowedCode is the HTTP code returned for type DataPostMethodNotAllowed +const DataPostMethodNotAllowedCode int = 405 + +/*DataPostMethodNotAllowed Method Not Allowed + +swagger:response dataPostMethodNotAllowed +*/ +type DataPostMethodNotAllowed struct { +} + +// NewDataPostMethodNotAllowed creates DataPostMethodNotAllowed with default headers values +func NewDataPostMethodNotAllowed() *DataPostMethodNotAllowed { + + return &DataPostMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataPostMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataPostConflictCode is the HTTP code returned for type DataPostConflict +const DataPostConflictCode int = 409 + +/*DataPostConflict Conflict + +swagger:response dataPostConflict +*/ +type DataPostConflict struct { +} + +// NewDataPostConflict creates DataPostConflict with default headers values +func NewDataPostConflict() *DataPostConflict { + + return &DataPostConflict{} +} + +// WriteResponse to the client +func (o *DataPostConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_post_urlbuilder.go b/api/restapi/operations/data/data_post_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..304a1046f9be2c243bf733e5e010deaa91781312 --- /dev/null +++ b/api/restapi/operations/data/data_post_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// DataPostURL generates an URL for the data post operation +type DataPostURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataPostURL) WithBasePath(bp string) *DataPostURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataPostURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataPostURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataPostURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataPostURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataPostURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataPostURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataPostURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataPostURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/data/data_put.go b/api/restapi/operations/data/data_put.go new file mode 100644 index 0000000000000000000000000000000000000000..c921bc76cf0518f33c78b64505c0ff54423ad72a --- /dev/null +++ b/api/restapi/operations/data/data_put.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DataPutHandlerFunc turns a function with the right signature into a data put handler +type DataPutHandlerFunc func(DataPutParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn DataPutHandlerFunc) Handle(params DataPutParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// DataPutHandler interface for that can handle valid data put params +type DataPutHandler interface { + Handle(DataPutParams, interface{}) middleware.Responder +} + +// NewDataPut creates a new http.Handler for the data put operation +func NewDataPut(ctx *middleware.Context, handler DataPutHandler) *DataPut { + return &DataPut{Context: ctx, Handler: handler} +} + +/*DataPut swagger:route PUT /data data put dataPut + +This YANG module represents the CoCSN API + +This YANG module represents the CoCSN API + +*/ +type DataPut struct { + Context *middleware.Context + Handler DataPutHandler +} + +func (o *DataPut) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDataPutParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/data/data_put_parameters.go b/api/restapi/operations/data/data_put_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..80e343f8df01e92a2be0f7be21341b8fb88c0bbf --- /dev/null +++ b/api/restapi/operations/data/data_put_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// NewDataPutParams creates a new DataPutParams object +// no default values defined in spec. +func NewDataPutParams() DataPutParams { + + return DataPutParams{} +} + +// DataPutParams contains all the bound params for the data put operation +// typically these are obtained from a http.Request +// +// swagger:parameters data_put +type DataPutParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*This YANG module represents the CoCSN API + Required: true + In: body + */ + Data *models.DataPutPatch +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDataPutParams() beforehand. +func (o *DataPutParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.DataPutPatch + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("data", "body", "")) + } else { + res = append(res, errors.NewParseError("data", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Data = &body + } + } + } else { + res = append(res, errors.Required("data", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/data/data_put_responses.go b/api/restapi/operations/data/data_put_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..2bdaf3ec842563217fad240afd48478a9b2130ae --- /dev/null +++ b/api/restapi/operations/data/data_put_responses.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DataPutCreatedCode is the HTTP code returned for type DataPutCreated +const DataPutCreatedCode int = 201 + +/*DataPutCreated This YANG module represents the CoCSN API + +swagger:response dataPutCreated +*/ +type DataPutCreated struct { +} + +// NewDataPutCreated creates DataPutCreated with default headers values +func NewDataPutCreated() *DataPutCreated { + + return &DataPutCreated{} +} + +// WriteResponse to the client +func (o *DataPutCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// DataPutBadRequestCode is the HTTP code returned for type DataPutBadRequest +const DataPutBadRequestCode int = 400 + +/*DataPutBadRequest Bad Request + +swagger:response dataPutBadRequest +*/ +type DataPutBadRequest struct { +} + +// NewDataPutBadRequest creates DataPutBadRequest with default headers values +func NewDataPutBadRequest() *DataPutBadRequest { + + return &DataPutBadRequest{} +} + +// WriteResponse to the client +func (o *DataPutBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// DataPutUnauthorizedCode is the HTTP code returned for type DataPutUnauthorized +const DataPutUnauthorizedCode int = 401 + +/*DataPutUnauthorized Unauthorized + +swagger:response dataPutUnauthorized +*/ +type DataPutUnauthorized struct { +} + +// NewDataPutUnauthorized creates DataPutUnauthorized with default headers values +func NewDataPutUnauthorized() *DataPutUnauthorized { + + return &DataPutUnauthorized{} +} + +// WriteResponse to the client +func (o *DataPutUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// DataPutNotFoundCode is the HTTP code returned for type DataPutNotFound +const DataPutNotFoundCode int = 404 + +/*DataPutNotFound Not Found + +swagger:response dataPutNotFound +*/ +type DataPutNotFound struct { +} + +// NewDataPutNotFound creates DataPutNotFound with default headers values +func NewDataPutNotFound() *DataPutNotFound { + + return &DataPutNotFound{} +} + +// WriteResponse to the client +func (o *DataPutNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DataPutMethodNotAllowedCode is the HTTP code returned for type DataPutMethodNotAllowed +const DataPutMethodNotAllowedCode int = 405 + +/*DataPutMethodNotAllowed Method Not Allowed + +swagger:response dataPutMethodNotAllowed +*/ +type DataPutMethodNotAllowed struct { +} + +// NewDataPutMethodNotAllowed creates DataPutMethodNotAllowed with default headers values +func NewDataPutMethodNotAllowed() *DataPutMethodNotAllowed { + + return &DataPutMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *DataPutMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// DataPutConflictCode is the HTTP code returned for type DataPutConflict +const DataPutConflictCode int = 409 + +/*DataPutConflict Conflict + +swagger:response dataPutConflict +*/ +type DataPutConflict struct { +} + +// NewDataPutConflict creates DataPutConflict with default headers values +func NewDataPutConflict() *DataPutConflict { + + return &DataPutConflict{} +} + +// WriteResponse to the client +func (o *DataPutConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/data/data_put_urlbuilder.go b/api/restapi/operations/data/data_put_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..b19efecfeecacc40f0aa88416680ef9477931c2d --- /dev/null +++ b/api/restapi/operations/data/data_put_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package data + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// DataPutURL generates an URL for the data put operation +type DataPutURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataPutURL) WithBasePath(bp string) *DataPutURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DataPutURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DataPutURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DataPutURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DataPutURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DataPutURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DataPutURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DataPutURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DataPutURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/operationsops/operations_get.go b/api/restapi/operations/operationsops/operations_get.go new file mode 100644 index 0000000000000000000000000000000000000000..b5dbfdbb88079f746b5504e90b5cc01d2edd5302 --- /dev/null +++ b/api/restapi/operations/operationsops/operations_get.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operationsops + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// OperationsGetHandlerFunc turns a function with the right signature into a operations get handler +type OperationsGetHandlerFunc func(OperationsGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn OperationsGetHandlerFunc) Handle(params OperationsGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// OperationsGetHandler interface for that can handle valid operations get params +type OperationsGetHandler interface { + Handle(OperationsGetParams, interface{}) middleware.Responder +} + +// NewOperationsGet creates a new http.Handler for the operations get operation +func NewOperationsGet(ctx *middleware.Context, handler OperationsGetHandler) *OperationsGet { + return &OperationsGet{Context: ctx, Handler: handler} +} + +/*OperationsGet swagger:route GET /operations operations get operationsGet + +This YANG module represents the CoCSN API + +This YANG module represents the CoCSN API + +*/ +type OperationsGet struct { + Context *middleware.Context + Handler OperationsGetHandler +} + +func (o *OperationsGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewOperationsGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/operationsops/operations_get_parameters.go b/api/restapi/operations/operationsops/operations_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0aabf23e178dbbc4cab6cefb47c81ec3347585c4 --- /dev/null +++ b/api/restapi/operations/operationsops/operations_get_parameters.go @@ -0,0 +1,45 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operationsops + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewOperationsGetParams creates a new OperationsGetParams object +// no default values defined in spec. +func NewOperationsGetParams() OperationsGetParams { + + return OperationsGetParams{} +} + +// OperationsGetParams contains all the bound params for the operations get operation +// typically these are obtained from a http.Request +// +// swagger:parameters operations_get +type OperationsGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewOperationsGetParams() beforehand. +func (o *OperationsGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/operationsops/operations_get_responses.go b/api/restapi/operations/operationsops/operations_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..0930ed755f2e9f1d377dac0add73d241cc4754fa --- /dev/null +++ b/api/restapi/operations/operationsops/operations_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operationsops + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// OperationsGetOKCode is the HTTP code returned for type OperationsGetOK +const OperationsGetOKCode int = 200 + +/*OperationsGetOK This YANG module represents the CoCSN API + +swagger:response operationsGetOK +*/ +type OperationsGetOK struct { + + /* + In: Body + */ + Payload *models.Operations `json:"body,omitempty"` +} + +// NewOperationsGetOK creates OperationsGetOK with default headers values +func NewOperationsGetOK() *OperationsGetOK { + + return &OperationsGetOK{} +} + +// WithPayload adds the payload to the operations get o k response +func (o *OperationsGetOK) WithPayload(payload *models.Operations) *OperationsGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the operations get o k response +func (o *OperationsGetOK) SetPayload(payload *models.Operations) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *OperationsGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// OperationsGetNoContentCode is the HTTP code returned for type OperationsGetNoContent +const OperationsGetNoContentCode int = 204 + +/*OperationsGetNoContent No Content + +swagger:response operationsGetNoContent +*/ +type OperationsGetNoContent struct { +} + +// NewOperationsGetNoContent creates OperationsGetNoContent with default headers values +func NewOperationsGetNoContent() *OperationsGetNoContent { + + return &OperationsGetNoContent{} +} + +// WriteResponse to the client +func (o *OperationsGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// OperationsGetBadRequestCode is the HTTP code returned for type OperationsGetBadRequest +const OperationsGetBadRequestCode int = 400 + +/*OperationsGetBadRequest Bad Request + +swagger:response operationsGetBadRequest +*/ +type OperationsGetBadRequest struct { +} + +// NewOperationsGetBadRequest creates OperationsGetBadRequest with default headers values +func NewOperationsGetBadRequest() *OperationsGetBadRequest { + + return &OperationsGetBadRequest{} +} + +// WriteResponse to the client +func (o *OperationsGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// OperationsGetUnauthorizedCode is the HTTP code returned for type OperationsGetUnauthorized +const OperationsGetUnauthorizedCode int = 401 + +/*OperationsGetUnauthorized Unauthorized + +swagger:response operationsGetUnauthorized +*/ +type OperationsGetUnauthorized struct { +} + +// NewOperationsGetUnauthorized creates OperationsGetUnauthorized with default headers values +func NewOperationsGetUnauthorized() *OperationsGetUnauthorized { + + return &OperationsGetUnauthorized{} +} + +// WriteResponse to the client +func (o *OperationsGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// OperationsGetNotFoundCode is the HTTP code returned for type OperationsGetNotFound +const OperationsGetNotFoundCode int = 404 + +/*OperationsGetNotFound Not Found + +swagger:response operationsGetNotFound +*/ +type OperationsGetNotFound struct { +} + +// NewOperationsGetNotFound creates OperationsGetNotFound with default headers values +func NewOperationsGetNotFound() *OperationsGetNotFound { + + return &OperationsGetNotFound{} +} + +// WriteResponse to the client +func (o *OperationsGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// OperationsGetMethodNotAllowedCode is the HTTP code returned for type OperationsGetMethodNotAllowed +const OperationsGetMethodNotAllowedCode int = 405 + +/*OperationsGetMethodNotAllowed Method Not Allowed + +swagger:response operationsGetMethodNotAllowed +*/ +type OperationsGetMethodNotAllowed struct { +} + +// NewOperationsGetMethodNotAllowed creates OperationsGetMethodNotAllowed with default headers values +func NewOperationsGetMethodNotAllowed() *OperationsGetMethodNotAllowed { + + return &OperationsGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *OperationsGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// OperationsGetConflictCode is the HTTP code returned for type OperationsGetConflict +const OperationsGetConflictCode int = 409 + +/*OperationsGetConflict Conflict + +swagger:response operationsGetConflict +*/ +type OperationsGetConflict struct { +} + +// NewOperationsGetConflict creates OperationsGetConflict with default headers values +func NewOperationsGetConflict() *OperationsGetConflict { + + return &OperationsGetConflict{} +} + +// WriteResponse to the client +func (o *OperationsGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/operationsops/operations_get_urlbuilder.go b/api/restapi/operations/operationsops/operations_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..f441a3fcf2cf19f8a7a383038112eb69ed2c539c --- /dev/null +++ b/api/restapi/operations/operationsops/operations_get_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operationsops + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// OperationsGetURL generates an URL for the operations get operation +type OperationsGetURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *OperationsGetURL) WithBasePath(bp string) *OperationsGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *OperationsGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *OperationsGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/operations" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *OperationsGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *OperationsGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *OperationsGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on OperationsGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on OperationsGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *OperationsGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/root/root_get.go b/api/restapi/operations/root/root_get.go new file mode 100644 index 0000000000000000000000000000000000000000..72d54c74330b76c182fac3fd67b5ff94d24bdfc5 --- /dev/null +++ b/api/restapi/operations/root/root_get.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package root + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// RootGetHandlerFunc turns a function with the right signature into a root get handler +type RootGetHandlerFunc func(RootGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn RootGetHandlerFunc) Handle(params RootGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// RootGetHandler interface for that can handle valid root get params +type RootGetHandler interface { + Handle(RootGetParams, interface{}) middleware.Responder +} + +// NewRootGet creates a new http.Handler for the root get operation +func NewRootGet(ctx *middleware.Context, handler RootGetHandler) *RootGet { + return &RootGet{Context: ctx, Handler: handler} +} + +/*RootGet swagger:route GET / root get rootGet + +This YANG module represents the CoCSN API + +This YANG module represents the CoCSN API + +*/ +type RootGet struct { + Context *middleware.Context + Handler RootGetHandler +} + +func (o *RootGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewRootGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/root/root_get_parameters.go b/api/restapi/operations/root/root_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a75ecda486e4b63d132c1732bd8f94d6ed3f033c --- /dev/null +++ b/api/restapi/operations/root/root_get_parameters.go @@ -0,0 +1,45 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package root + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewRootGetParams creates a new RootGetParams object +// no default values defined in spec. +func NewRootGetParams() RootGetParams { + + return RootGetParams{} +} + +// RootGetParams contains all the bound params for the root get operation +// typically these are obtained from a http.Request +// +// swagger:parameters root_get +type RootGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewRootGetParams() beforehand. +func (o *RootGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/root/root_get_responses.go b/api/restapi/operations/root/root_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..2137331672ade18c4dc9198e2495a7cf17a14761 --- /dev/null +++ b/api/restapi/operations/root/root_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package root + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// RootGetOKCode is the HTTP code returned for type RootGetOK +const RootGetOKCode int = 200 + +/*RootGetOK This YANG module represents the CoCSN API + +swagger:response rootGetOK +*/ +type RootGetOK struct { + + /* + In: Body + */ + Payload *models.Root `json:"body,omitempty"` +} + +// NewRootGetOK creates RootGetOK with default headers values +func NewRootGetOK() *RootGetOK { + + return &RootGetOK{} +} + +// WithPayload adds the payload to the root get o k response +func (o *RootGetOK) WithPayload(payload *models.Root) *RootGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the root get o k response +func (o *RootGetOK) SetPayload(payload *models.Root) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RootGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RootGetNoContentCode is the HTTP code returned for type RootGetNoContent +const RootGetNoContentCode int = 204 + +/*RootGetNoContent No Content + +swagger:response rootGetNoContent +*/ +type RootGetNoContent struct { +} + +// NewRootGetNoContent creates RootGetNoContent with default headers values +func NewRootGetNoContent() *RootGetNoContent { + + return &RootGetNoContent{} +} + +// WriteResponse to the client +func (o *RootGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// RootGetBadRequestCode is the HTTP code returned for type RootGetBadRequest +const RootGetBadRequestCode int = 400 + +/*RootGetBadRequest Bad Request + +swagger:response rootGetBadRequest +*/ +type RootGetBadRequest struct { +} + +// NewRootGetBadRequest creates RootGetBadRequest with default headers values +func NewRootGetBadRequest() *RootGetBadRequest { + + return &RootGetBadRequest{} +} + +// WriteResponse to the client +func (o *RootGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// RootGetUnauthorizedCode is the HTTP code returned for type RootGetUnauthorized +const RootGetUnauthorizedCode int = 401 + +/*RootGetUnauthorized Unauthorized + +swagger:response rootGetUnauthorized +*/ +type RootGetUnauthorized struct { +} + +// NewRootGetUnauthorized creates RootGetUnauthorized with default headers values +func NewRootGetUnauthorized() *RootGetUnauthorized { + + return &RootGetUnauthorized{} +} + +// WriteResponse to the client +func (o *RootGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// RootGetNotFoundCode is the HTTP code returned for type RootGetNotFound +const RootGetNotFoundCode int = 404 + +/*RootGetNotFound Not Found + +swagger:response rootGetNotFound +*/ +type RootGetNotFound struct { +} + +// NewRootGetNotFound creates RootGetNotFound with default headers values +func NewRootGetNotFound() *RootGetNotFound { + + return &RootGetNotFound{} +} + +// WriteResponse to the client +func (o *RootGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// RootGetMethodNotAllowedCode is the HTTP code returned for type RootGetMethodNotAllowed +const RootGetMethodNotAllowedCode int = 405 + +/*RootGetMethodNotAllowed Method Not Allowed + +swagger:response rootGetMethodNotAllowed +*/ +type RootGetMethodNotAllowed struct { +} + +// NewRootGetMethodNotAllowed creates RootGetMethodNotAllowed with default headers values +func NewRootGetMethodNotAllowed() *RootGetMethodNotAllowed { + + return &RootGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *RootGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// RootGetConflictCode is the HTTP code returned for type RootGetConflict +const RootGetConflictCode int = 409 + +/*RootGetConflict Conflict + +swagger:response rootGetConflict +*/ +type RootGetConflict struct { +} + +// NewRootGetConflict creates RootGetConflict with default headers values +func NewRootGetConflict() *RootGetConflict { + + return &RootGetConflict{} +} + +// WriteResponse to the client +func (o *RootGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/root/root_get_urlbuilder.go b/api/restapi/operations/root/root_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..c749a9fec618fb3d7848309513a14ff486444982 --- /dev/null +++ b/api/restapi/operations/root/root_get_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package root + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// RootGetURL generates an URL for the root get operation +type RootGetURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *RootGetURL) WithBasePath(bp string) *RootGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *RootGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *RootGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *RootGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *RootGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *RootGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on RootGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on RootGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *RootGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/operations/yang_library_version/yang_library_version_get.go b/api/restapi/operations/yang_library_version/yang_library_version_get.go new file mode 100644 index 0000000000000000000000000000000000000000..c2e9b8058f43de510c3ff9adc34fa8de3bbb64da --- /dev/null +++ b/api/restapi/operations/yang_library_version/yang_library_version_get.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package yang_library_version + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// YangLibraryVersionGetHandlerFunc turns a function with the right signature into a yang library version get handler +type YangLibraryVersionGetHandlerFunc func(YangLibraryVersionGetParams, interface{}) middleware.Responder + +// Handle executing the request and returning a response +func (fn YangLibraryVersionGetHandlerFunc) Handle(params YangLibraryVersionGetParams, principal interface{}) middleware.Responder { + return fn(params, principal) +} + +// YangLibraryVersionGetHandler interface for that can handle valid yang library version get params +type YangLibraryVersionGetHandler interface { + Handle(YangLibraryVersionGetParams, interface{}) middleware.Responder +} + +// NewYangLibraryVersionGet creates a new http.Handler for the yang library version get operation +func NewYangLibraryVersionGet(ctx *middleware.Context, handler YangLibraryVersionGetHandler) *YangLibraryVersionGet { + return &YangLibraryVersionGet{Context: ctx, Handler: handler} +} + +/*YangLibraryVersionGet swagger:route GET /yang-library-version yang-library-version get yangLibraryVersionGet + +This YANG module represents the CoCSN API + +This YANG module represents the CoCSN API + +*/ +type YangLibraryVersionGet struct { + Context *middleware.Context + Handler YangLibraryVersionGetHandler +} + +func (o *YangLibraryVersionGet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewYangLibraryVersionGetParams() + + uprinc, aCtx, err := o.Context.Authorize(r, route) + if err != nil { + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + if aCtx != nil { + r = aCtx + } + var principal interface{} + if uprinc != nil { + principal = uprinc + } + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params, principal) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/api/restapi/operations/yang_library_version/yang_library_version_get_parameters.go b/api/restapi/operations/yang_library_version/yang_library_version_get_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..34ebb4e75fdeeefbdec122ac2203297c64f04b20 --- /dev/null +++ b/api/restapi/operations/yang_library_version/yang_library_version_get_parameters.go @@ -0,0 +1,45 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package yang_library_version + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewYangLibraryVersionGetParams creates a new YangLibraryVersionGetParams object +// no default values defined in spec. +func NewYangLibraryVersionGetParams() YangLibraryVersionGetParams { + + return YangLibraryVersionGetParams{} +} + +// YangLibraryVersionGetParams contains all the bound params for the yang library version get operation +// typically these are obtained from a http.Request +// +// swagger:parameters yang_library_version_get +type YangLibraryVersionGetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewYangLibraryVersionGetParams() beforehand. +func (o *YangLibraryVersionGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/restapi/operations/yang_library_version/yang_library_version_get_responses.go b/api/restapi/operations/yang_library_version/yang_library_version_get_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..763d8210bff48aea7fcced88bbbcff94f683ec8b --- /dev/null +++ b/api/restapi/operations/yang_library_version/yang_library_version_get_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package yang_library_version + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/models" +) + +// YangLibraryVersionGetOKCode is the HTTP code returned for type YangLibraryVersionGetOK +const YangLibraryVersionGetOKCode int = 200 + +/*YangLibraryVersionGetOK This YANG module represents the CoCSN API + +swagger:response yangLibraryVersionGetOK +*/ +type YangLibraryVersionGetOK struct { + + /* + In: Body + */ + Payload *models.YangLibraryVersion `json:"body,omitempty"` +} + +// NewYangLibraryVersionGetOK creates YangLibraryVersionGetOK with default headers values +func NewYangLibraryVersionGetOK() *YangLibraryVersionGetOK { + + return &YangLibraryVersionGetOK{} +} + +// WithPayload adds the payload to the yang library version get o k response +func (o *YangLibraryVersionGetOK) WithPayload(payload *models.YangLibraryVersion) *YangLibraryVersionGetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the yang library version get o k response +func (o *YangLibraryVersionGetOK) SetPayload(payload *models.YangLibraryVersion) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *YangLibraryVersionGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// YangLibraryVersionGetNoContentCode is the HTTP code returned for type YangLibraryVersionGetNoContent +const YangLibraryVersionGetNoContentCode int = 204 + +/*YangLibraryVersionGetNoContent No Content + +swagger:response yangLibraryVersionGetNoContent +*/ +type YangLibraryVersionGetNoContent struct { +} + +// NewYangLibraryVersionGetNoContent creates YangLibraryVersionGetNoContent with default headers values +func NewYangLibraryVersionGetNoContent() *YangLibraryVersionGetNoContent { + + return &YangLibraryVersionGetNoContent{} +} + +// WriteResponse to the client +func (o *YangLibraryVersionGetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// YangLibraryVersionGetBadRequestCode is the HTTP code returned for type YangLibraryVersionGetBadRequest +const YangLibraryVersionGetBadRequestCode int = 400 + +/*YangLibraryVersionGetBadRequest Bad Request + +swagger:response yangLibraryVersionGetBadRequest +*/ +type YangLibraryVersionGetBadRequest struct { +} + +// NewYangLibraryVersionGetBadRequest creates YangLibraryVersionGetBadRequest with default headers values +func NewYangLibraryVersionGetBadRequest() *YangLibraryVersionGetBadRequest { + + return &YangLibraryVersionGetBadRequest{} +} + +// WriteResponse to the client +func (o *YangLibraryVersionGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// YangLibraryVersionGetUnauthorizedCode is the HTTP code returned for type YangLibraryVersionGetUnauthorized +const YangLibraryVersionGetUnauthorizedCode int = 401 + +/*YangLibraryVersionGetUnauthorized Unauthorized + +swagger:response yangLibraryVersionGetUnauthorized +*/ +type YangLibraryVersionGetUnauthorized struct { +} + +// NewYangLibraryVersionGetUnauthorized creates YangLibraryVersionGetUnauthorized with default headers values +func NewYangLibraryVersionGetUnauthorized() *YangLibraryVersionGetUnauthorized { + + return &YangLibraryVersionGetUnauthorized{} +} + +// WriteResponse to the client +func (o *YangLibraryVersionGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// YangLibraryVersionGetNotFoundCode is the HTTP code returned for type YangLibraryVersionGetNotFound +const YangLibraryVersionGetNotFoundCode int = 404 + +/*YangLibraryVersionGetNotFound Not Found + +swagger:response yangLibraryVersionGetNotFound +*/ +type YangLibraryVersionGetNotFound struct { +} + +// NewYangLibraryVersionGetNotFound creates YangLibraryVersionGetNotFound with default headers values +func NewYangLibraryVersionGetNotFound() *YangLibraryVersionGetNotFound { + + return &YangLibraryVersionGetNotFound{} +} + +// WriteResponse to the client +func (o *YangLibraryVersionGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// YangLibraryVersionGetMethodNotAllowedCode is the HTTP code returned for type YangLibraryVersionGetMethodNotAllowed +const YangLibraryVersionGetMethodNotAllowedCode int = 405 + +/*YangLibraryVersionGetMethodNotAllowed Method Not Allowed + +swagger:response yangLibraryVersionGetMethodNotAllowed +*/ +type YangLibraryVersionGetMethodNotAllowed struct { +} + +// NewYangLibraryVersionGetMethodNotAllowed creates YangLibraryVersionGetMethodNotAllowed with default headers values +func NewYangLibraryVersionGetMethodNotAllowed() *YangLibraryVersionGetMethodNotAllowed { + + return &YangLibraryVersionGetMethodNotAllowed{} +} + +// WriteResponse to the client +func (o *YangLibraryVersionGetMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(405) +} + +// YangLibraryVersionGetConflictCode is the HTTP code returned for type YangLibraryVersionGetConflict +const YangLibraryVersionGetConflictCode int = 409 + +/*YangLibraryVersionGetConflict Conflict + +swagger:response yangLibraryVersionGetConflict +*/ +type YangLibraryVersionGetConflict struct { +} + +// NewYangLibraryVersionGetConflict creates YangLibraryVersionGetConflict with default headers values +func NewYangLibraryVersionGetConflict() *YangLibraryVersionGetConflict { + + return &YangLibraryVersionGetConflict{} +} + +// WriteResponse to the client +func (o *YangLibraryVersionGetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/api/restapi/operations/yang_library_version/yang_library_version_get_urlbuilder.go b/api/restapi/operations/yang_library_version/yang_library_version_get_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..24d14bde075e9f2bbeb13f69623963d628ab69c4 --- /dev/null +++ b/api/restapi/operations/yang_library_version/yang_library_version_get_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package yang_library_version + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// YangLibraryVersionGetURL generates an URL for the yang library version get operation +type YangLibraryVersionGetURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *YangLibraryVersionGetURL) WithBasePath(bp string) *YangLibraryVersionGetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *YangLibraryVersionGetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *YangLibraryVersionGetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/yang-library-version" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/restconf" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *YangLibraryVersionGetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *YangLibraryVersionGetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *YangLibraryVersionGetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on YangLibraryVersionGetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on YangLibraryVersionGetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *YangLibraryVersionGetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/api/restapi/server.go b/api/restapi/server.go new file mode 100644 index 0000000000000000000000000000000000000000..fd9da92b0e486cab2240e18d60627d95ac2e8a98 --- /dev/null +++ b/api/restapi/server.go @@ -0,0 +1,512 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package restapi + +import ( + "context" + "crypto/tls" + "crypto/x509" + "errors" + "fmt" + "io/ioutil" + "log" + "net" + "net/http" + "os" + "os/signal" + "strconv" + "sync" + "sync/atomic" + "syscall" + "time" + + "github.com/go-openapi/runtime/flagext" + "github.com/go-openapi/swag" + flags "github.com/jessevdk/go-flags" + "golang.org/x/net/netutil" + + "code.fbi.h-da.de/cocsn/cocsn-api/api/restapi/operations" +) + +const ( + schemeHTTP = "http" + schemeHTTPS = "https" + schemeUnix = "unix" +) + +var defaultSchemes []string + +func init() { + defaultSchemes = []string{ + schemeHTTP, + schemeHTTPS, + } +} + +// NewServer creates a new api cocsn server but does not configure it +func NewServer(api *operations.CocsnAPI) *Server { + s := new(Server) + + s.shutdown = make(chan struct{}) + s.api = api + s.interrupt = make(chan os.Signal, 1) + return s +} + +// ConfigureAPI configures the API and handlers. +func (s *Server) ConfigureAPI() { + if s.api != nil { + s.handler = configureAPI(s.api) + } +} + +// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse +func (s *Server) ConfigureFlags() { + if s.api != nil { + configureFlags(s.api) + } +} + +// Server for the cocsn API +type Server struct { + EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` + CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` + GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` + MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` + + SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/cocsn.sock"` + domainSocketL net.Listener + + Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` + Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` + ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` + KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` + ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` + WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` + httpServerL net.Listener + + TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` + TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` + TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` + TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` + TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` + TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` + TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` + TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` + TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` + httpsServerL net.Listener + + api *operations.CocsnAPI + handler http.Handler + hasListeners bool + shutdown chan struct{} + shuttingDown int32 + interrupted bool + interrupt chan os.Signal +} + +// Logf logs message either via defined user logger or via system one if no user logger is defined. +func (s *Server) Logf(f string, args ...interface{}) { + if s.api != nil && s.api.Logger != nil { + s.api.Logger(f, args...) + } else { + log.Printf(f, args...) + } +} + +// Fatalf logs message either via defined user logger or via system one if no user logger is defined. +// Exits with non-zero status after printing +func (s *Server) Fatalf(f string, args ...interface{}) { + if s.api != nil && s.api.Logger != nil { + s.api.Logger(f, args...) + os.Exit(1) + } else { + log.Fatalf(f, args...) + } +} + +// SetAPI configures the server with the specified API. Needs to be called before Serve +func (s *Server) SetAPI(api *operations.CocsnAPI) { + if api == nil { + s.api = nil + s.handler = nil + return + } + + s.api = api + s.handler = configureAPI(api) +} + +func (s *Server) hasScheme(scheme string) bool { + schemes := s.EnabledListeners + if len(schemes) == 0 { + schemes = defaultSchemes + } + + for _, v := range schemes { + if v == scheme { + return true + } + } + return false +} + +// Serve the api +func (s *Server) Serve() (err error) { + if !s.hasListeners { + if err = s.Listen(); err != nil { + return err + } + } + + // set default handler, if none is set + if s.handler == nil { + if s.api == nil { + return errors.New("can't create the default handler, as no api is set") + } + + s.SetHandler(s.api.Serve(nil)) + } + + wg := new(sync.WaitGroup) + once := new(sync.Once) + signalNotify(s.interrupt) + go handleInterrupt(once, s) + + servers := []*http.Server{} + + if s.hasScheme(schemeUnix) { + domainSocket := new(http.Server) + domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) + domainSocket.Handler = s.handler + if int64(s.CleanupTimeout) > 0 { + domainSocket.IdleTimeout = s.CleanupTimeout + } + + configureServer(domainSocket, "unix", string(s.SocketPath)) + + servers = append(servers, domainSocket) + wg.Add(1) + s.Logf("Serving cocsn at unix://%s", s.SocketPath) + go func(l net.Listener) { + defer wg.Done() + if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving cocsn at unix://%s", s.SocketPath) + }(s.domainSocketL) + } + + if s.hasScheme(schemeHTTP) { + httpServer := new(http.Server) + httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) + httpServer.ReadTimeout = s.ReadTimeout + httpServer.WriteTimeout = s.WriteTimeout + httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) + if s.ListenLimit > 0 { + s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) + } + + if int64(s.CleanupTimeout) > 0 { + httpServer.IdleTimeout = s.CleanupTimeout + } + + httpServer.Handler = s.handler + + configureServer(httpServer, "http", s.httpServerL.Addr().String()) + + servers = append(servers, httpServer) + wg.Add(1) + s.Logf("Serving cocsn at http://%s", s.httpServerL.Addr()) + go func(l net.Listener) { + defer wg.Done() + if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving cocsn at http://%s", l.Addr()) + }(s.httpServerL) + } + + if s.hasScheme(schemeHTTPS) { + httpsServer := new(http.Server) + httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) + httpsServer.ReadTimeout = s.TLSReadTimeout + httpsServer.WriteTimeout = s.TLSWriteTimeout + httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) + if s.TLSListenLimit > 0 { + s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) + } + if int64(s.CleanupTimeout) > 0 { + httpsServer.IdleTimeout = s.CleanupTimeout + } + httpsServer.Handler = s.handler + + // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go + httpsServer.TLSConfig = &tls.Config{ + // Causes servers to use Go's default ciphersuite preferences, + // which are tuned to avoid attacks. Does nothing on clients. + PreferServerCipherSuites: true, + // Only use curves which have assembly implementations + // https://github.com/golang/go/tree/master/src/crypto/elliptic + CurvePreferences: []tls.CurveID{tls.CurveP256}, + // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility + NextProtos: []string{"h2", "http/1.1"}, + // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols + MinVersion: tls.VersionTLS12, + // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy + CipherSuites: []uint16{ + tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, + tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, + }, + } + + // build standard config from server options + if s.TLSCertificate != "" && s.TLSCertificateKey != "" { + httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) + httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) + if err != nil { + return err + } + } + + if s.TLSCACertificate != "" { + // include specified CA certificate + caCert, caCertErr := ioutil.ReadFile(string(s.TLSCACertificate)) + if caCertErr != nil { + return caCertErr + } + caCertPool := x509.NewCertPool() + ok := caCertPool.AppendCertsFromPEM(caCert) + if !ok { + return fmt.Errorf("cannot parse CA certificate") + } + httpsServer.TLSConfig.ClientCAs = caCertPool + httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert + } + + // call custom TLS configurator + configureTLS(httpsServer.TLSConfig) + + if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { + // after standard and custom config are passed, this ends up with no certificate + if s.TLSCertificate == "" { + if s.TLSCertificateKey == "" { + s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") + } + s.Fatalf("the required flag `--tls-certificate` was not specified") + } + if s.TLSCertificateKey == "" { + s.Fatalf("the required flag `--tls-key` was not specified") + } + // this happens with a wrong custom TLS configurator + s.Fatalf("no certificate was configured for TLS") + } + + // must have at least one certificate or panics + httpsServer.TLSConfig.BuildNameToCertificate() + + configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) + + servers = append(servers, httpsServer) + wg.Add(1) + s.Logf("Serving cocsn at https://%s", s.httpsServerL.Addr()) + go func(l net.Listener) { + defer wg.Done() + if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving cocsn at https://%s", l.Addr()) + }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) + } + + wg.Add(1) + go s.handleShutdown(wg, &servers) + + wg.Wait() + return nil +} + +// Listen creates the listeners for the server +func (s *Server) Listen() error { + if s.hasListeners { // already done this + return nil + } + + if s.hasScheme(schemeHTTPS) { + // Use http host if https host wasn't defined + if s.TLSHost == "" { + s.TLSHost = s.Host + } + // Use http listen limit if https listen limit wasn't defined + if s.TLSListenLimit == 0 { + s.TLSListenLimit = s.ListenLimit + } + // Use http tcp keep alive if https tcp keep alive wasn't defined + if int64(s.TLSKeepAlive) == 0 { + s.TLSKeepAlive = s.KeepAlive + } + // Use http read timeout if https read timeout wasn't defined + if int64(s.TLSReadTimeout) == 0 { + s.TLSReadTimeout = s.ReadTimeout + } + // Use http write timeout if https write timeout wasn't defined + if int64(s.TLSWriteTimeout) == 0 { + s.TLSWriteTimeout = s.WriteTimeout + } + } + + if s.hasScheme(schemeUnix) { + domSockListener, err := net.Listen("unix", string(s.SocketPath)) + if err != nil { + return err + } + s.domainSocketL = domSockListener + } + + if s.hasScheme(schemeHTTP) { + listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) + if err != nil { + return err + } + + h, p, err := swag.SplitHostPort(listener.Addr().String()) + if err != nil { + return err + } + s.Host = h + s.Port = p + s.httpServerL = listener + } + + if s.hasScheme(schemeHTTPS) { + tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) + if err != nil { + return err + } + + sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) + if err != nil { + return err + } + s.TLSHost = sh + s.TLSPort = sp + s.httpsServerL = tlsListener + } + + s.hasListeners = true + return nil +} + +// Shutdown server and clean up resources +func (s *Server) Shutdown() error { + if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { + close(s.shutdown) + } + return nil +} + +func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { + // wg.Done must occur last, after s.api.ServerShutdown() + // (to preserve old behaviour) + defer wg.Done() + + <-s.shutdown + + servers := *serversPtr + + ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) + defer cancel() + + // first execute the pre-shutdown hook + s.api.PreServerShutdown() + + shutdownChan := make(chan bool) + for i := range servers { + server := servers[i] + go func() { + var success bool + defer func() { + shutdownChan <- success + }() + if err := server.Shutdown(ctx); err != nil { + // Error from closing listeners, or context timeout: + s.Logf("HTTP server Shutdown: %v", err) + } else { + success = true + } + }() + } + + // Wait until all listeners have successfully shut down before calling ServerShutdown + success := true + for range servers { + success = success && <-shutdownChan + } + if success { + s.api.ServerShutdown() + } +} + +// GetHandler returns a handler useful for testing +func (s *Server) GetHandler() http.Handler { + return s.handler +} + +// SetHandler allows for setting a http handler on this server +func (s *Server) SetHandler(handler http.Handler) { + s.handler = handler +} + +// UnixListener returns the domain socket listener +func (s *Server) UnixListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.domainSocketL, nil +} + +// HTTPListener returns the http listener +func (s *Server) HTTPListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.httpServerL, nil +} + +// TLSListener returns the https listener +func (s *Server) TLSListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.httpsServerL, nil +} + +func handleInterrupt(once *sync.Once, s *Server) { + once.Do(func() { + for range s.interrupt { + if s.interrupted { + s.Logf("Server already shutting down") + continue + } + s.interrupted = true + s.Logf("Shutting down... ") + if err := s.Shutdown(); err != nil { + s.Logf("HTTP server Shutdown: %v", err) + } + } + }) +} + +func signalNotify(interrupt chan<- os.Signal) { + signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) +} diff --git a/cocsn.json b/cocsn.json new file mode 100644 index 0000000000000000000000000000000000000000..7222ac03f9919e770d5602d3bf60839c207d2740 --- /dev/null +++ b/cocsn.json @@ -0,0 +1,3852 @@ +{ + "swagger": "2.0", + "info": { + "title": "cocsn", + "description": "This YANG module represents the CoCSN API", + "version": "2020-08-17" + }, + "basePath": "/restconf", + "tags": [ + { + "name": "root", + "description": "root resources" + }, + { + "name": "operations", + "description": "operations resources" + }, + { + "name": "data", + "description": "data resources" + }, + { + "name": "get", + "description": "get resources" + }, + { + "name": "post", + "description": "post resources" + }, + { + "name": "patch", + "description": "patch resources" + }, + { + "name": "put", + "description": "put resources" + }, + { + "name": "delete", + "description": "delete resources" + } + ], + "schemes": [ + "http", + "https" + ], + "produces": [ + "application/yang-data+json" + ], + "consumes": [ + "application/yang-data+json" + ], + "paths": { + "/": { + "get": { + "tags": [ + "root", + "get" + ], + "summary": "This YANG module represents the CoCSN API", + "description": "This YANG module represents the CoCSN API", + "operationId": "root_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + ], + "responses": { + "200": { + "description": "This YANG module represents the CoCSN API", + "schema": { + "$ref": "#/definitions/root" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/operations": { + "get": { + "tags": [ + "operations", + "get" + ], + "summary": "This YANG module represents the CoCSN API", + "description": "This YANG module represents the CoCSN API", + "operationId": "operations_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + ], + "responses": { + "200": { + "description": "This YANG module represents the CoCSN API", + "schema": { + "$ref": "#/definitions/operations" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/yang-library-version": { + "get": { + "tags": [ + "yang-library-version", + "get" + ], + "summary": "This YANG module represents the CoCSN API", + "description": "This YANG module represents the CoCSN API", + "operationId": "yang_library_version_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + ], + "responses": { + "200": { + "description": "This YANG module represents the CoCSN API", + "schema": { + "$ref": "#/definitions/yang-library-version" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "This YANG module represents the CoCSN API", + "description": "This YANG module represents the CoCSN API", + "operationId": "data_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + ], + "responses": { + "200": { + "description": "This YANG module represents the CoCSN API", + "schema": { + "$ref": "#/definitions/data" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "tags": [ + "data", + "post" + ], + "summary": "This YANG module represents the CoCSN API", + "description": "This YANG module represents the CoCSN API", + "operationId": "data_post", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data-post" + } + ], + "responses": { + "201": { + "description": "This YANG module represents the CoCSN API" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "This YANG module represents the CoCSN API", + "description": "This YANG module represents the CoCSN API", + "operationId": "data_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data-put-patch" + } + ], + "responses": { + "201": { + "description": "This YANG module represents the CoCSN API" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "This YANG module represents the CoCSN API", + "description": "This YANG module represents the CoCSN API", + "operationId": "data_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data-put-patch" + } + ], + "responses": { + "204": { + "description": "This YANG module represents the CoCSN API" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:interfaces": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_interfaces_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "tags": [ + "data", + "post" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_interfaces_post", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data_cocsn_interfaces-post" + } + ], + "responses": { + "201": { + "description": "container interfaces created" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_interfaces_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data_cocsn_interfaces" + } + ], + "responses": { + "201": { + "description": "container interfaces created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_interfaces_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data_cocsn_interfaces" + } + ], + "responses": { + "204": { + "description": "container interfaces updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_interfaces_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:interfaces/interface": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_interfaces_interface_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:interfaces/interface={interface-name}": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_interfaces_interface_interface_name_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:interfaces/interface={interface-name}/name": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Interface name. Example value: en0", + "description": "Interface name. Example value: en0", + "operationId": "data_cocsn_interfaces_interface_interface_name_name_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Interface name. Example value: en0", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name_name" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:interfaces/interface={interface-name}/addresses": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Interface IP address. Example value: 10.10.10.1", + "description": "Interface IP address. Example value: 10.10.10.1", + "operationId": "data_cocsn_interfaces_interface_interface_name_addresses_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Interface IP address. Example value: 10.10.10.1", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name_addresses" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:interfaces/interface={interface-name}/addresses={addresses-id}": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Interface IP address. Example value: 10.10.10.1", + "description": "Interface IP address. Example value: 10.10.10.1", + "operationId": "data_cocsn_interfaces_interface_interface_name_addresses_addresses_id_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/interface-name" + }, + { + "$ref": "#/parameters/addresses-id" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Interface IP address. Example value: 10.10.10.1", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name_addresses_addresses-id" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:interfaces/interface={interface-name}/phys-address": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present.", + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present.", + "operationId": "data_cocsn_interfaces_interface_interface_name_phys_address_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present.", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name_phys-address" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:interfaces/interface={interface-name}/enabled": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Enable or disable the interface. Example value: true", + "description": "Enable or disable the interface. Example value: true", + "operationId": "data_cocsn_interfaces_interface_interface_name_enabled_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Enable or disable the interface. Example value: true", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name_enabled" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:interfaces/interface={interface-name}/oper-status": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Describes whether the interface is physically up or down", + "description": "Describes whether the interface is physically up or down", + "operationId": "data_cocsn_interfaces_interface_interface_name_oper_status_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Describes whether the interface is physically up or down", + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces_interface_interface-name_oper-status" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:routes": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_routes_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_routes" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "tags": [ + "data", + "post" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_routes_post", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data_cocsn_routes-post" + } + ], + "responses": { + "201": { + "description": "container routes created" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_routes_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data_cocsn_routes" + } + ], + "responses": { + "201": { + "description": "container routes created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_routes_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data_cocsn_routes" + } + ], + "responses": { + "204": { + "description": "container routes updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_routes_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:routes/route": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_routes_route_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:routes/route={route-destination}": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_routes_route_route_destination_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/route-destination" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route_route-destination" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:routes/route={route-destination}/destination": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Route destination. IP network", + "description": "Route destination. IP network", + "operationId": "data_cocsn_routes_route_route_destination_destination_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/route-destination" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Route destination. IP network", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route_route-destination_destination" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:routes/route={route-destination}/gateway": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Route gateway. IP address or host name", + "description": "Route gateway. IP address or host name", + "operationId": "data_cocsn_routes_route_route_destination_gateway_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/route-destination" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Route gateway. IP address or host name", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route_route-destination_gateway" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:routes/route={route-destination}/flags": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Flags of the route", + "description": "Flags of the route", + "operationId": "data_cocsn_routes_route_route_destination_flags_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/route-destination" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Flags of the route", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route_route-destination_flags" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:routes/route={route-destination}/interface": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Interface used for the route", + "description": "Interface used for the route", + "operationId": "data_cocsn_routes_route_route_destination_interface_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/route-destination" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Interface used for the route", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route_route-destination_interface" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:routes/route={route-destination}/expire": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Expiration timer of the route", + "description": "Expiration timer of the route", + "operationId": "data_cocsn_routes_route_route_destination_expire_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/route-destination" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Expiration timer of the route", + "schema": { + "$ref": "#/definitions/data_cocsn_routes_route_route-destination_expire" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:arp-table": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_arp_table_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "tags": [ + "data", + "post" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_arp_table_post", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data_cocsn_arp-table-post" + } + ], + "responses": { + "201": { + "description": "container arp-table created" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_arp_table_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data_cocsn_arp-table" + } + ], + "responses": { + "201": { + "description": "container arp-table created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_arp_table_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data_cocsn_arp-table" + } + ], + "responses": { + "204": { + "description": "container arp-table updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_arp_table_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:arp-table/arp-entry": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_arp_table_arp_entry_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table_arp-entry" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:arp-table/arp-entry={arp-entry-address}": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "", + "description": "", + "operationId": "data_cocsn_arp_table_arp_entry_arp_entry_address_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/arp-entry-address" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table_arp-entry_arp-entry-address" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:arp-table/arp-entry={arp-entry-address}/address": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "IP address of the arp entry", + "description": "IP address of the arp entry", + "operationId": "data_cocsn_arp_table_arp_entry_arp_entry_address_address_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/arp-entry-address" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "IP address of the arp entry", + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table_arp-entry_arp-entry-address_address" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:arp-table/arp-entry={arp-entry-address}/phs-address": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "MAC address of the arp entry", + "description": "MAC address of the arp entry", + "operationId": "data_cocsn_arp_table_arp_entry_arp_entry_address_phs_address_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/arp-entry-address" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "MAC address of the arp entry", + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table_arp-entry_arp-entry-address_phs-address" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/cocsn:arp-table/arp-entry={arp-entry-address}/interface": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Interface of the arp entry", + "description": "Interface of the arp entry", + "operationId": "data_cocsn_arp_table_arp_entry_arp_entry_address_interface_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/arp-entry-address" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Interface of the arp entry", + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table_arp-entry_arp-entry-address_interface" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + } + }, + "parameters": { + "content": { + "name": "content", + "in": "query", + "description": "controlling descendant nodes in response", + "required": false, + "type": "string", + "format": "enumeration", + "default": "config", + "enum": [ + "config", + "nonconfig", + "all" + ] + }, + "depth": { + "name": "depth", + "in": "query", + "description": "limit the depth of nodes in response", + "required": false, + "type": "integer", + "format": "uint16" + }, + "fields": { + "name": "fields", + "in": "query", + "description": "optionally identify specific data nodes in response", + "required": false, + "type": "string", + "format": "string" + }, + "filter": { + "name": "filter", + "in": "query", + "description": "xpath expression to filter data nodes in response", + "required": false, + "type": "string", + "format": "string" + }, + "with-defaults": { + "name": "with-defaults", + "in": "query", + "description": "controlling default values in response", + "required": false, + "type": "string", + "format": "enumeration", + "default": "report-all", + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ] + }, + "insert": { + "name": "insert", + "in": "query", + "description": "controlling the order when adding new list elements", + "required": false, + "type": "string", + "format": "enumeration", + "default": "first", + "enum": [ + "first", + "last", + "before", + "after" + ] + }, + "point": { + "name": "point", + "in": "query", + "description": "used to specify the insertion point", + "required": false, + "type": "string", + "format": "string" + }, + "route-destination": { + "name": "route-destination", + "in": "path", + "description": "Route destination. IP network", + "required": true, + "type": "string", + "format": "string" + }, + "interface-name": { + "name": "interface-name", + "in": "path", + "description": "Interface name. Example value: en0", + "required": true, + "type": "string", + "format": "string" + }, + "data_cocsn_routes-post": { + "name": "routes", + "in": "body", + "description": "", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_routes-post" + } + }, + "data_cocsn_routes": { + "name": "routes", + "in": "body", + "description": "", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_routes" + } + }, + "data_cocsn_interfaces-post": { + "name": "interfaces", + "in": "body", + "description": "", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces-post" + } + }, + "data_cocsn_interfaces": { + "name": "interfaces", + "in": "body", + "description": "", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_interfaces" + } + }, + "data_cocsn_arp-table-post": { + "name": "arp-table", + "in": "body", + "description": "", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table-post" + } + }, + "data_cocsn_arp-table": { + "name": "arp-table", + "in": "body", + "description": "", + "required": true, + "schema": { + "$ref": "#/definitions/data_cocsn_arp-table" + } + }, + "data-put-patch": { + "name": "data", + "in": "body", + "description": "This YANG module represents the CoCSN API", + "required": true, + "schema": { + "$ref": "#/definitions/data-put-patch" + } + }, + "data-post": { + "name": "data", + "in": "body", + "description": "This YANG module represents the CoCSN API", + "required": true, + "schema": { + "$ref": "#/definitions/data-post" + } + }, + "arp-entry-address": { + "name": "arp-entry-address", + "in": "path", + "description": "IP address of the arp entry", + "required": true, + "type": "string", + "format": "string" + }, + "addresses-id": { + "name": "addresses-id", + "in": "path", + "description": "Interface IP address. Example value: 10.10.10.1", + "required": true, + "type": "string", + "format": "string" + } + }, + "responses": { + "200": { + "description": "OK" + }, + "201": { + "description": "Created" + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + }, + "securityDefinitions": { + "basicAuth": { + "type": "basic" + } + }, + "definitions": { + "yang-library-version": { + "type": "object", + "properties": { + "ietf-restconf:yang-library-version": { + "type": "object", + "description": "This leaf identifies the revision date of the 'ietf-yang-library' YANG module that is implemented by this server. See RESTCONF RFC 8040 for further information.", + "x-yang": { + "type": "leaf" + }, + "properties": { + } + } + } + }, + "root": { + "type": "object", + "properties": { + "ietf-restconf:restconf": { + "type": "object", + "x-yang": { + "type": "root" + }, + "description": "This is the RESTCONF root resource for the RESTCONF datastore and operation resources. See RESTCONF RFC 8040 for further information.", + "properties": { + "data": { + "type": "object", + "properties": { + } + }, + "operations": { + "type": "object", + "properties": { + } + }, + "yang-library-version": { + "type": "string" + } + } + } + } + }, + "operations": { + "type": "object", + "properties": { + "ietf-restconf:operations": { + "type": "object", + "x-yang": { + "type": "operations" + }, + "description": "This resource is a container that provides access to the data-model-specific RPC operations supported by the server. See RESTCONF RFC 8040 for further information.", + "properties": { + + } + } + } + }, + "data_cocsn_routes_route_route-destination_interface": { + "type": "object", + "properties": { + "cocsn:interface": { + "description": "Interface used for the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_cocsn_routes_route_route-destination_gateway": { + "type": "object", + "properties": { + "cocsn:gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_cocsn_routes_route_route-destination_flags": { + "type": "object", + "properties": { + "cocsn:flags": { + "description": "Flags of the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_cocsn_routes_route_route-destination_expire": { + "type": "object", + "properties": { + "cocsn:expire": { + "description": "Expiration timer of the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_cocsn_routes_route_route-destination_destination": { + "type": "object", + "properties": { + "cocsn:destination": { + "description": "Route destination. IP network (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_cocsn_routes_route_route-destination": { + "type": "object", + "properties": { + "cocsn:route": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "destination": { + "description": "Route destination. IP network (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "expire": { + "description": "Expiration timer of the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "flags": { + "description": "Flags of the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "interface": { + "description": "Interface used for the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + }, + "data_cocsn_routes_route": { + "type": "object", + "properties": { + "cocsn:route": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "destination": { + "description": "Route destination. IP network (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "expire": { + "description": "Expiration timer of the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "flags": { + "description": "Flags of the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "interface": { + "description": "Interface used for the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + }, + "data_cocsn_routes-post": { + "type": "object", + "properties": { + "cocsn:route": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "destination": { + "description": "Route destination. IP network (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "expire": { + "description": "Expiration timer of the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "flags": { + "description": "Flags of the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "interface": { + "description": "Interface used for the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + }, + "data_cocsn_routes": { + "type": "object", + "properties": { + "cocsn:routes": { + "description": "(non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "route": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "destination": { + "description": "Route destination. IP network (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "expire": { + "description": "Expiration timer of the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "flags": { + "description": "Flags of the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "interface": { + "description": "Interface used for the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + } + } + }, + "data_cocsn_interfaces_interface_interface-name_phys-address": { + "type": "object", + "properties": { + "cocsn:phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_cocsn_interfaces_interface_interface-name_oper-status": { + "type": "object", + "properties": { + "cocsn:oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ] + } + } + }, + "data_cocsn_interfaces_interface_interface-name_name": { + "type": "object", + "properties": { + "cocsn:name": { + "description": "Interface name. Example value: en0 (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_cocsn_interfaces_interface_interface-name_enabled": { + "type": "object", + "properties": { + "cocsn:enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + } + } + }, + "data_cocsn_interfaces_interface_interface-name_addresses_addresses-id": { + "type": "object", + "properties": { + "cocsn:addresses": { + "type": "array", + "x-yang": { + "type": "leaf-list" + }, + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + } + } + } + }, + "data_cocsn_interfaces_interface_interface-name_addresses": { + "type": "object", + "properties": { + "cocsn:addresses": { + "type": "array", + "x-yang": { + "type": "leaf-list" + }, + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + } + } + } + }, + "data_cocsn_interfaces_interface_interface-name": { + "type": "object", + "properties": { + "cocsn:interface": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "x-yang": { + "type": "leaf-list" + }, + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + } + }, + "enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ] + }, + "phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + }, + "data_cocsn_interfaces_interface": { + "type": "object", + "properties": { + "cocsn:interface": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "x-yang": { + "type": "leaf-list" + }, + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + } + }, + "enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ] + }, + "phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + }, + "data_cocsn_interfaces-post": { + "type": "object", + "properties": { + "cocsn:interface": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "x-yang": { + "type": "leaf-list" + }, + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + } + }, + "enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ] + }, + "phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + }, + "data_cocsn_interfaces": { + "type": "object", + "properties": { + "cocsn:interfaces": { + "description": "(non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "interface": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "x-yang": { + "type": "leaf-list" + }, + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + } + }, + "enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ] + }, + "phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + } + } + }, + "data_cocsn_arp-table_arp-entry_arp-entry-address_phs-address": { + "type": "object", + "properties": { + "cocsn:phs-address": { + "description": "MAC address of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_cocsn_arp-table_arp-entry_arp-entry-address_interface": { + "type": "object", + "properties": { + "cocsn:interface": { + "description": "Interface of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_cocsn_arp-table_arp-entry_arp-entry-address_address": { + "type": "object", + "properties": { + "cocsn:address": { + "description": "IP address of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_cocsn_arp-table_arp-entry_arp-entry-address": { + "type": "object", + "properties": { + "cocsn:arp-entry": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "address": { + "description": "IP address of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "interface": { + "description": "Interface of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "phs-address": { + "description": "MAC address of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + }, + "data_cocsn_arp-table_arp-entry": { + "type": "object", + "properties": { + "cocsn:arp-entry": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "address": { + "description": "IP address of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "interface": { + "description": "Interface of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "phs-address": { + "description": "MAC address of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + }, + "data_cocsn_arp-table-post": { + "type": "object", + "properties": { + "cocsn:arp-entry": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "address": { + "description": "IP address of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "interface": { + "description": "Interface of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "phs-address": { + "description": "MAC address of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + }, + "data_cocsn_arp-table": { + "type": "object", + "properties": { + "cocsn:arp-table": { + "description": "(non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "arp-entry": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "address": { + "description": "IP address of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "interface": { + "description": "Interface of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "phs-address": { + "description": "MAC address of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + } + } + }, + "data-put-patch": { + "type": "object", + "properties": { + "ietf-restconf:data": { + "description": "This YANG module represents the CoCSN API", + "type": "object", + "x-yang": { + "type": "datastore" + }, + "properties": { + "cocsn:interfaces": { + "description": "(non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "interface": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "x-yang": { + "type": "leaf-list" + }, + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + } + }, + "enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ] + }, + "phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + }, + "cocsn:routes": { + "description": "(non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "route": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "destination": { + "description": "Route destination. IP network (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "expire": { + "description": "Expiration timer of the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "flags": { + "description": "Flags of the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "interface": { + "description": "Interface used for the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + }, + "cocsn:arp-table": { + "description": "(non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "arp-entry": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "address": { + "description": "IP address of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "interface": { + "description": "Interface of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "phs-address": { + "description": "MAC address of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + } + } + } + } + }, + "data-post": { + "type": "object", + "properties": { + "cocsn:interfaces": { + "description": "(non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "interface": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "x-yang": { + "type": "leaf-list" + }, + "items": { + "description": "Interface IP address. Example value: 10.10.10.1 (leaf-list)", + "type": "string", + "format": "string" + } + }, + "enabled": { + "description": "Enable or disable the interface. Example value: true (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-status": { + "description": "Describes whether the interface is physically up or down (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "up", + "enum": [ + "up", + "down" + ] + }, + "phys-address": { + "description": "The interface's address at its protocol sub-layer. For\nexample, for an 802.x interface, this object normally\ncontains a Media Access Control (MAC) address. The\ninterface's media-specific modules must define the bit\nand byte ordering and the format of the value of this\nobject. For interfaces that do not have such an address\n(e.g., a serial line), this node is not present. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + }, + "cocsn:routes": { + "description": "(non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "route": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "destination": { + "description": "Route destination. IP network (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "expire": { + "description": "Expiration timer of the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "flags": { + "description": "Flags of the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "gateway": { + "description": "Route gateway. IP address or host name (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "interface": { + "description": "Interface used for the route (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + }, + "cocsn:arp-table": { + "description": "(non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "arp-entry": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "address": { + "description": "IP address of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "interface": { + "description": "Interface of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "phs-address": { + "description": "MAC address of the arp entry (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + } + } + }, + "data": { + "type": "object", + "properties": { + "ietf-restconf:data": { + "type": "object", + "description": "This resource represents the combined configuration and state data resources that can be accessed by a client and cannot be created or deleted by the client. See RESTCONF RFC 8040 for further information.", + "x-yang": { + "type": "datastore" + }, + "properties": { + } + } + } + } + } +} diff --git a/debug.json b/debug.json new file mode 100644 index 0000000000000000000000000000000000000000..13efd8b6e01e8f3aa205674c2bdf7ac9bdec1a3e --- /dev/null +++ b/debug.json @@ -0,0 +1,1206 @@ +{ + "swagger": "2.0", + "info": { + "title": "debug", + "description": "example", + "version": "2020-08-17" + }, + "basePath": "/restconf", + "tags": [ + { + "name": "root", + "description": "root resources" + }, + { + "name": "operations", + "description": "operations resources" + }, + { + "name": "data", + "description": "data resources" + }, + { + "name": "get", + "description": "get resources" + }, + { + "name": "post", + "description": "post resources" + }, + { + "name": "patch", + "description": "patch resources" + }, + { + "name": "put", + "description": "put resources" + }, + { + "name": "delete", + "description": "delete resources" + } + ], + "schemes": [ + "http", + "https" + ], + "produces": [ + "application/yang-data+json" + ], + "consumes": [ + "application/yang-data+json" + ], + "paths": { + "/": { + "get": { + "tags": [ + "root", + "get" + ], + "summary": "example", + "description": "example", + "operationId": "root_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + ], + "responses": { + "200": { + "description": "example", + "schema": { + "$ref": "#/definitions/root" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/operations": { + "get": { + "tags": [ + "operations", + "get" + ], + "summary": "example", + "description": "example", + "operationId": "operations_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + ], + "responses": { + "200": { + "description": "example", + "schema": { + "$ref": "#/definitions/operations" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/yang-library-version": { + "get": { + "tags": [ + "yang-library-version", + "get" + ], + "summary": "example", + "description": "example", + "operationId": "yang_library_version_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + ], + "responses": { + "200": { + "description": "example", + "schema": { + "$ref": "#/definitions/yang-library-version" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "example", + "description": "example", + "operationId": "data_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + ], + "responses": { + "200": { + "description": "example", + "schema": { + "$ref": "#/definitions/data" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "tags": [ + "data", + "post" + ], + "summary": "example", + "description": "example", + "operationId": "data_post", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data-post" + } + ], + "responses": { + "201": { + "description": "example" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "example", + "description": "example", + "operationId": "data_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data-put-patch" + } + ], + "responses": { + "201": { + "description": "example" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "example", + "description": "example", + "operationId": "data_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data-put-patch" + } + ], + "responses": { + "204": { + "description": "example" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/debug:interfaces": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "", + "description": "", + "operationId": "data_debug_interfaces_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_debug_interfaces" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "tags": [ + "data", + "post" + ], + "summary": "", + "description": "", + "operationId": "data_debug_interfaces_post", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data_debug_interfaces-post" + } + ], + "responses": { + "201": { + "description": "container interfaces created" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "", + "description": "", + "operationId": "data_debug_interfaces_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data_debug_interfaces" + } + ], + "responses": { + "201": { + "description": "container interfaces created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "", + "description": "", + "operationId": "data_debug_interfaces_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data_debug_interfaces" + } + ], + "responses": { + "204": { + "description": "container interfaces updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "", + "description": "", + "operationId": "data_debug_interfaces_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/debug:interfaces/interface": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "", + "description": "", + "operationId": "data_debug_interfaces_interface_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_debug_interfaces_interface" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/debug:interfaces/interface={interface-name}": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "", + "description": "", + "operationId": "data_debug_interfaces_interface_interface_name_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/data_debug_interfaces_interface_interface-name" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/debug:interfaces/interface={interface-name}/name": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Interface name. Example value: en0", + "description": "Interface name. Example value: en0", + "operationId": "data_debug_interfaces_interface_interface_name_name_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Interface name. Example value: en0", + "schema": { + "$ref": "#/definitions/data_debug_interfaces_interface_interface-name_name" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + } + }, + "parameters": { + "content": { + "name": "content", + "in": "query", + "description": "controlling descendant nodes in response", + "required": false, + "type": "string", + "format": "enumeration", + "default": "config", + "enum": [ + "config", + "nonconfig", + "all" + ] + }, + "depth": { + "name": "depth", + "in": "query", + "description": "limit the depth of nodes in response", + "required": false, + "type": "integer", + "format": "uint16" + }, + "fields": { + "name": "fields", + "in": "query", + "description": "optionally identify specific data nodes in response", + "required": false, + "type": "string", + "format": "string" + }, + "filter": { + "name": "filter", + "in": "query", + "description": "xpath expression to filter data nodes in response", + "required": false, + "type": "string", + "format": "string" + }, + "with-defaults": { + "name": "with-defaults", + "in": "query", + "description": "controlling default values in response", + "required": false, + "type": "string", + "format": "enumeration", + "default": "report-all", + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ] + }, + "insert": { + "name": "insert", + "in": "query", + "description": "controlling the order when adding new list elements", + "required": false, + "type": "string", + "format": "enumeration", + "default": "first", + "enum": [ + "first", + "last", + "before", + "after" + ] + }, + "point": { + "name": "point", + "in": "query", + "description": "used to specify the insertion point", + "required": false, + "type": "string", + "format": "string" + }, + "interface-name": { + "name": "interface-name", + "in": "path", + "description": "Interface name. Example value: en0", + "required": true, + "type": "string", + "format": "string" + }, + "data_debug_interfaces-post": { + "name": "interfaces", + "in": "body", + "description": "", + "required": true, + "schema": { + "$ref": "#/definitions/data_debug_interfaces-post" + } + }, + "data_debug_interfaces": { + "name": "interfaces", + "in": "body", + "description": "", + "required": true, + "schema": { + "$ref": "#/definitions/data_debug_interfaces" + } + }, + "data-put-patch": { + "name": "data", + "in": "body", + "description": "example", + "required": true, + "schema": { + "$ref": "#/definitions/data-put-patch" + } + }, + "data-post": { + "name": "data", + "in": "body", + "description": "example", + "required": true, + "schema": { + "$ref": "#/definitions/data-post" + } + } + }, + "responses": { + "200": { + "description": "OK" + }, + "201": { + "description": "Created" + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + }, + "securityDefinitions": { + "basicAuth": { + "type": "basic" + } + }, + "definitions": { + "yang-library-version": { + "type": "object", + "properties": { + "ietf-restconf:yang-library-version": { + "type": "object", + "description": "This leaf identifies the revision date of the 'ietf-yang-library' YANG module that is implemented by this server. See RESTCONF RFC 8040 for further information.", + "x-yang": { + "type": "leaf" + }, + "properties": { + } + } + } + }, + "root": { + "type": "object", + "properties": { + "ietf-restconf:restconf": { + "type": "object", + "x-yang": { + "type": "root" + }, + "description": "This is the RESTCONF root resource for the RESTCONF datastore and operation resources. See RESTCONF RFC 8040 for further information.", + "properties": { + "data": { + "type": "object", + "properties": { + } + }, + "operations": { + "type": "object", + "properties": { + } + }, + "yang-library-version": { + "type": "string" + } + } + } + } + }, + "operations": { + "type": "object", + "properties": { + "ietf-restconf:operations": { + "type": "object", + "x-yang": { + "type": "operations" + }, + "description": "This resource is a container that provides access to the data-model-specific RPC operations supported by the server. See RESTCONF RFC 8040 for further information.", + "properties": { + + } + } + } + }, + "data_debug_interfaces_interface_interface-name_name": { + "type": "object", + "properties": { + "debug:name": { + "description": "Interface name. Example value: en0 (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_debug_interfaces_interface_interface-name": { + "type": "object", + "properties": { + "debug:interface": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + }, + "data_debug_interfaces_interface": { + "type": "object", + "properties": { + "debug:interface": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + }, + "data_debug_interfaces-post": { + "type": "object", + "properties": { + "debug:interface": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + }, + "data_debug_interfaces": { + "type": "object", + "properties": { + "debug:interfaces": { + "description": "(non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "interface": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + } + } + }, + "data-put-patch": { + "type": "object", + "properties": { + "ietf-restconf:data": { + "description": "example", + "type": "object", + "x-yang": { + "type": "datastore" + }, + "properties": { + "debug:interfaces": { + "description": "(non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "interface": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + } + } + } + } + }, + "data-post": { + "type": "object", + "properties": { + "debug:interfaces": { + "description": "(non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "interface": { + "type": "array", + "description": "(list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "name": { + "description": "Interface name. Example value: en0 (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + } + } + }, + "data": { + "type": "object", + "properties": { + "ietf-restconf:data": { + "type": "object", + "description": "This resource represents the combined configuration and state data resources that can be accessed by a client and cannot be created or deleted by the client. See RESTCONF RFC 8040 for further information.", + "x-yang": { + "type": "datastore" + }, + "properties": { + } + } + } + } + } +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000000000000000000000000000000000000..0cf3294b74713555f042328560f8f2c30ce4742e --- /dev/null +++ b/go.mod @@ -0,0 +1,15 @@ +module code.fbi.h-da.de/cocsn/cocsn-api + +go 1.14 + +require ( + github.com/go-openapi/errors v0.19.6 + github.com/go-openapi/loads v0.19.5 + github.com/go-openapi/runtime v0.19.21 + github.com/go-openapi/spec v0.19.9 + github.com/go-openapi/strfmt v0.19.5 + github.com/go-openapi/swag v0.19.9 + github.com/go-openapi/validate v0.19.10 + github.com/jessevdk/go-flags v1.4.0 + golang.org/x/net v0.0.0-20200822124328-c89045814202 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000000000000000000000000000000000000..13329e87f4e58389eddbbbe7204ba37624e44859 --- /dev/null +++ b/go.sum @@ -0,0 +1,238 @@ +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY= +github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= +github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= +github.com/go-openapi/analysis v0.19.4/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= +github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= +github.com/go-openapi/analysis v0.19.10 h1:5BHISBAXOc/aJK25irLZnx2D3s6WyYaY9D4gmuz9fdE= +github.com/go-openapi/analysis v0.19.10/go.mod h1:qmhS3VNFxBlquFJ0RGoDtylO9y4pgTAUNE9AEEMdlJQ= +github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/errors v0.19.6 h1:xZMThgv5SQ7SMbWtKFkCf9bBdvR2iEyw9k3zGZONuys= +github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.4 h1:3Vw+rh13uq2JFNxgnMTGE1rnoieU9FmyE1gvnyylsYg= +github.com/go-openapi/jsonreference v0.19.4/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= +github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI= +github.com/go-openapi/loads v0.19.5 h1:jZVYWawIQiA1NBnHla28ktg6hrcfTHsCE+3QLVRBIls= +github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY= +github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= +github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= +github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= +github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo= +github.com/go-openapi/runtime v0.19.21 h1:81PiYus9l6fwwS4EwhJD+tQb3EPZBeWfgdAVTfFD25Q= +github.com/go-openapi/runtime v0.19.21/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk= +github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= +github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/spec v0.19.6/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= +github.com/go-openapi/spec v0.19.8/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= +github.com/go-openapi/spec v0.19.9 h1:9z9cbFuZJ7AcvOHKIY+f6Aevb4vObNDkTEyoMfO7rAc= +github.com/go-openapi/spec v0.19.9/go.mod h1:vqK/dIdLGCosfvYsQV3WfC7N3TiZSnGY2RZKoFK7X28= +github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= +github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= +github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= +github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/strfmt v0.19.5 h1:0utjKrw+BAh8s57XE9Xz8DUBsVvPmRUB6styvl9wWIM= +github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= +github.com/go-openapi/swag v0.19.9 h1:1IxuqvBUU3S2Bi4YC7tlP9SJF1gVpCvqN0T2Qof4azE= +github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= +github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= +github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= +github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= +github.com/go-openapi/validate v0.19.10 h1:tG3SZ5DC5KF4cyt7nqLVcQXGj5A7mpaYkAcNPlDK+Yk= +github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= +github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= +github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= +github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= +github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= +github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= +github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= +github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= +github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= +github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= +github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.1 h1:mdxE1MF9o53iCb2Ghj1VfWvh7ZOwHpnVG/xwXrV90U8= +github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.3.2 h1:mRS76wmkOn3KkKAyXDu42V+6ebnXWIztFSYGN7GeoRg= +github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= +github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= +go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= +go.mongodb.org/mongo-driver v1.3.4 h1:zs/dKNwX0gYUtzwrN9lLiR15hCO0nDwQj5xXx+vjCdE= +go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/legacy/cmd/cocsn-server/cocsn-server b/legacy/cmd/cocsn-server/cocsn-server new file mode 100755 index 0000000000000000000000000000000000000000..90fe50b7b5fefb99cdc04218cc3f7e739e298d36 Binary files /dev/null and b/legacy/cmd/cocsn-server/cocsn-server differ diff --git a/legacy/cmd/cocsn-server/main.go b/legacy/cmd/cocsn-server/main.go new file mode 100644 index 0000000000000000000000000000000000000000..2dda11b818c6c4c76d53c37bf93ba5db00d12f69 --- /dev/null +++ b/legacy/cmd/cocsn-server/main.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package main + +import ( + "code.fbi.h-da.de/cocsn/cocsn-api/legacy/models" + . "code.fbi.h-da.de/cocsn/cocsn-api/legacy/restapi/operations/interface_operations" + "github.com/go-openapi/runtime/middleware" + "log" + "os" + + "code.fbi.h-da.de/cocsn/cocsn-api/legacy/restapi" + "code.fbi.h-da.de/cocsn/cocsn-api/legacy/restapi/operations" + "github.com/go-openapi/loads" + flags "github.com/jessevdk/go-flags" +) + +// This file was generated by the swagger tool. +// Make sure not to overwrite this file after you generated it because all your edits would be lost! + +func main() { + + swaggerSpec, err := loads.Embedded(restapi.SwaggerJSON, restapi.FlatSwaggerJSON) + if err != nil { + log.Fatalln(err) + } + + api := operations.NewCocsnAPI(swaggerSpec) + api.InterfaceOperationsGetIPAddressesHandler = getIpHandler{} + server := restapi.NewServer(api) + defer server.Shutdown() + + parser := flags.NewParser(server, flags.Default) + parser.ShortDescription = "CoCSN" + parser.LongDescription = "Simple RESTCONF API" + server.ConfigureFlags() + for _, optsGroup := range api.CommandLineOptionsGroups { + _, err := parser.AddGroup(optsGroup.ShortDescription, optsGroup.LongDescription, optsGroup.Options) + if err != nil { + log.Fatalln(err) + } + } + + if _, err := parser.Parse(); err != nil { + code := 1 + if fe, ok := err.(*flags.Error); ok { + if fe.Type == flags.ErrHelp { + code = 0 + } + } + os.Exit(code) + } + + server.ConfigureAPI() + + if err := server.Serve(); err != nil { + log.Fatalln(err) + } + +} + +type getIpHandler struct { + +} + +func (handler getIpHandler) Handle(params GetIPAddressesParams) middleware.Responder { + return NewGetIPAddressesOK().WithPayload(models.LogicalAddresses{}) +} \ No newline at end of file diff --git a/models/interfaces.go b/legacy/models/interfaces.go similarity index 100% rename from models/interfaces.go rename to legacy/models/interfaces.go diff --git a/models/logical_addresses.go b/legacy/models/logical_addresses.go similarity index 100% rename from models/logical_addresses.go rename to legacy/models/logical_addresses.go diff --git a/models/physical_address.go b/legacy/models/physical_address.go similarity index 100% rename from models/physical_address.go rename to legacy/models/physical_address.go diff --git a/restapi/configure_cocsn.go b/legacy/restapi/configure_cocsn.go similarity index 71% rename from restapi/configure_cocsn.go rename to legacy/restapi/configure_cocsn.go index 1db0a2805cc65897cd324866c557ae74ebf97115..39c8dad006f89b5aca69b2b05538bc21f86aa91c 100644 --- a/restapi/configure_cocsn.go +++ b/legacy/restapi/configure_cocsn.go @@ -10,11 +10,11 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" - "code.fbi.h-da.de/cocsn/cocsn-api/api/restapi/operations" - "code.fbi.h-da.de/cocsn/cocsn-api/api/restapi/operations/interface_operations" + "code.fbi.h-da.de/cocsn/cocsn-api/legacy/restapi/operations" + "code.fbi.h-da.de/cocsn/cocsn-api/legacy/restapi/operations/interface_operations" ) -//go:generate swagger generate server --target ../../generated --name Cocsn --spec ../../cocsn-v0.0.1.yml --principal interface{} +//go:generate swagger generate server --target ../../v0.0.1 --name Cocsn --spec ../../cocsn-v0.0.1.yml --principal interface{} func configureFlags(api *operations.CocsnAPI) { // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } @@ -38,11 +38,21 @@ func configureAPI(api *operations.CocsnAPI) http.Handler { api.JSONProducer = runtime.JSONProducer() + if api.InterfaceOperationsGetIPAddressesHandler == nil { + api.InterfaceOperationsGetIPAddressesHandler = interface_operations.GetIPAddressesHandlerFunc(func(params interface_operations.GetIPAddressesParams) middleware.Responder { + return middleware.NotImplemented("operation interface_operations.GetIPAddresses has not yet been implemented") + }) + } if api.InterfaceOperationsGetInterfacesHandler == nil { api.InterfaceOperationsGetInterfacesHandler = interface_operations.GetInterfacesHandlerFunc(func(params interface_operations.GetInterfacesParams) middleware.Responder { return middleware.NotImplemented("operation interface_operations.GetInterfaces has not yet been implemented") }) } + if api.InterfaceOperationsGetMACAddressHandler == nil { + api.InterfaceOperationsGetMACAddressHandler = interface_operations.GetMACAddressHandlerFunc(func(params interface_operations.GetMACAddressParams) middleware.Responder { + return middleware.NotImplemented("operation interface_operations.GetMACAddress has not yet been implemented") + }) + } api.PreServerShutdown = func() {} diff --git a/restapi/doc.go b/legacy/restapi/doc.go similarity index 100% rename from restapi/doc.go rename to legacy/restapi/doc.go diff --git a/restapi/embedded_spec.go b/legacy/restapi/embedded_spec.go similarity index 100% rename from restapi/embedded_spec.go rename to legacy/restapi/embedded_spec.go diff --git a/restapi/operations/cocsn_api.go b/legacy/restapi/operations/cocsn_api.go similarity index 99% rename from restapi/operations/cocsn_api.go rename to legacy/restapi/operations/cocsn_api.go index 781e0b50a1bed3e5ece1f555be32d8c82f7cb98e..2e04f825818269c38e9d305e35e28360587a5ecf 100644 --- a/restapi/operations/cocsn_api.go +++ b/legacy/restapi/operations/cocsn_api.go @@ -19,7 +19,7 @@ import ( "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - "code.fbi.h-da.de/cocsn/cocsn-api/restapi/operations/interface_operations" + "code.fbi.h-da.de/cocsn/cocsn-api/legacy/restapi/operations/interface_operations" ) // NewCocsnAPI creates a new Cocsn instance diff --git a/restapi/operations/interface_operations/get_interfaces.go b/legacy/restapi/operations/interface_operations/get_interfaces.go similarity index 100% rename from restapi/operations/interface_operations/get_interfaces.go rename to legacy/restapi/operations/interface_operations/get_interfaces.go diff --git a/restapi/operations/interface_operations/get_interfaces_parameters.go b/legacy/restapi/operations/interface_operations/get_interfaces_parameters.go similarity index 100% rename from restapi/operations/interface_operations/get_interfaces_parameters.go rename to legacy/restapi/operations/interface_operations/get_interfaces_parameters.go diff --git a/restapi/operations/interface_operations/get_interfaces_responses.go b/legacy/restapi/operations/interface_operations/get_interfaces_responses.go similarity index 98% rename from restapi/operations/interface_operations/get_interfaces_responses.go rename to legacy/restapi/operations/interface_operations/get_interfaces_responses.go index f46829657a97e5285f52284e05e67f39ba489a10..c7897180c4e58e899eee7802d142d85a55eb27d7 100644 --- a/restapi/operations/interface_operations/get_interfaces_responses.go +++ b/legacy/restapi/operations/interface_operations/get_interfaces_responses.go @@ -10,7 +10,7 @@ import ( "github.com/go-openapi/runtime" - "code.fbi.h-da.de/cocsn/cocsn-api/models" + "code.fbi.h-da.de/cocsn/cocsn-api/legacy/models" ) // GetInterfacesOKCode is the HTTP code returned for type GetInterfacesOK diff --git a/restapi/operations/interface_operations/get_interfaces_urlbuilder.go b/legacy/restapi/operations/interface_operations/get_interfaces_urlbuilder.go similarity index 100% rename from restapi/operations/interface_operations/get_interfaces_urlbuilder.go rename to legacy/restapi/operations/interface_operations/get_interfaces_urlbuilder.go diff --git a/restapi/operations/interface_operations/get_ip_addresses.go b/legacy/restapi/operations/interface_operations/get_ip_addresses.go similarity index 100% rename from restapi/operations/interface_operations/get_ip_addresses.go rename to legacy/restapi/operations/interface_operations/get_ip_addresses.go diff --git a/restapi/operations/interface_operations/get_ip_addresses_parameters.go b/legacy/restapi/operations/interface_operations/get_ip_addresses_parameters.go similarity index 100% rename from restapi/operations/interface_operations/get_ip_addresses_parameters.go rename to legacy/restapi/operations/interface_operations/get_ip_addresses_parameters.go diff --git a/restapi/operations/interface_operations/get_ip_addresses_responses.go b/legacy/restapi/operations/interface_operations/get_ip_addresses_responses.go similarity index 98% rename from restapi/operations/interface_operations/get_ip_addresses_responses.go rename to legacy/restapi/operations/interface_operations/get_ip_addresses_responses.go index 7fd666f560805dd7b5b8ebc7cfec5434734e1023..134f2a525b7724cca6b867237cfa668a841acbd4 100644 --- a/restapi/operations/interface_operations/get_ip_addresses_responses.go +++ b/legacy/restapi/operations/interface_operations/get_ip_addresses_responses.go @@ -10,7 +10,7 @@ import ( "github.com/go-openapi/runtime" - "code.fbi.h-da.de/cocsn/cocsn-api/models" + "code.fbi.h-da.de/cocsn/cocsn-api/legacy/models" ) // GetIPAddressesOKCode is the HTTP code returned for type GetIPAddressesOK diff --git a/restapi/operations/interface_operations/get_ip_addresses_urlbuilder.go b/legacy/restapi/operations/interface_operations/get_ip_addresses_urlbuilder.go similarity index 100% rename from restapi/operations/interface_operations/get_ip_addresses_urlbuilder.go rename to legacy/restapi/operations/interface_operations/get_ip_addresses_urlbuilder.go diff --git a/restapi/operations/interface_operations/get_m_a_c_address.go b/legacy/restapi/operations/interface_operations/get_m_a_c_address.go similarity index 100% rename from restapi/operations/interface_operations/get_m_a_c_address.go rename to legacy/restapi/operations/interface_operations/get_m_a_c_address.go diff --git a/restapi/operations/interface_operations/get_m_a_c_address_parameters.go b/legacy/restapi/operations/interface_operations/get_m_a_c_address_parameters.go similarity index 100% rename from restapi/operations/interface_operations/get_m_a_c_address_parameters.go rename to legacy/restapi/operations/interface_operations/get_m_a_c_address_parameters.go diff --git a/restapi/operations/interface_operations/get_m_a_c_address_responses.go b/legacy/restapi/operations/interface_operations/get_m_a_c_address_responses.go similarity index 98% rename from restapi/operations/interface_operations/get_m_a_c_address_responses.go rename to legacy/restapi/operations/interface_operations/get_m_a_c_address_responses.go index 478c413d60e3911605cfa4273400fae4f439ff1a..3c000366af969db3a58e68cf1cc45315e008c859 100644 --- a/restapi/operations/interface_operations/get_m_a_c_address_responses.go +++ b/legacy/restapi/operations/interface_operations/get_m_a_c_address_responses.go @@ -10,7 +10,7 @@ import ( "github.com/go-openapi/runtime" - "code.fbi.h-da.de/cocsn/cocsn-api/models" + "code.fbi.h-da.de/cocsn/cocsn-api/legacy/models" ) // GetMACAddressOKCode is the HTTP code returned for type GetMACAddressOK diff --git a/restapi/operations/interface_operations/get_m_a_c_address_urlbuilder.go b/legacy/restapi/operations/interface_operations/get_m_a_c_address_urlbuilder.go similarity index 100% rename from restapi/operations/interface_operations/get_m_a_c_address_urlbuilder.go rename to legacy/restapi/operations/interface_operations/get_m_a_c_address_urlbuilder.go diff --git a/restapi/server.go b/legacy/restapi/server.go similarity index 99% rename from restapi/server.go rename to legacy/restapi/server.go index 11a359a80ea9dbf087d0fd8b93c819bdbeae12eb..53878d2524eef212451aa3f24a1c69e2cb8597aa 100644 --- a/restapi/server.go +++ b/legacy/restapi/server.go @@ -25,7 +25,7 @@ import ( flags "github.com/jessevdk/go-flags" "golang.org/x/net/netutil" - "code.fbi.h-da.de/cocsn/cocsn-api/restapi/operations" + "code.fbi.h-da.de/cocsn/cocsn-api/legacy/restapi/operations" ) const ( diff --git a/models/interface.go b/models/interface.go deleted file mode 100644 index ee434cf6b88c8738d0a8538ac008fbccd9132bc1..0000000000000000000000000000000000000000 --- a/models/interface.go +++ /dev/null @@ -1,26 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" -) - -// Interface interface -// -// swagger:model Interface -type Interface []string - -// Validate validates this interface -func (m Interface) Validate(formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/restapi/operations/interface_operations/get_h_w_addresses.go b/restapi/operations/interface_operations/get_h_w_addresses.go deleted file mode 100644 index f17a3ac83f2b02f41b11986482988481d59b5247..0000000000000000000000000000000000000000 --- a/restapi/operations/interface_operations/get_h_w_addresses.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package interface_operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetHWAddressesHandlerFunc turns a function with the right signature into a get h w addresses handler -type GetHWAddressesHandlerFunc func(GetHWAddressesParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetHWAddressesHandlerFunc) Handle(params GetHWAddressesParams) middleware.Responder { - return fn(params) -} - -// GetHWAddressesHandler interface for that can handle valid get h w addresses params -type GetHWAddressesHandler interface { - Handle(GetHWAddressesParams) middleware.Responder -} - -// NewGetHWAddresses creates a new http.Handler for the get h w addresses operation -func NewGetHWAddresses(ctx *middleware.Context, handler GetHWAddressesHandler) *GetHWAddresses { - return &GetHWAddresses{Context: ctx, Handler: handler} -} - -/*GetHWAddresses swagger:route GET /data/cocsn-interface/{interface}/mac-address interface getHWAddresses - -Returns harware address of an interface - -*/ -type GetHWAddresses struct { - Context *middleware.Context - Handler GetHWAddressesHandler -} - -func (o *GetHWAddresses) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - r = rCtx - } - var Params = NewGetHWAddressesParams() - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/restapi/operations/interface_operations/get_h_w_addresses_parameters.go b/restapi/operations/interface_operations/get_h_w_addresses_parameters.go deleted file mode 100644 index 1a7f7199a8ca957c288d0aac93899ec02a725661..0000000000000000000000000000000000000000 --- a/restapi/operations/interface_operations/get_h_w_addresses_parameters.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package interface_operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetHWAddressesParams creates a new GetHWAddressesParams object -// no default values defined in spec. -func NewGetHWAddressesParams() GetHWAddressesParams { - - return GetHWAddressesParams{} -} - -// GetHWAddressesParams contains all the bound params for the get h w addresses operation -// typically these are obtained from a http.Request -// -// swagger:parameters getHWAddresses -type GetHWAddressesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*interface to fetch - Required: true - In: path - */ - Interface string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetHWAddressesParams() beforehand. -func (o *GetHWAddressesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rInterface, rhkInterface, _ := route.Params.GetOK("interface") - if err := o.bindInterface(rInterface, rhkInterface, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindInterface binds and validates parameter Interface from path. -func (o *GetHWAddressesParams) bindInterface(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - o.Interface = raw - - return nil -} diff --git a/restapi/operations/interface_operations/get_h_w_addresses_responses.go b/restapi/operations/interface_operations/get_h_w_addresses_responses.go deleted file mode 100644 index a38bc7c3e338ae153ca44e9b032f40a4ba710c06..0000000000000000000000000000000000000000 --- a/restapi/operations/interface_operations/get_h_w_addresses_responses.go +++ /dev/null @@ -1,118 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package interface_operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "code.fbi.h-da.de/cocsn/cocsn-api/api/models" -) - -// GetHWAddressesOKCode is the HTTP code returned for type GetHWAddressesOK -const GetHWAddressesOKCode int = 200 - -/*GetHWAddressesOK OK - -swagger:response getHWAddressesOK -*/ -type GetHWAddressesOK struct { - - /* - In: Body - */ - Payload models.PhysicalAddress `json:"body,omitempty"` -} - -// NewGetHWAddressesOK creates GetHWAddressesOK with default headers values -func NewGetHWAddressesOK() *GetHWAddressesOK { - - return &GetHWAddressesOK{} -} - -// WithPayload adds the payload to the get h w addresses o k response -func (o *GetHWAddressesOK) WithPayload(payload models.PhysicalAddress) *GetHWAddressesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get h w addresses o k response -func (o *GetHWAddressesOK) SetPayload(payload models.PhysicalAddress) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetHWAddressesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetHWAddressesNotFoundCode is the HTTP code returned for type GetHWAddressesNotFound -const GetHWAddressesNotFoundCode int = 404 - -/*GetHWAddressesNotFound An error occurred. - -swagger:response getHWAddressesNotFound -*/ -type GetHWAddressesNotFound struct { -} - -// NewGetHWAddressesNotFound creates GetHWAddressesNotFound with default headers values -func NewGetHWAddressesNotFound() *GetHWAddressesNotFound { - - return &GetHWAddressesNotFound{} -} - -// WriteResponse to the client -func (o *GetHWAddressesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -/*GetHWAddressesDefault Unexpected error - -swagger:response getHWAddressesDefault -*/ -type GetHWAddressesDefault struct { - _statusCode int -} - -// NewGetHWAddressesDefault creates GetHWAddressesDefault with default headers values -func NewGetHWAddressesDefault(code int) *GetHWAddressesDefault { - if code <= 0 { - code = 500 - } - - return &GetHWAddressesDefault{ - _statusCode: code, - } -} - -// WithStatusCode adds the status to the get h w addresses default response -func (o *GetHWAddressesDefault) WithStatusCode(code int) *GetHWAddressesDefault { - o._statusCode = code - return o -} - -// SetStatusCode sets the status to the get h w addresses default response -func (o *GetHWAddressesDefault) SetStatusCode(code int) { - o._statusCode = code -} - -// WriteResponse to the client -func (o *GetHWAddressesDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(o._statusCode) -} diff --git a/waveserver/cmd/cocsn-server/cocsn-server b/waveserver/cmd/cocsn-server/cocsn-server new file mode 100755 index 0000000000000000000000000000000000000000..4340ecb120e72188553d1959818b9de7999d1b32 Binary files /dev/null and b/waveserver/cmd/cocsn-server/cocsn-server differ diff --git a/waveserver/cmd/cocsn-server/main.go b/waveserver/cmd/cocsn-server/main.go new file mode 100644 index 0000000000000000000000000000000000000000..77dc5e456615fe07e77f921d626789da9fd0580d --- /dev/null +++ b/waveserver/cmd/cocsn-server/main.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package main + +import ( + . "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/restapi/operations/ciena_waveserver_interfaces" + "github.com/go-openapi/runtime/middleware" + "log" + "os" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/restapi" + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/restapi/operations" + "github.com/go-openapi/loads" + flags "github.com/jessevdk/go-flags" +) + +// This file was generated by the swagger tool. +// Make sure not to overwrite this file after you generated it because all your edits would be lost! + +type getInterfaceHandler struct { + +} + +func (ifh getInterfaceHandler) Handle(params GetDataWaveserverInterfacesLogicalInterfaceIndexParams) middleware.Responder { + return NewGetDataWaveserverInterfacesLogicalInterfaceIndexOK() +} + +func main() { + + swaggerSpec, err := loads.Embedded(restapi.SwaggerJSON, restapi.FlatSwaggerJSON) + if err != nil { + log.Fatalln(err) + } + + api := operations.NewCocsnAPI(swaggerSpec) + api.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexHandler = getInterfaceHandler{} + server := restapi.NewServer(api) + defer server.Shutdown() + + parser := flags.NewParser(server, flags.Default) + parser.ShortDescription = "ciena-waveserver-interfaces API" + parser.LongDescription = "This module defines Ethernet and IP management interfaces support for\n Ciena's Waveserver Platform." + server.ConfigureFlags() + for _, optsGroup := range api.CommandLineOptionsGroups { + _, err := parser.AddGroup(optsGroup.ShortDescription, optsGroup.LongDescription, optsGroup.Options) + if err != nil { + log.Fatalln(err) + } + } + + if _, err := parser.Parse(); err != nil { + code := 1 + if fe, ok := err.(*flags.Error); ok { + if fe.Type == flags.ErrHelp { + code = 0 + } + } + os.Exit(code) + } + + server.ConfigureAPI() + + if err := server.Serve(); err != nil { + log.Fatalln(err) + } + +} diff --git a/waveserver/models/ciena_waveserver_interfaces_duplex_enumeration.go b/waveserver/models/ciena_waveserver_interfaces_duplex_enumeration.go new file mode 100644 index 0000000000000000000000000000000000000000..e7346b293c17abbb84b52ed95ad70bb8a6f79c43 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_duplex_enumeration.go @@ -0,0 +1,66 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// CienaWaveserverInterfacesDuplexEnumeration ciena waveserver interfaces duplex enumeration +// +// swagger:model ciena.waveserver.interfaces.DuplexEnumeration +type CienaWaveserverInterfacesDuplexEnumeration string + +const ( + + // CienaWaveserverInterfacesDuplexEnumerationUnknown captures enum value "Unknown" + CienaWaveserverInterfacesDuplexEnumerationUnknown CienaWaveserverInterfacesDuplexEnumeration = "Unknown" + + // CienaWaveserverInterfacesDuplexEnumerationFull captures enum value "full" + CienaWaveserverInterfacesDuplexEnumerationFull CienaWaveserverInterfacesDuplexEnumeration = "full" + + // CienaWaveserverInterfacesDuplexEnumerationHalf captures enum value "half" + CienaWaveserverInterfacesDuplexEnumerationHalf CienaWaveserverInterfacesDuplexEnumeration = "half" +) + +// for schema +var cienaWaveserverInterfacesDuplexEnumerationEnum []interface{} + +func init() { + var res []CienaWaveserverInterfacesDuplexEnumeration + if err := json.Unmarshal([]byte(`["Unknown","full","half"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + cienaWaveserverInterfacesDuplexEnumerationEnum = append(cienaWaveserverInterfacesDuplexEnumerationEnum, v) + } +} + +func (m CienaWaveserverInterfacesDuplexEnumeration) validateCienaWaveserverInterfacesDuplexEnumerationEnum(path, location string, value CienaWaveserverInterfacesDuplexEnumeration) error { + if err := validate.EnumCase(path, location, value, cienaWaveserverInterfacesDuplexEnumerationEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this ciena waveserver interfaces duplex enumeration +func (m CienaWaveserverInterfacesDuplexEnumeration) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateCienaWaveserverInterfacesDuplexEnumerationEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_ethernet_if_properties_group.go b/waveserver/models/ciena_waveserver_interfaces_ethernet_if_properties_group.go new file mode 100644 index 0000000000000000000000000000000000000000..969fcadd4240f9b97e3c257311bb3d192b175658 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_ethernet_if_properties_group.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesEthernetIfPropertiesGroup ciena waveserver interfaces ethernet if properties group +// +// swagger:model ciena.waveserver.interfaces.EthernetIfPropertiesGroup +type CienaWaveserverInterfacesEthernetIfPropertiesGroup struct { + + // Specifies whether the interface should negotiate common transmission + // parameters, such as speed, duplex, and flow control with its peer. REF:IEEE 802.3-2012 auto-negotiation transmission parameters + AutoNegotiation *bool `json:"auto-negotiation,omitempty"` + + // Ethernet interface duplex mode. For ports with auto-negotiation enabled, + // this represents the negotiated duplex mode. + Duplex CienaWaveserverInterfacesDuplexEnumeration `json:"duplex,omitempty"` + + // Specifies whether this interface will participate in Ethernet flow + // control, via pause frames. + FlowControl *bool `json:"flow-control,omitempty"` + + // The system-assigned MAC address of the Ethernet interface. + MacAddress string `json:"mac-address,omitempty"` + + // Ethernet port speed. For ports with auto-negotiation enabled, this + // represents the negotiated port speed. + Speed CienaWaveserverInterfacesSpeedEnumeration `json:"speed,omitempty"` +} + +// Validate validates this ciena waveserver interfaces ethernet if properties group +func (m *CienaWaveserverInterfacesEthernetIfPropertiesGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDuplex(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSpeed(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesEthernetIfPropertiesGroup) validateDuplex(formats strfmt.Registry) error { + + if swag.IsZero(m.Duplex) { // not required + return nil + } + + if err := m.Duplex.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("duplex") + } + return err + } + + return nil +} + +func (m *CienaWaveserverInterfacesEthernetIfPropertiesGroup) validateSpeed(formats strfmt.Registry) error { + + if swag.IsZero(m.Speed) { // not required + return nil + } + + if err := m.Speed.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("speed") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesEthernetIfPropertiesGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesEthernetIfPropertiesGroup) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesEthernetIfPropertiesGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_ethernet_if_properties_group_wrapper.go b/waveserver/models/ciena_waveserver_interfaces_ethernet_if_properties_group_wrapper.go new file mode 100644 index 0000000000000000000000000000000000000000..131abfad0c81ab1067d99db7a1e8a8636c261c90 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_ethernet_if_properties_group_wrapper.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesEthernetIfPropertiesGroupWrapper ciena waveserver interfaces ethernet if properties group wrapper +// +// swagger:model ciena.waveserver.interfaces.EthernetIfPropertiesGroupWrapper +type CienaWaveserverInterfacesEthernetIfPropertiesGroupWrapper struct { + + // ethernet + Ethernet *CienaWaveserverInterfacesEthernetIfPropertiesGroup `json:"ethernet,omitempty"` +} + +// Validate validates this ciena waveserver interfaces ethernet if properties group wrapper +func (m *CienaWaveserverInterfacesEthernetIfPropertiesGroupWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEthernet(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesEthernetIfPropertiesGroupWrapper) validateEthernet(formats strfmt.Registry) error { + + if swag.IsZero(m.Ethernet) { // not required + return nil + } + + if m.Ethernet != nil { + if err := m.Ethernet.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ethernet") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesEthernetIfPropertiesGroupWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesEthernetIfPropertiesGroupWrapper) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesEthernetIfPropertiesGroupWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_management_if_properties_group.go b/waveserver/models/ciena_waveserver_interfaces_management_if_properties_group.go new file mode 100644 index 0000000000000000000000000000000000000000..a0a05ac7be6b710c2bb772b249f525123227b821 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_management_if_properties_group.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesManagementIfPropertiesGroup ciena waveserver interfaces management if properties group +// +// swagger:model ciena.waveserver.interfaces.ManagementIfPropertiesGroup +type CienaWaveserverInterfacesManagementIfPropertiesGroup struct { + + // Management port mode. Specifies whether the port is configured as a + // local management interface or wayside communications channel (carry + // through). + Mode CienaWaveserverInterfacesModeEnumeration `json:"mode,omitempty"` +} + +// Validate validates this ciena waveserver interfaces management if properties group +func (m *CienaWaveserverInterfacesManagementIfPropertiesGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesManagementIfPropertiesGroup) validateMode(formats strfmt.Registry) error { + + if swag.IsZero(m.Mode) { // not required + return nil + } + + if err := m.Mode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mode") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesManagementIfPropertiesGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesManagementIfPropertiesGroup) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesManagementIfPropertiesGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_management_if_properties_group_wrapper.go b/waveserver/models/ciena_waveserver_interfaces_management_if_properties_group_wrapper.go new file mode 100644 index 0000000000000000000000000000000000000000..f7ab62a118d29ccca40b467b76da82d3163c2082 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_management_if_properties_group_wrapper.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesManagementIfPropertiesGroupWrapper ciena waveserver interfaces management if properties group wrapper +// +// swagger:model ciena.waveserver.interfaces.ManagementIfPropertiesGroupWrapper +type CienaWaveserverInterfacesManagementIfPropertiesGroupWrapper struct { + + // management + Management *CienaWaveserverInterfacesManagementIfPropertiesGroup `json:"management,omitempty"` +} + +// Validate validates this ciena waveserver interfaces management if properties group wrapper +func (m *CienaWaveserverInterfacesManagementIfPropertiesGroupWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateManagement(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesManagementIfPropertiesGroupWrapper) validateManagement(formats strfmt.Registry) error { + + if swag.IsZero(m.Management) { // not required + return nil + } + + if m.Management != nil { + if err := m.Management.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("management") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesManagementIfPropertiesGroupWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesManagementIfPropertiesGroupWrapper) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesManagementIfPropertiesGroupWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_mode_enumeration.go b/waveserver/models/ciena_waveserver_interfaces_mode_enumeration.go new file mode 100644 index 0000000000000000000000000000000000000000..78cd5a568b20f4c9be07bd1aa8d0547d116a9ee3 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_mode_enumeration.go @@ -0,0 +1,63 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// CienaWaveserverInterfacesModeEnumeration ciena waveserver interfaces mode enumeration +// +// swagger:model ciena.waveserver.interfaces.ModeEnumeration +type CienaWaveserverInterfacesModeEnumeration string + +const ( + + // CienaWaveserverInterfacesModeEnumerationManagement captures enum value "management" + CienaWaveserverInterfacesModeEnumerationManagement CienaWaveserverInterfacesModeEnumeration = "management" + + // CienaWaveserverInterfacesModeEnumerationWaysideChannel captures enum value "wayside-channel" + CienaWaveserverInterfacesModeEnumerationWaysideChannel CienaWaveserverInterfacesModeEnumeration = "wayside-channel" +) + +// for schema +var cienaWaveserverInterfacesModeEnumerationEnum []interface{} + +func init() { + var res []CienaWaveserverInterfacesModeEnumeration + if err := json.Unmarshal([]byte(`["management","wayside-channel"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + cienaWaveserverInterfacesModeEnumerationEnum = append(cienaWaveserverInterfacesModeEnumerationEnum, v) + } +} + +func (m CienaWaveserverInterfacesModeEnumeration) validateCienaWaveserverInterfacesModeEnumerationEnum(path, location string, value CienaWaveserverInterfacesModeEnumeration) error { + if err := validate.EnumCase(path, location, value, cienaWaveserverInterfacesModeEnumerationEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this ciena waveserver interfaces mode enumeration +func (m CienaWaveserverInterfacesModeEnumeration) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateCienaWaveserverInterfacesModeEnumerationEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_route_next_hop_group.go b/waveserver/models/ciena_waveserver_interfaces_route_next_hop_group.go new file mode 100644 index 0000000000000000000000000000000000000000..53e9fa210768d8b57f47a2166708a9023a1fc1be --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_route_next_hop_group.go @@ -0,0 +1,57 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesRouteNextHopGroup ciena waveserver interfaces route next hop group +// +// swagger:model ciena.waveserver.interfaces.RouteNextHopGroup +type CienaWaveserverInterfacesRouteNextHopGroup struct { + + // Specifies whether the route is active (present in the kernel IP + // routing table). + Active *bool `json:"active,omitempty"` + + // Reference to the associated logical-interface name of the route entry. + // Defaults to the 'local' interface for routes within the subnet + // associated with the active IP address configured on the local + // management interface. + AssociatedInterface string `json:"associated-interface,omitempty"` + + // Routing metric cost. + Metric int64 `json:"metric,omitempty"` + + // Specifies whether the route entry is user-created (static) or + // dynamically created by a routing protocol. + Static *bool `json:"static,omitempty"` +} + +// Validate validates this ciena waveserver interfaces route next hop group +func (m *CienaWaveserverInterfacesRouteNextHopGroup) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesRouteNextHopGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesRouteNextHopGroup) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesRouteNextHopGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_speed_enumeration.go b/waveserver/models/ciena_waveserver_interfaces_speed_enumeration.go new file mode 100644 index 0000000000000000000000000000000000000000..10f5d4f6fcbd7ab6a23fb104d084638173b196ae --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_speed_enumeration.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// CienaWaveserverInterfacesSpeedEnumeration ciena waveserver interfaces speed enumeration +// +// swagger:model ciena.waveserver.interfaces.SpeedEnumeration +type CienaWaveserverInterfacesSpeedEnumeration string + +const ( + + // CienaWaveserverInterfacesSpeedEnumerationUnknown captures enum value "Unknown" + CienaWaveserverInterfacesSpeedEnumerationUnknown CienaWaveserverInterfacesSpeedEnumeration = "Unknown" + + // CienaWaveserverInterfacesSpeedEnumerationNr10M captures enum value "10M" + CienaWaveserverInterfacesSpeedEnumerationNr10M CienaWaveserverInterfacesSpeedEnumeration = "10M" + + // CienaWaveserverInterfacesSpeedEnumerationNr100M captures enum value "100M" + CienaWaveserverInterfacesSpeedEnumerationNr100M CienaWaveserverInterfacesSpeedEnumeration = "100M" + + // CienaWaveserverInterfacesSpeedEnumerationNr1G captures enum value "1G" + CienaWaveserverInterfacesSpeedEnumerationNr1G CienaWaveserverInterfacesSpeedEnumeration = "1G" + + // CienaWaveserverInterfacesSpeedEnumerationNr10G captures enum value "10G" + CienaWaveserverInterfacesSpeedEnumerationNr10G CienaWaveserverInterfacesSpeedEnumeration = "10G" +) + +// for schema +var cienaWaveserverInterfacesSpeedEnumerationEnum []interface{} + +func init() { + var res []CienaWaveserverInterfacesSpeedEnumeration + if err := json.Unmarshal([]byte(`["Unknown","10M","100M","1G","10G"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + cienaWaveserverInterfacesSpeedEnumerationEnum = append(cienaWaveserverInterfacesSpeedEnumerationEnum, v) + } +} + +func (m CienaWaveserverInterfacesSpeedEnumeration) validateCienaWaveserverInterfacesSpeedEnumerationEnum(path, location string, value CienaWaveserverInterfacesSpeedEnumeration) error { + if err := validate.EnumCase(path, location, value, cienaWaveserverInterfacesSpeedEnumerationEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this ciena waveserver interfaces speed enumeration +func (m CienaWaveserverInterfacesSpeedEnumeration) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateCienaWaveserverInterfacesSpeedEnumerationEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_type_enumeration.go b/waveserver/models/ciena_waveserver_interfaces_type_enumeration.go new file mode 100644 index 0000000000000000000000000000000000000000..d92ece119a79dfcbf09ad872b3e98507afc30388 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_type_enumeration.go @@ -0,0 +1,63 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// CienaWaveserverInterfacesTypeEnumeration ciena waveserver interfaces type enumeration +// +// swagger:model ciena.waveserver.interfaces.TypeEnumeration +type CienaWaveserverInterfacesTypeEnumeration string + +const ( + + // CienaWaveserverInterfacesTypeEnumerationEthernet captures enum value "ethernet" + CienaWaveserverInterfacesTypeEnumerationEthernet CienaWaveserverInterfacesTypeEnumeration = "ethernet" + + // CienaWaveserverInterfacesTypeEnumerationSerial captures enum value "serial" + CienaWaveserverInterfacesTypeEnumerationSerial CienaWaveserverInterfacesTypeEnumeration = "serial" +) + +// for schema +var cienaWaveserverInterfacesTypeEnumerationEnum []interface{} + +func init() { + var res []CienaWaveserverInterfacesTypeEnumeration + if err := json.Unmarshal([]byte(`["ethernet","serial"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + cienaWaveserverInterfacesTypeEnumerationEnum = append(cienaWaveserverInterfacesTypeEnumerationEnum, v) + } +} + +func (m CienaWaveserverInterfacesTypeEnumeration) validateCienaWaveserverInterfacesTypeEnumerationEnum(path, location string, value CienaWaveserverInterfacesTypeEnumeration) error { + if err := validate.EnumCase(path, location, value, cienaWaveserverInterfacesTypeEnumerationEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this ciena waveserver interfaces type enumeration +func (m CienaWaveserverInterfacesTypeEnumeration) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateCienaWaveserverInterfacesTypeEnumerationEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserver_interfaces.go b/waveserver/models/ciena_waveserver_interfaces_waveserver_interfaces.go new file mode 100644 index 0000000000000000000000000000000000000000..82d5899404808f3ab6723e27c5523e98e49950ff --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserver_interfaces.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverInterfaces ciena waveserver interfaces waveserver interfaces +// +// swagger:model ciena.waveserver.interfaces.WaveserverInterfaces +type CienaWaveserverInterfacesWaveserverInterfaces struct { + + // List of logical IP management interfaces (e.g. 'local'). + LogicalInterface []*CienaWaveserverInterfacesWaveserverinterfacesLogicalInterface `json:"logical-interface"` + + // List of physical Ethernet management interfaces. + PhysicalInterface []*CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterface `json:"physical-interface"` + + // Top-level container for IP route configuration and operational data. + Routes *CienaWaveserverInterfacesWaveserverinterfacesRoutes `json:"routes,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserver interfaces +func (m *CienaWaveserverInterfacesWaveserverInterfaces) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLogicalInterface(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhysicalInterface(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRoutes(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverInterfaces) validateLogicalInterface(formats strfmt.Registry) error { + + if swag.IsZero(m.LogicalInterface) { // not required + return nil + } + + for i := 0; i < len(m.LogicalInterface); i++ { + if swag.IsZero(m.LogicalInterface[i]) { // not required + continue + } + + if m.LogicalInterface[i] != nil { + if err := m.LogicalInterface[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("logical-interface" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverInterfaces) validatePhysicalInterface(formats strfmt.Registry) error { + + if swag.IsZero(m.PhysicalInterface) { // not required + return nil + } + + for i := 0; i < len(m.PhysicalInterface); i++ { + if swag.IsZero(m.PhysicalInterface[i]) { // not required + continue + } + + if m.PhysicalInterface[i] != nil { + if err := m.PhysicalInterface[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("physical-interface" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverInterfaces) validateRoutes(formats strfmt.Registry) error { + + if swag.IsZero(m.Routes) { // not required + return nil + } + + if m.Routes != nil { + if err := m.Routes.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("routes") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverInterfaces) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverInterfaces) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverInterfaces + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserver_interfaces_wrapper.go b/waveserver/models/ciena_waveserver_interfaces_waveserver_interfaces_wrapper.go new file mode 100644 index 0000000000000000000000000000000000000000..a7f988fe9c16d4e15176f7973758c4237e03e90a --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserver_interfaces_wrapper.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverInterfacesWrapper ciena waveserver interfaces waveserver interfaces wrapper +// +// swagger:model ciena.waveserver.interfaces.WaveserverInterfacesWrapper +type CienaWaveserverInterfacesWaveserverInterfacesWrapper struct { + + // waveserver interfaces + WaveserverInterfaces *CienaWaveserverInterfacesWaveserverInterfaces `json:"waveserver-interfaces,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserver interfaces wrapper +func (m *CienaWaveserverInterfacesWaveserverInterfacesWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateWaveserverInterfaces(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverInterfacesWrapper) validateWaveserverInterfaces(formats strfmt.Registry) error { + + if swag.IsZero(m.WaveserverInterfaces) { // not required + return nil + } + + if m.WaveserverInterfaces != nil { + if err := m.WaveserverInterfaces.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("waveserver-interfaces") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverInterfacesWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverInterfacesWrapper) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverInterfacesWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logical_interface.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logical_interface.go new file mode 100644 index 0000000000000000000000000000000000000000..a5180cc9d44edb7bf4d71d3cdcebbac25443232b --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logical_interface.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesLogicalInterface ciena waveserver interfaces waveserverinterfaces logical interface +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface +type CienaWaveserverInterfacesWaveserverinterfacesLogicalInterface struct { + + // Identification information of this logical management interface. + ID *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceID `json:"id,omitempty"` + + // References the system-assigned index of the logical interface. + Index int64 `json:"index,omitempty"` + + // All the configuration data of the logical management interface. + Properties *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceProperties `json:"properties,omitempty"` + + // Logical interface state information. + State *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceState `json:"state,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces logical interface +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalInterface) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProperties(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalInterface) validateID(formats strfmt.Registry) error { + + if swag.IsZero(m.ID) { // not required + return nil + } + + if m.ID != nil { + if err := m.ID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("id") + } + return err + } + } + + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalInterface) validateProperties(formats strfmt.Registry) error { + + if swag.IsZero(m.Properties) { // not required + return nil + } + + if m.Properties != nil { + if err := m.Properties.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("properties") + } + return err + } + } + + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalInterface) validateState(formats strfmt.Registry) error { + + if swag.IsZero(m.State) { // not required + return nil + } + + if m.State != nil { + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalInterface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalInterface) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesLogicalInterface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logical_interface_wrapper.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logical_interface_wrapper.go new file mode 100644 index 0000000000000000000000000000000000000000..96ab113811b4db0da6e20a273239b2de99dc1878 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logical_interface_wrapper.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceWrapper ciena waveserver interfaces waveserverinterfaces logical interface wrapper +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterfaceWrapper +type CienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceWrapper struct { + + // logical interface + LogicalInterface *CienaWaveserverInterfacesWaveserverinterfacesLogicalInterface `json:"logical-interface,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces logical interface wrapper +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLogicalInterface(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceWrapper) validateLogicalInterface(formats strfmt.Registry) error { + + if swag.IsZero(m.LogicalInterface) { // not required + return nil + } + + if m.LogicalInterface != nil { + if err := m.LogicalInterface.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("logical-interface") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceWrapper) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_id.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_id.go new file mode 100644 index 0000000000000000000000000000000000000000..a6f7dd400d08cf91b810ec53cd07e7e2d97f0b35 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_id.go @@ -0,0 +1,52 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceID ciena waveserver interfaces waveserverinterfaces logicalinterface Id +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id +type CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceID struct { + + // The system-assigned interface index number, corresponding to the + // ifIndex in SNMP IF-MIB. REF:RFC 2863 - The Interfaces Group MIB + Ifindex int64 `json:"ifindex,omitempty"` + + // The index of the logical management interface. Waveserver supports + // a single logical interface 'local' that is automatically created by + // the system. The default index is 1 for the 'local' interface. + Index int64 `json:"index,omitempty"` + + // The name of the logical management interface, e.g. 'local'. + Name string `json:"name,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces logicalinterface Id +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceID) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceID) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceID) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceID + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_id_wrapper.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_id_wrapper.go new file mode 100644 index 0000000000000000000000000000000000000000..dfef9246432e0e702e487b12536236cbb03c56fc --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_id_wrapper.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIDWrapper ciena waveserver interfaces waveserverinterfaces logicalinterface Id wrapper +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.IdWrapper +type CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIDWrapper struct { + + // id + ID *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceID `json:"id,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces logicalinterface Id wrapper +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIDWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIDWrapper) validateID(formats strfmt.Registry) error { + + if swag.IsZero(m.ID) { // not required + return nil + } + + if m.ID != nil { + if err := m.ID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("id") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIDWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIDWrapper) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIDWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_properties.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_properties.go new file mode 100644 index 0000000000000000000000000000000000000000..46866b7d9def7552608ca1ef31cb3db9ff15dcc3 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_properties.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceProperties ciena waveserver interfaces waveserverinterfaces logicalinterface properties +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties +type CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceProperties struct { + + // IPv4 configuration and operational data. + IPV4 *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4 `json:"ipv4,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces logicalinterface properties +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceProperties) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIPV4(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceProperties) validateIPV4(formats strfmt.Registry) error { + + if swag.IsZero(m.IPV4) { // not required + return nil + } + + if m.IPV4 != nil { + if err := m.IPV4.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipv4") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceProperties) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceProperties) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceProperties + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_properties_ip_v4.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_properties_ip_v4.go new file mode 100644 index 0000000000000000000000000000000000000000..00892ab9f27810a9ee32c8ac9148086bee5578d4 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_properties_ip_v4.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4 ciena waveserver interfaces waveserverinterfaces logicalinterface properties Ipv4 +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4 +type CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4 struct { + + // Whether IPv4 stack is enabled or disabled on this interface. + // Always enabled for the local management interface. + AdminState CienaWaveserverTypedefsEnabledDisabledEnum `json:"admin-state,omitempty"` + + // The Automatic Private IP Addressing (APIPA) assigned IPv4 address + // and prefix on the interface. + ApipaIPAddress string `json:"apipa-ip-address,omitempty"` + + // The user-configured backup IPv4 gateway on the interface. + BackupGateway string `json:"backup-gateway,omitempty"` + + // The DHCP-assigned IPv4 gateway on the interface. + DhcpGateway string `json:"dhcp-gateway,omitempty"` + + // The DHCP-assigned IPv4 address and prefix on the interface. + DhcpIPAddress string `json:"dhcp-ip-address,omitempty"` + + // The operational IPv4 gateway on the interface. + OperGateway string `json:"oper-gateway,omitempty"` + + // The operational IPv4 address and prefix on the interface. + OperIPAddress string `json:"oper-ip-address,omitempty"` + + // The user-configured primary IPv4 gateway on the interface. + UserGateway string `json:"user-gateway,omitempty"` + + // The user-configured IPv4 address and prefix on the interface. + UserIPAddress string `json:"user-ip-address,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces logicalinterface properties Ipv4 +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAdminState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4) validateAdminState(formats strfmt.Registry) error { + + if swag.IsZero(m.AdminState) { // not required + return nil + } + + if err := m.AdminState.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("admin-state") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_properties_ip_v4_wrapper.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_properties_ip_v4_wrapper.go new file mode 100644 index 0000000000000000000000000000000000000000..993b13fc45d8211a08dcfeeacfb704f6597b9276 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_properties_ip_v4_wrapper.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4Wrapper ciena waveserver interfaces waveserverinterfaces logicalinterface properties Ipv4 wrapper +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4Wrapper +type CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4Wrapper struct { + + // ipv4 + IPV4 *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4 `json:"ipv4,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces logicalinterface properties Ipv4 wrapper +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4Wrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIPV4(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4Wrapper) validateIPV4(formats strfmt.Registry) error { + + if swag.IsZero(m.IPV4) { // not required + return nil + } + + if m.IPV4 != nil { + if err := m.IPV4.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipv4") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4Wrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4Wrapper) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4Wrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_properties_wrapper.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_properties_wrapper.go new file mode 100644 index 0000000000000000000000000000000000000000..ba41ae966fe7aadb02d701becb48aa823099178d --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_properties_wrapper.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesWrapper ciena waveserver interfaces waveserverinterfaces logicalinterface properties wrapper +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.PropertiesWrapper +type CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesWrapper struct { + + // properties + Properties *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceProperties `json:"properties,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces logicalinterface properties wrapper +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateProperties(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesWrapper) validateProperties(formats strfmt.Registry) error { + + if swag.IsZero(m.Properties) { // not required + return nil + } + + if m.Properties != nil { + if err := m.Properties.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("properties") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesWrapper) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_state.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_state.go new file mode 100644 index 0000000000000000000000000000000000000000..d65363acf3dae2a58762940cc5ec92c8b5eaf4c4 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_state.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceState ciena waveserver interfaces waveserverinterfaces logicalinterface state +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State +type CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceState struct { + + // Whether Admin State is enabled or disabled for this management interface. + AdminState CienaWaveserverTypedefsEnabledDisabledEnum `json:"admin-state,omitempty"` + + // Operational state of this management interface. + OperationalState CienaWaveserverTypedefsUpDownEnum `json:"operational-state,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces logicalinterface state +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceState) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAdminState(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOperationalState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceState) validateAdminState(formats strfmt.Registry) error { + + if swag.IsZero(m.AdminState) { // not required + return nil + } + + if err := m.AdminState.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("admin-state") + } + return err + } + + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceState) validateOperationalState(formats strfmt.Registry) error { + + if swag.IsZero(m.OperationalState) { // not required + return nil + } + + if err := m.OperationalState.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("operational-state") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceState) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceState) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceState + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_state_wrapper.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_state_wrapper.go new file mode 100644 index 0000000000000000000000000000000000000000..6afd0823fa7368a1a7acceec396c3eac1edb305a --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_logicalinterface_state_wrapper.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateWrapper ciena waveserver interfaces waveserverinterfaces logicalinterface state wrapper +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.StateWrapper +type CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateWrapper struct { + + // state + State *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceState `json:"state,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces logicalinterface state wrapper +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateWrapper) validateState(formats strfmt.Registry) error { + + if swag.IsZero(m.State) { // not required + return nil + } + + if m.State != nil { + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateWrapper) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physical_interface.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physical_interface.go new file mode 100644 index 0000000000000000000000000000000000000000..fe7f3b75af48876519a115c798e898f52fd96634 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physical_interface.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterface ciena waveserver interfaces waveserverinterfaces physical interface +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface +type CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterface struct { + + // Identification information of this management interface. + ID *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceID `json:"id,omitempty"` + + // References the system-assigned name of the interface. + Name string `json:"name,omitempty"` + + // All the configuration data of the physical management interface. + Properties *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceProperties `json:"properties,omitempty"` + + // Physical management interface state information. + State *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceState `json:"state,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces physical interface +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterface) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProperties(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterface) validateID(formats strfmt.Registry) error { + + if swag.IsZero(m.ID) { // not required + return nil + } + + if m.ID != nil { + if err := m.ID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("id") + } + return err + } + } + + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterface) validateProperties(formats strfmt.Registry) error { + + if swag.IsZero(m.Properties) { // not required + return nil + } + + if m.Properties != nil { + if err := m.Properties.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("properties") + } + return err + } + } + + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterface) validateState(formats strfmt.Registry) error { + + if swag.IsZero(m.State) { // not required + return nil + } + + if m.State != nil { + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterface) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physical_interface_wrapper.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physical_interface_wrapper.go new file mode 100644 index 0000000000000000000000000000000000000000..f10a697eae5b694af96b575d7956b6bcb37e0115 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physical_interface_wrapper.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceWrapper ciena waveserver interfaces waveserverinterfaces physical interface wrapper +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterfaceWrapper +type CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceWrapper struct { + + // physical interface + PhysicalInterface *CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterface `json:"physical-interface,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces physical interface wrapper +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePhysicalInterface(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceWrapper) validatePhysicalInterface(formats strfmt.Registry) error { + + if swag.IsZero(m.PhysicalInterface) { // not required + return nil + } + + if m.PhysicalInterface != nil { + if err := m.PhysicalInterface.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("physical-interface") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceWrapper) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physicalinterface_id.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physicalinterface_id.go new file mode 100644 index 0000000000000000000000000000000000000000..4e33958579417d3e6bf1146cfa3a76a343eac00c --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physicalinterface_id.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceID ciena waveserver interfaces waveserverinterfaces physicalinterface Id +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id +type CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceID struct { + + // Physical interface description, e.g. 'Management'. + Description string `json:"description,omitempty"` + + // The system-assigned interface index number, corresponding to the + // ifIndex in SNMP IF-MIB. REF:RFC 2863 - The Interfaces Group MIB + Ifindex int64 `json:"ifindex,omitempty"` + + // The system-assigned name of the physical interface (e.g. DCN, + // ILAN-1, ILAN-2). The names are predefined. + Name string `json:"name,omitempty"` + + // Management port type. If the port is DCN, ILAN-1, or ILAN-2, the + // port type will be 'ethernet'. If the port is Console, the port + // type will be 'serial'. REF:RFC 2863 - The Interfaces Group MIB + Type CienaWaveserverInterfacesTypeEnumeration `json:"type,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces physicalinterface Id +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceID) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceID) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceID) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceID) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceID + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physicalinterface_id_wrapper.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physicalinterface_id_wrapper.go new file mode 100644 index 0000000000000000000000000000000000000000..297a5763d8cec71f4762d6e70ad39b0a2df53827 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physicalinterface_id_wrapper.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIDWrapper ciena waveserver interfaces waveserverinterfaces physicalinterface Id wrapper +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.IdWrapper +type CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIDWrapper struct { + + // id + ID *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceID `json:"id,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces physicalinterface Id wrapper +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIDWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIDWrapper) validateID(formats strfmt.Registry) error { + + if swag.IsZero(m.ID) { // not required + return nil + } + + if m.ID != nil { + if err := m.ID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("id") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIDWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIDWrapper) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIDWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physicalinterface_properties.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physicalinterface_properties.go new file mode 100644 index 0000000000000000000000000000000000000000..593b15e65ad9736ed4d3e96e8ba4082598b6b657 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physicalinterface_properties.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceProperties ciena waveserver interfaces waveserverinterfaces physicalinterface properties +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties +type CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceProperties struct { + + // Ethernet interface attributes. + Ethernet *CienaWaveserverInterfacesEthernetIfPropertiesGroup `json:"ethernet,omitempty"` + + // Management interface attributes. + Management *CienaWaveserverInterfacesManagementIfPropertiesGroup `json:"management,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces physicalinterface properties +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceProperties) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEthernet(formats); err != nil { + res = append(res, err) + } + + if err := m.validateManagement(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceProperties) validateEthernet(formats strfmt.Registry) error { + + if swag.IsZero(m.Ethernet) { // not required + return nil + } + + if m.Ethernet != nil { + if err := m.Ethernet.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ethernet") + } + return err + } + } + + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceProperties) validateManagement(formats strfmt.Registry) error { + + if swag.IsZero(m.Management) { // not required + return nil + } + + if m.Management != nil { + if err := m.Management.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("management") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceProperties) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceProperties) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceProperties + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physicalinterface_properties_wrapper.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physicalinterface_properties_wrapper.go new file mode 100644 index 0000000000000000000000000000000000000000..9b3d899fd3b066efa16a7bd783975621ee0dfc22 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physicalinterface_properties_wrapper.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesWrapper ciena waveserver interfaces waveserverinterfaces physicalinterface properties wrapper +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.PropertiesWrapper +type CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesWrapper struct { + + // properties + Properties *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceProperties `json:"properties,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces physicalinterface properties wrapper +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateProperties(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesWrapper) validateProperties(formats strfmt.Registry) error { + + if swag.IsZero(m.Properties) { // not required + return nil + } + + if m.Properties != nil { + if err := m.Properties.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("properties") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesWrapper) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physicalinterface_state.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physicalinterface_state.go new file mode 100644 index 0000000000000000000000000000000000000000..0318571837852d109efa00e7c819c415dd04c57f --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physicalinterface_state.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceState ciena waveserver interfaces waveserverinterfaces physicalinterface state +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State +type CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceState struct { + + // Whether Admin State is enabled or disabled for this management interface. + AdminState CienaWaveserverTypedefsEnabledDisabledEnum `json:"admin-state,omitempty"` + + // Operational state of this management interface. + OperationalState CienaWaveserverTypedefsUpDownEnum `json:"operational-state,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces physicalinterface state +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceState) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAdminState(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOperationalState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceState) validateAdminState(formats strfmt.Registry) error { + + if swag.IsZero(m.AdminState) { // not required + return nil + } + + if err := m.AdminState.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("admin-state") + } + return err + } + + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceState) validateOperationalState(formats strfmt.Registry) error { + + if swag.IsZero(m.OperationalState) { // not required + return nil + } + + if err := m.OperationalState.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("operational-state") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceState) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceState) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceState + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physicalinterface_state_wrapper.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physicalinterface_state_wrapper.go new file mode 100644 index 0000000000000000000000000000000000000000..de66599e7390ea46945dd4b601d5ed5355214d0e --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_physicalinterface_state_wrapper.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateWrapper ciena waveserver interfaces waveserverinterfaces physicalinterface state wrapper +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.StateWrapper +type CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateWrapper struct { + + // state + State *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceState `json:"state,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces physicalinterface state wrapper +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateWrapper) validateState(formats strfmt.Registry) error { + + if swag.IsZero(m.State) { // not required + return nil + } + + if m.State != nil { + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateWrapper) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes.go new file mode 100644 index 0000000000000000000000000000000000000000..ff569d7585e0f6125a4166f679e941cf59f285b7 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes.go @@ -0,0 +1,80 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesRoutes ciena waveserver interfaces waveserverinterfaces routes +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.Routes +type CienaWaveserverInterfacesWaveserverinterfacesRoutes struct { + + // List of IPv4 static routing entries. + IPV4StaticRoute []*CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRoute `json:"ipv4-static-route"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces routes +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIPV4StaticRoute(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutes) validateIPV4StaticRoute(formats strfmt.Registry) error { + + if swag.IsZero(m.IPV4StaticRoute) { // not required + return nil + } + + for i := 0; i < len(m.IPV4StaticRoute); i++ { + if swag.IsZero(m.IPV4StaticRoute[i]) { // not required + continue + } + + if m.IPV4StaticRoute[i] != nil { + if err := m.IPV4StaticRoute[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipv4-static-route" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutes) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesRoutes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes_ip_v4_static_route.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes_ip_v4_static_route.go new file mode 100644 index 0000000000000000000000000000000000000000..5b80eeada7a3b24d979b4105220d11c417ec5656 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes_ip_v4_static_route.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRoute ciena waveserver interfaces waveserverinterfaces routes Ipv4 static route +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute +type CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRoute struct { + + // IPv4 route destination prefix for the static route. Only one static + // routing entry per unique destination ip/prefix can be configured. + Destination string `json:"destination,omitempty"` + + // A list of next-hop entries associated with the static route. + NextHop []*CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHop `json:"next-hop"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces routes Ipv4 static route +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRoute) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateNextHop(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRoute) validateNextHop(formats strfmt.Registry) error { + + if swag.IsZero(m.NextHop) { // not required + return nil + } + + for i := 0; i < len(m.NextHop); i++ { + if swag.IsZero(m.NextHop[i]) { // not required + continue + } + + if m.NextHop[i] != nil { + if err := m.NextHop[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("next-hop" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRoute) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRoute) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRoute + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes_ip_v4_static_route_wrapper.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes_ip_v4_static_route_wrapper.go new file mode 100644 index 0000000000000000000000000000000000000000..611143fa12a5a6d399544f40627c6a8e1b6eba43 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes_ip_v4_static_route_wrapper.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRouteWrapper ciena waveserver interfaces waveserverinterfaces routes Ipv4 static route wrapper +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRouteWrapper +type CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRouteWrapper struct { + + // ipv4 static route + IPV4StaticRoute *CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRoute `json:"ipv4-static-route,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces routes Ipv4 static route wrapper +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRouteWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIPV4StaticRoute(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRouteWrapper) validateIPV4StaticRoute(formats strfmt.Registry) error { + + if swag.IsZero(m.IPV4StaticRoute) { // not required + return nil + } + + if m.IPV4StaticRoute != nil { + if err := m.IPV4StaticRoute.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipv4-static-route") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRouteWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRouteWrapper) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRouteWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes_ipv4staticroute_next_hop.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes_ipv4staticroute_next_hop.go new file mode 100644 index 0000000000000000000000000000000000000000..dee864820d8c8240c549c7814ce211a2540c5e42 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes_ipv4staticroute_next_hop.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHop ciena waveserver interfaces waveserverinterfaces routes ipv4staticroute next hop +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop +type CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHop struct { + CienaWaveserverInterfacesRouteNextHopGroup + + CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopAllOf1 +} + +// UnmarshalJSON unmarshals this object from a JSON structure +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHop) UnmarshalJSON(raw []byte) error { + // AO0 + var aO0 CienaWaveserverInterfacesRouteNextHopGroup + if err := swag.ReadJSON(raw, &aO0); err != nil { + return err + } + m.CienaWaveserverInterfacesRouteNextHopGroup = aO0 + + // AO1 + var aO1 CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopAllOf1 + if err := swag.ReadJSON(raw, &aO1); err != nil { + return err + } + m.CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopAllOf1 = aO1 + + return nil +} + +// MarshalJSON marshals this object to a JSON structure +func (m CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHop) MarshalJSON() ([]byte, error) { + _parts := make([][]byte, 0, 2) + + aO0, err := swag.WriteJSON(m.CienaWaveserverInterfacesRouteNextHopGroup) + if err != nil { + return nil, err + } + _parts = append(_parts, aO0) + + aO1, err := swag.WriteJSON(m.CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopAllOf1) + if err != nil { + return nil, err + } + _parts = append(_parts, aO1) + return swag.ConcatJSON(_parts...), nil +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces routes ipv4staticroute next hop +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHop) Validate(formats strfmt.Registry) error { + var res []error + + // validation for a type composition with CienaWaveserverInterfacesRouteNextHopGroup + if err := m.CienaWaveserverInterfacesRouteNextHopGroup.Validate(formats); err != nil { + res = append(res, err) + } + // validation for a type composition with CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopAllOf1 + if err := m.CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopAllOf1.Validate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHop) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHop) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHop + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes_ipv4staticroute_next_hop_all_of1.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes_ipv4staticroute_next_hop_all_of1.go new file mode 100644 index 0000000000000000000000000000000000000000..590da40778c4cee6ad68f1f210daa50652c8cb90 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes_ipv4staticroute_next_hop_all_of1.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopAllOf1 A list of next-hop entries associated with the static route. +// +// swagger:model cienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopAllOf1 +type CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopAllOf1 struct { + + // The index key of the entry in the next-hop list. Currently only + // one static entry is supported per destination prefix, so the + // index should always be 1. + Index int64 `json:"index,omitempty"` + + // IPv4 route next-hop or gateway address associated with the route. If + // not specified, the default gateway value for the local management + // interface will be used. + IPAddress string `json:"ip-address,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces routes ipv4staticroute next hop all of1 +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopAllOf1) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopAllOf1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopAllOf1) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopAllOf1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes_ipv4staticroute_next_hop_wrapper.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes_ipv4staticroute_next_hop_wrapper.go new file mode 100644 index 0000000000000000000000000000000000000000..610c94fd60dcf8ac8d212b48a91d4b20ee1b99e1 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes_ipv4staticroute_next_hop_wrapper.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopWrapper ciena waveserver interfaces waveserverinterfaces routes ipv4staticroute next hop wrapper +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHopWrapper +type CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopWrapper struct { + + // next hop + NextHop *CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHop `json:"next-hop,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces routes ipv4staticroute next hop wrapper +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateNextHop(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopWrapper) validateNextHop(formats strfmt.Registry) error { + + if swag.IsZero(m.NextHop) { // not required + return nil + } + + if m.NextHop != nil { + if err := m.NextHop.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("next-hop") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopWrapper) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes_wrapper.go b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes_wrapper.go new file mode 100644 index 0000000000000000000000000000000000000000..da3a1572119bbbbe18006d74fbe84126bc49b906 --- /dev/null +++ b/waveserver/models/ciena_waveserver_interfaces_waveserverinterfaces_routes_wrapper.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CienaWaveserverInterfacesWaveserverinterfacesRoutesWrapper ciena waveserver interfaces waveserverinterfaces routes wrapper +// +// swagger:model ciena.waveserver.interfaces.waveserverinterfaces.RoutesWrapper +type CienaWaveserverInterfacesWaveserverinterfacesRoutesWrapper struct { + + // routes + Routes *CienaWaveserverInterfacesWaveserverinterfacesRoutes `json:"routes,omitempty"` +} + +// Validate validates this ciena waveserver interfaces waveserverinterfaces routes wrapper +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesWrapper) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRoutes(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesWrapper) validateRoutes(formats strfmt.Registry) error { + + if swag.IsZero(m.Routes) { // not required + return nil + } + + if m.Routes != nil { + if err := m.Routes.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("routes") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesWrapper) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CienaWaveserverInterfacesWaveserverinterfacesRoutesWrapper) UnmarshalBinary(b []byte) error { + var res CienaWaveserverInterfacesWaveserverinterfacesRoutesWrapper + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/waveserver/models/ciena_waveserver_typedefs_enabled_disabled_enum.go b/waveserver/models/ciena_waveserver_typedefs_enabled_disabled_enum.go new file mode 100644 index 0000000000000000000000000000000000000000..6c97b01f2b64a4b138219903257409a22817ea83 --- /dev/null +++ b/waveserver/models/ciena_waveserver_typedefs_enabled_disabled_enum.go @@ -0,0 +1,63 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// CienaWaveserverTypedefsEnabledDisabledEnum ciena waveserver typedefs enabled disabled enum +// +// swagger:model ciena.waveserver.typedefs.EnabledDisabledEnum +type CienaWaveserverTypedefsEnabledDisabledEnum string + +const ( + + // CienaWaveserverTypedefsEnabledDisabledEnumDisabled captures enum value "disabled" + CienaWaveserverTypedefsEnabledDisabledEnumDisabled CienaWaveserverTypedefsEnabledDisabledEnum = "disabled" + + // CienaWaveserverTypedefsEnabledDisabledEnumEnabled captures enum value "enabled" + CienaWaveserverTypedefsEnabledDisabledEnumEnabled CienaWaveserverTypedefsEnabledDisabledEnum = "enabled" +) + +// for schema +var cienaWaveserverTypedefsEnabledDisabledEnumEnum []interface{} + +func init() { + var res []CienaWaveserverTypedefsEnabledDisabledEnum + if err := json.Unmarshal([]byte(`["disabled","enabled"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + cienaWaveserverTypedefsEnabledDisabledEnumEnum = append(cienaWaveserverTypedefsEnabledDisabledEnumEnum, v) + } +} + +func (m CienaWaveserverTypedefsEnabledDisabledEnum) validateCienaWaveserverTypedefsEnabledDisabledEnumEnum(path, location string, value CienaWaveserverTypedefsEnabledDisabledEnum) error { + if err := validate.EnumCase(path, location, value, cienaWaveserverTypedefsEnabledDisabledEnumEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this ciena waveserver typedefs enabled disabled enum +func (m CienaWaveserverTypedefsEnabledDisabledEnum) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateCienaWaveserverTypedefsEnabledDisabledEnumEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/waveserver/models/ciena_waveserver_typedefs_up_down_enum.go b/waveserver/models/ciena_waveserver_typedefs_up_down_enum.go new file mode 100644 index 0000000000000000000000000000000000000000..1aa82eda80621cb7adae4ac28109a0bee961c213 --- /dev/null +++ b/waveserver/models/ciena_waveserver_typedefs_up_down_enum.go @@ -0,0 +1,63 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// CienaWaveserverTypedefsUpDownEnum ciena waveserver typedefs up down enum +// +// swagger:model ciena.waveserver.typedefs.UpDownEnum +type CienaWaveserverTypedefsUpDownEnum string + +const ( + + // CienaWaveserverTypedefsUpDownEnumDown captures enum value "down" + CienaWaveserverTypedefsUpDownEnumDown CienaWaveserverTypedefsUpDownEnum = "down" + + // CienaWaveserverTypedefsUpDownEnumUp captures enum value "up" + CienaWaveserverTypedefsUpDownEnumUp CienaWaveserverTypedefsUpDownEnum = "up" +) + +// for schema +var cienaWaveserverTypedefsUpDownEnumEnum []interface{} + +func init() { + var res []CienaWaveserverTypedefsUpDownEnum + if err := json.Unmarshal([]byte(`["down","up"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + cienaWaveserverTypedefsUpDownEnumEnum = append(cienaWaveserverTypedefsUpDownEnumEnum, v) + } +} + +func (m CienaWaveserverTypedefsUpDownEnum) validateCienaWaveserverTypedefsUpDownEnumEnum(path, location string, value CienaWaveserverTypedefsUpDownEnum) error { + if err := validate.EnumCase(path, location, value, cienaWaveserverTypedefsUpDownEnumEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this ciena waveserver typedefs up down enum +func (m CienaWaveserverTypedefsUpDownEnum) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateCienaWaveserverTypedefsUpDownEnumEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/waveserver/restapi/configure_cocsn.go b/waveserver/restapi/configure_cocsn.go new file mode 100644 index 0000000000000000000000000000000000000000..c780745f30f5f366cdb5007efe28d6409e7240f0 --- /dev/null +++ b/waveserver/restapi/configure_cocsn.go @@ -0,0 +1,371 @@ +// This file is safe to edit. Once it exists it will not be overwritten + +package restapi + +import ( + "crypto/tls" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/restapi/operations" + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/restapi/operations/ciena_waveserver_interfaces" +) + +//go:generate swagger generate server --target ../../waveserver --name Cocsn --spec ../ws-if.yml --principal interface{} + +func configureFlags(api *operations.CocsnAPI) { + // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } +} + +func configureAPI(api *operations.CocsnAPI) http.Handler { + // configure the api here + api.ServeError = errors.ServeError + + // Set your custom logger if needed. Default one is log.Printf + // Expected interface func(string, ...interface{}) + // + // Example: + // api.Logger = log.Printf + + api.UseSwaggerUI() + // To continue using redoc as your UI, uncomment the following line + // api.UseRedoc() + + api.JSONConsumer = runtime.JSONConsumer() + + api.JSONProducer = runtime.JSONProducer() + + if api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesHandler == nil { + api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesHandler = ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfaces has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexHandler == nil { + api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexHandler = ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndex has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexIDHandler == nil { + api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexIDHandler = ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexID has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler == nil { + api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler = ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexProperties has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler == nil { + api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler = ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexStateHandler == nil { + api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexStateHandler = ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexState has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameHandler == nil { + api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameHandler = ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceName has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameIDHandler == nil { + api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameIDHandler = ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameID has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler == nil { + api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler = ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameProperties has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler == nil { + api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler = ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler == nil { + api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler = ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameStateHandler == nil { + api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameStateHandler = ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameState has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesHandler == nil { + api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesHandler = ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutes has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler == nil { + api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler = ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestination has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler == nil { + api.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler = ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesGetDataWaveserverInterfacesHandler == nil { + api.CienaWaveserverInterfacesGetDataWaveserverInterfacesHandler = ciena_waveserver_interfaces.GetDataWaveserverInterfacesHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfaces has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexHandler == nil { + api.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexHandler = ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndex has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexIDHandler == nil { + api.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexIDHandler = ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexID has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler == nil { + api.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler = ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexProperties has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler == nil { + api.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler = ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexStateHandler == nil { + api.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexStateHandler = ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexState has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameHandler == nil { + api.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameHandler = ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceName has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameIDHandler == nil { + api.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameIDHandler = ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameID has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler == nil { + api.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler = ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameProperties has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler == nil { + api.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler = ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler == nil { + api.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler = ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameStateHandler == nil { + api.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameStateHandler = ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameState has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesHandler == nil { + api.CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesHandler = ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutes has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler == nil { + api.CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler = ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestination has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler == nil { + api.CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler = ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPostDataWaveserverInterfacesHandler == nil { + api.CienaWaveserverInterfacesPostDataWaveserverInterfacesHandler = ciena_waveserver_interfaces.PostDataWaveserverInterfacesHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfaces has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceHandler == nil { + api.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceHandler = ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterface has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexIDHandler == nil { + api.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexIDHandler = ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexID has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler == nil { + api.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler = ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexProperties has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler == nil { + api.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler = ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexStateHandler == nil { + api.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexStateHandler = ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexState has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceHandler == nil { + api.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceHandler = ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterface has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNameIDHandler == nil { + api.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNameIDHandler = ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNameID has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler == nil { + api.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler = ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNameProperties has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler == nil { + api.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler = ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler == nil { + api.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler = ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNameStateHandler == nil { + api.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNameStateHandler = ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNameState has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesHandler == nil { + api.CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesHandler = ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutes has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesIPV4StaticRouteHandler == nil { + api.CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesIPV4StaticRouteHandler = ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesIPV4StaticRouteHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesIPV4StaticRouteParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesIPV4StaticRoute has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopHandler == nil { + api.CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopHandler = ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHop has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPutDataWaveserverInterfacesHandler == nil { + api.CienaWaveserverInterfacesPutDataWaveserverInterfacesHandler = ciena_waveserver_interfaces.PutDataWaveserverInterfacesHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfaces has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexHandler == nil { + api.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexHandler = ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndex has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexIDHandler == nil { + api.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexIDHandler = ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexID has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler == nil { + api.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler = ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexProperties has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler == nil { + api.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler = ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexStateHandler == nil { + api.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexStateHandler = ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexState has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameHandler == nil { + api.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameHandler = ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceName has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameIDHandler == nil { + api.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameIDHandler = ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameID has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler == nil { + api.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler = ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameProperties has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler == nil { + api.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler = ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler == nil { + api.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler = ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameStateHandler == nil { + api.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameStateHandler = ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameState has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesHandler == nil { + api.CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesHandler = ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutes has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler == nil { + api.CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler = ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestination has not yet been implemented") + }) + } + if api.CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler == nil { + api.CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler = ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex has not yet been implemented") + }) + } + + api.PreServerShutdown = func() {} + + api.ServerShutdown = func() {} + + return setupGlobalMiddleware(api.Serve(setupMiddlewares)) +} + +// The TLS configuration before HTTPS server starts. +func configureTLS(tlsConfig *tls.Config) { + // Make all necessary changes to the TLS configuration here. +} + +// As soon as server is initialized but not run yet, this function will be called. +// If you need to modify a config, store server instance to stop it individually later, this is the place. +// This function can be called multiple times, depending on the number of serving schemes. +// scheme value will be set accordingly: "http", "https" or "unix" +func configureServer(s *http.Server, scheme, addr string) { +} + +// The middleware configuration is for the handler executors. These do not apply to the swagger.json document. +// The middleware executes after routing but before authentication, binding and validation +func setupMiddlewares(handler http.Handler) http.Handler { + return handler +} + +// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document. +// So this is a good place to plug in a panic handling middleware, logging and metrics +func setupGlobalMiddleware(handler http.Handler) http.Handler { + return handler +} diff --git a/waveserver/restapi/doc.go b/waveserver/restapi/doc.go new file mode 100644 index 0000000000000000000000000000000000000000..7618b2ef9984ee5747149812a9d6d621770c8cf9 --- /dev/null +++ b/waveserver/restapi/doc.go @@ -0,0 +1,20 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Package restapi ciena-waveserver-interfaces API +// +// This module defines Ethernet and IP management interfaces support for +// Ciena's Waveserver Platform. +// Schemes: +// http +// Host: localhost:1234 +// BasePath: / +// Version: 1.0 +// +// Consumes: +// - application/yang-data+json +// +// Produces: +// - application/yang-data+json +// +// swagger:meta +package restapi diff --git a/waveserver/restapi/embedded_spec.go b/waveserver/restapi/embedded_spec.go new file mode 100644 index 0000000000000000000000000000000000000000..3fc1f466bf289ab17b25da00e2667786a7f3fd8b --- /dev/null +++ b/waveserver/restapi/embedded_spec.go @@ -0,0 +1,4604 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package restapi + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" +) + +var ( + // SwaggerJSON embedded version of the swagger document used at generation time + SwaggerJSON json.RawMessage + // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time + FlatSwaggerJSON json.RawMessage +) + +func init() { + SwaggerJSON = json.RawMessage([]byte(`{ + "consumes": [ + "application/yang-data+json" + ], + "produces": [ + "application/yang-data+json" + ], + "swagger": "2.0", + "info": { + "description": "This module defines Ethernet and IP management interfaces support for\n Ciena's Waveserver Platform.", + "title": "ciena-waveserver-interfaces API", + "version": "1.0" + }, + "host": "localhost:1234", + "paths": { + "/data/waveserver-interfaces/": { + "get": { + "description": "Top level container for configuration and operational data for physical\n and logical network interfaces.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.WaveserverInterfaces", + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.WaveserverInterfaces", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.WaveserverInterfacesWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "Top level container for configuration and operational data for physical\n and logical network interfaces.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.WaveserverInterfaces", + "parameters": [ + { + "description": "ciena.waveserver.interfaces.WaveserverInterfaces to be added or updated", + "name": "ciena.waveserver.interfaces.WaveserverInterfaces.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.WaveserverInterfacesWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "Top level container for configuration and operational data for physical\n and logical network interfaces.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.WaveserverInterfaces", + "parameters": [ + { + "description": "ciena.waveserver.interfaces.WaveserverInterfaces to be added to list", + "name": "ciena.waveserver.interfaces.WaveserverInterfaces.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.WaveserverInterfacesWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "Top level container for configuration and operational data for physical\n and logical network interfaces.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.WaveserverInterfaces", + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/logical-interface/": { + "post": { + "description": "List of logical IP management interfaces (e.g. 'local').", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface", + "parameters": [ + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterfaceWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + } + }, + "/data/waveserver-interfaces/logical-interface={index}/": { + "get": { + "description": "List of logical IP management interfaces (e.g. 'local').", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterfaceWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "List of logical IP management interfaces (e.g. 'local').", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterfaceWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "delete": { + "description": "List of logical IP management interfaces (e.g. 'local').", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/logical-interface={index}/id/": { + "get": { + "description": "Identification information of this logical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.IdWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "Identification information of this logical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.IdWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "Identification information of this logical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.IdWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "Identification information of this logical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/logical-interface={index}/properties/": { + "get": { + "description": "All the configuration data of the logical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.PropertiesWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "All the configuration data of the logical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.PropertiesWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "All the configuration data of the logical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.PropertiesWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "All the configuration data of the logical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/logical-interface={index}/properties/ipv4/": { + "get": { + "description": "IPv4 configuration and operational data.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4Wrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "IPv4 configuration and operational data.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4 to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4Wrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "IPv4 configuration and operational data.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4 to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4Wrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "IPv4 configuration and operational data.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/logical-interface={index}/state/": { + "get": { + "description": "Logical interface state information.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.StateWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "Logical interface state information.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.StateWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "Logical interface state information.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.StateWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "Logical interface state information.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/physical-interface/": { + "post": { + "description": "List of physical Ethernet management interfaces.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface", + "parameters": [ + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterfaceWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + } + }, + "/data/waveserver-interfaces/physical-interface={name}/": { + "get": { + "description": "List of physical Ethernet management interfaces.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterfaceWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "List of physical Ethernet management interfaces.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterfaceWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "delete": { + "description": "List of physical Ethernet management interfaces.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/physical-interface={name}/id/": { + "get": { + "description": "Identification information of this management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.IdWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "Identification information of this management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.IdWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "Identification information of this management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.IdWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "Identification information of this management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/physical-interface={name}/properties/": { + "get": { + "description": "All the configuration data of the physical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.PropertiesWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "All the configuration data of the physical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.PropertiesWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "All the configuration data of the physical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.PropertiesWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "All the configuration data of the physical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/physical-interface={name}/properties/ethernet/": { + "get": { + "description": "Ethernet interface attributes.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.EthernetIfPropertiesGroup", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.EthernetIfPropertiesGroup", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.EthernetIfPropertiesGroupWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "Ethernet interface attributes.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.EthernetIfPropertiesGroup", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.EthernetIfPropertiesGroup to be added or updated", + "name": "ciena.waveserver.interfaces.EthernetIfPropertiesGroup.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.EthernetIfPropertiesGroupWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "Ethernet interface attributes.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.EthernetIfPropertiesGroup", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.EthernetIfPropertiesGroup to be added to list", + "name": "ciena.waveserver.interfaces.EthernetIfPropertiesGroup.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.EthernetIfPropertiesGroupWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "Ethernet interface attributes.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.EthernetIfPropertiesGroup", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/physical-interface={name}/properties/management/": { + "get": { + "description": "Management interface attributes.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.ManagementIfPropertiesGroup", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.ManagementIfPropertiesGroup", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.ManagementIfPropertiesGroupWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "Management interface attributes.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.ManagementIfPropertiesGroup", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.ManagementIfPropertiesGroup to be added or updated", + "name": "ciena.waveserver.interfaces.ManagementIfPropertiesGroup.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.ManagementIfPropertiesGroupWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "Management interface attributes.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.ManagementIfPropertiesGroup", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.ManagementIfPropertiesGroup to be added to list", + "name": "ciena.waveserver.interfaces.ManagementIfPropertiesGroup.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.ManagementIfPropertiesGroupWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "Management interface attributes.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.ManagementIfPropertiesGroup", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/physical-interface={name}/state/": { + "get": { + "description": "Physical management interface state information.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.StateWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "Physical management interface state information.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.StateWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "Physical management interface state information.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.StateWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "Physical management interface state information.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/routes/": { + "get": { + "description": "Top-level container for IP route configuration and operational data.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.Routes", + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.Routes", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.RoutesWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "Top-level container for IP route configuration and operational data.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.Routes", + "parameters": [ + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.Routes to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.Routes.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.RoutesWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "Top-level container for IP route configuration and operational data.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.Routes", + "parameters": [ + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.Routes to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.Routes.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.RoutesWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "Top-level container for IP route configuration and operational data.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.Routes", + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/routes/ipv4-static-route/": { + "post": { + "description": "List of IPv4 static routing entries.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute", + "parameters": [ + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRouteWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + } + }, + "/data/waveserver-interfaces/routes/ipv4-static-route={destination}/": { + "get": { + "description": "List of IPv4 static routing entries.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute", + "parameters": [ + { + "type": "string", + "description": "Id of ipv4-static-route", + "name": "destination", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRouteWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "List of IPv4 static routing entries.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute", + "parameters": [ + { + "type": "string", + "description": "Id of ipv4-static-route", + "name": "destination", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRouteWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "delete": { + "description": "List of IPv4 static routing entries.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute", + "parameters": [ + { + "type": "string", + "description": "Id of ipv4-static-route", + "name": "destination", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/routes/ipv4-static-route={destination}/next-hop/": { + "post": { + "description": "A list of next-hop entries associated with the static route.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop", + "parameters": [ + { + "type": "string", + "description": "Id of ipv4-static-route", + "name": "destination", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHopWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + } + }, + "/data/waveserver-interfaces/routes/ipv4-static-route={destination}/next-hop={index}/": { + "get": { + "description": "A list of next-hop entries associated with the static route.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop", + "parameters": [ + { + "type": "string", + "description": "Id of ipv4-static-route", + "name": "destination", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "Id of next-hop", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHopWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "A list of next-hop entries associated with the static route.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop", + "parameters": [ + { + "type": "string", + "description": "Id of ipv4-static-route", + "name": "destination", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "Id of next-hop", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHopWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "delete": { + "description": "A list of next-hop entries associated with the static route.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop", + "parameters": [ + { + "type": "string", + "description": "Id of ipv4-static-route", + "name": "destination", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "Id of next-hop", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + } + }, + "definitions": { + "ciena.waveserver.interfaces.DuplexEnumeration": { + "type": "string", + "enum": [ + "Unknown", + "full", + "half" + ] + }, + "ciena.waveserver.interfaces.EthernetIfPropertiesGroup": { + "type": "object", + "properties": { + "auto-negotiation": { + "description": "Specifies whether the interface should negotiate common transmission\n parameters, such as speed, duplex, and flow control with its peer. REF:IEEE 802.3-2012 auto-negotiation transmission parameters", + "type": "boolean", + "default": false + }, + "duplex": { + "description": "Ethernet interface duplex mode. For ports with auto-negotiation enabled,\n this represents the negotiated duplex mode.", + "$ref": "#/definitions/ciena.waveserver.interfaces.DuplexEnumeration" + }, + "flow-control": { + "description": "Specifies whether this interface will participate in Ethernet flow\n control, via pause frames.", + "type": "boolean", + "default": false + }, + "mac-address": { + "description": "The system-assigned MAC address of the Ethernet interface.", + "type": "string" + }, + "speed": { + "description": "Ethernet port speed. For ports with auto-negotiation enabled, this\n represents the negotiated port speed.", + "$ref": "#/definitions/ciena.waveserver.interfaces.SpeedEnumeration" + } + } + }, + "ciena.waveserver.interfaces.EthernetIfPropertiesGroupWrapper": { + "properties": { + "ethernet": { + "$ref": "#/definitions/ciena.waveserver.interfaces.EthernetIfPropertiesGroup" + } + } + }, + "ciena.waveserver.interfaces.ManagementIfPropertiesGroup": { + "type": "object", + "properties": { + "mode": { + "description": "Management port mode. Specifies whether the port is configured as a\n local management interface or wayside communications channel (carry\n through).", + "$ref": "#/definitions/ciena.waveserver.interfaces.ModeEnumeration" + } + } + }, + "ciena.waveserver.interfaces.ManagementIfPropertiesGroupWrapper": { + "properties": { + "management": { + "$ref": "#/definitions/ciena.waveserver.interfaces.ManagementIfPropertiesGroup" + } + } + }, + "ciena.waveserver.interfaces.ModeEnumeration": { + "type": "string", + "enum": [ + "management", + "wayside-channel" + ] + }, + "ciena.waveserver.interfaces.RouteNextHopGroup": { + "type": "object", + "properties": { + "active": { + "description": "Specifies whether the route is active (present in the kernel IP\n routing table).", + "type": "boolean", + "default": false + }, + "associated-interface": { + "description": "Reference to the associated logical-interface name of the route entry.\n Defaults to the 'local' interface for routes within the subnet\n associated with the active IP address configured on the local\n management interface.", + "type": "string" + }, + "metric": { + "description": "Routing metric cost.", + "type": "integer", + "format": "int64", + "default": 0 + }, + "static": { + "description": "Specifies whether the route entry is user-created (static) or\n dynamically created by a routing protocol.", + "type": "boolean", + "default": false + } + } + }, + "ciena.waveserver.interfaces.SpeedEnumeration": { + "type": "string", + "enum": [ + "Unknown", + "10M", + "100M", + "1G", + "10G" + ] + }, + "ciena.waveserver.interfaces.TypeEnumeration": { + "type": "string", + "enum": [ + "ethernet", + "serial" + ] + }, + "ciena.waveserver.interfaces.WaveserverInterfaces": { + "type": "object", + "properties": { + "logical-interface": { + "description": "List of logical IP management interfaces (e.g. 'local').", + "type": "array", + "items": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface" + } + }, + "physical-interface": { + "description": "List of physical Ethernet management interfaces.", + "type": "array", + "items": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface" + } + }, + "routes": { + "description": "Top-level container for IP route configuration and operational data.", + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.Routes" + } + } + }, + "ciena.waveserver.interfaces.WaveserverInterfacesWrapper": { + "properties": { + "waveserver-interfaces": { + "$ref": "#/definitions/ciena.waveserver.interfaces.WaveserverInterfaces" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface": { + "type": "object", + "properties": { + "id": { + "description": "Identification information of this logical management interface.", + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id" + }, + "index": { + "description": "References the system-assigned index of the logical interface.", + "type": "integer", + "format": "int64", + "x-path": "../id/index" + }, + "properties": { + "description": "All the configuration data of the logical management interface.", + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties" + }, + "state": { + "description": "Logical interface state information.", + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterfaceWrapper": { + "properties": { + "logical-interface": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface": { + "type": "object", + "properties": { + "id": { + "description": "Identification information of this management interface.", + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id" + }, + "name": { + "description": "References the system-assigned name of the interface.", + "type": "string", + "x-path": "../id/name" + }, + "properties": { + "description": "All the configuration data of the physical management interface.", + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties" + }, + "state": { + "description": "Physical management interface state information.", + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterfaceWrapper": { + "properties": { + "physical-interface": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.Routes": { + "type": "object", + "properties": { + "ipv4-static-route": { + "description": "List of IPv4 static routing entries.", + "type": "array", + "items": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute" + } + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.RoutesWrapper": { + "properties": { + "routes": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.Routes" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id": { + "type": "object", + "properties": { + "ifindex": { + "description": "The system-assigned interface index number, corresponding to the\n ifIndex in SNMP IF-MIB. REF:RFC 2863 - The Interfaces Group MIB", + "type": "integer", + "format": "int64" + }, + "index": { + "description": "The index of the logical management interface. Waveserver supports\n a single logical interface 'local' that is automatically created by\n the system. The default index is 1 for the 'local' interface.", + "type": "integer", + "format": "int64" + }, + "name": { + "description": "The name of the logical management interface, e.g. 'local'.", + "type": "string" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.IdWrapper": { + "properties": { + "id": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties": { + "type": "object", + "properties": { + "ipv4": { + "description": "IPv4 configuration and operational data.", + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.PropertiesWrapper": { + "properties": { + "properties": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State": { + "type": "object", + "properties": { + "admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface.", + "$ref": "#/definitions/ciena.waveserver.typedefs.EnabledDisabledEnum" + }, + "operational-state": { + "description": "Operational state of this management interface.", + "$ref": "#/definitions/ciena.waveserver.typedefs.UpDownEnum" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.StateWrapper": { + "properties": { + "state": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4": { + "type": "object", + "properties": { + "admin-state": { + "description": "Whether IPv4 stack is enabled or disabled on this interface.\n Always enabled for the local management interface.", + "$ref": "#/definitions/ciena.waveserver.typedefs.EnabledDisabledEnum" + }, + "apipa-ip-address": { + "description": "The Automatic Private IP Addressing (APIPA) assigned IPv4 address\n and prefix on the interface.", + "type": "string" + }, + "backup-gateway": { + "description": "The user-configured backup IPv4 gateway on the interface.", + "type": "string" + }, + "dhcp-gateway": { + "description": "The DHCP-assigned IPv4 gateway on the interface.", + "type": "string" + }, + "dhcp-ip-address": { + "description": "The DHCP-assigned IPv4 address and prefix on the interface.", + "type": "string" + }, + "oper-gateway": { + "description": "The operational IPv4 gateway on the interface.", + "type": "string" + }, + "oper-ip-address": { + "description": "The operational IPv4 address and prefix on the interface.", + "type": "string" + }, + "user-gateway": { + "description": "The user-configured primary IPv4 gateway on the interface.", + "type": "string" + }, + "user-ip-address": { + "description": "The user-configured IPv4 address and prefix on the interface.", + "type": "string" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4Wrapper": { + "properties": { + "ipv4": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id": { + "type": "object", + "properties": { + "description": { + "description": "Physical interface description, e.g. 'Management'.", + "type": "string" + }, + "ifindex": { + "description": "The system-assigned interface index number, corresponding to the\n ifIndex in SNMP IF-MIB. REF:RFC 2863 - The Interfaces Group MIB", + "type": "integer", + "format": "int64" + }, + "name": { + "description": "The system-assigned name of the physical interface (e.g. DCN,\n ILAN-1, ILAN-2). The names are predefined.", + "type": "string" + }, + "type": { + "description": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\n port type will be 'ethernet'. If the port is Console, the port\n type will be 'serial'. REF:RFC 2863 - The Interfaces Group MIB", + "$ref": "#/definitions/ciena.waveserver.interfaces.TypeEnumeration" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.IdWrapper": { + "properties": { + "id": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties": { + "type": "object", + "properties": { + "ethernet": { + "description": "Ethernet interface attributes.", + "$ref": "#/definitions/ciena.waveserver.interfaces.EthernetIfPropertiesGroup" + }, + "management": { + "description": "Management interface attributes.", + "$ref": "#/definitions/ciena.waveserver.interfaces.ManagementIfPropertiesGroup" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.PropertiesWrapper": { + "properties": { + "properties": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State": { + "type": "object", + "properties": { + "admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface.", + "$ref": "#/definitions/ciena.waveserver.typedefs.EnabledDisabledEnum" + }, + "operational-state": { + "description": "Operational state of this management interface.", + "$ref": "#/definitions/ciena.waveserver.typedefs.UpDownEnum" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.StateWrapper": { + "properties": { + "state": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute": { + "type": "object", + "properties": { + "destination": { + "description": "IPv4 route destination prefix for the static route. Only one static\n routing entry per unique destination ip/prefix can be configured.", + "type": "string" + }, + "next-hop": { + "description": "A list of next-hop entries associated with the static route.", + "type": "array", + "items": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop" + } + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRouteWrapper": { + "properties": { + "ipv4-static-route": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop": { + "allOf": [ + { + "$ref": "#/definitions/ciena.waveserver.interfaces.RouteNextHopGroup" + }, + { + "description": "A list of next-hop entries associated with the static route.", + "type": "object", + "properties": { + "index": { + "description": "The index key of the entry in the next-hop list. Currently only\n one static entry is supported per destination prefix, so the\n index should always be 1.", + "type": "integer", + "format": "int64" + }, + "ip-address": { + "description": "IPv4 route next-hop or gateway address associated with the route. If\n not specified, the default gateway value for the local management\n interface will be used.", + "type": "string" + } + } + } + ] + }, + "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHopWrapper": { + "properties": { + "next-hop": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop" + } + } + }, + "ciena.waveserver.typedefs.EnabledDisabledEnum": { + "type": "string", + "enum": [ + "disabled", + "enabled" + ] + }, + "ciena.waveserver.typedefs.UpDownEnum": { + "type": "string", + "enum": [ + "down", + "up" + ] + } + } +}`)) + FlatSwaggerJSON = json.RawMessage([]byte(`{ + "consumes": [ + "application/yang-data+json" + ], + "produces": [ + "application/yang-data+json" + ], + "swagger": "2.0", + "info": { + "description": "This module defines Ethernet and IP management interfaces support for\n Ciena's Waveserver Platform.", + "title": "ciena-waveserver-interfaces API", + "version": "1.0" + }, + "host": "localhost:1234", + "paths": { + "/data/waveserver-interfaces/": { + "get": { + "description": "Top level container for configuration and operational data for physical\n and logical network interfaces.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.WaveserverInterfaces", + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.WaveserverInterfaces", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.WaveserverInterfacesWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "Top level container for configuration and operational data for physical\n and logical network interfaces.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.WaveserverInterfaces", + "parameters": [ + { + "description": "ciena.waveserver.interfaces.WaveserverInterfaces to be added or updated", + "name": "ciena.waveserver.interfaces.WaveserverInterfaces.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.WaveserverInterfacesWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "Top level container for configuration and operational data for physical\n and logical network interfaces.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.WaveserverInterfaces", + "parameters": [ + { + "description": "ciena.waveserver.interfaces.WaveserverInterfaces to be added to list", + "name": "ciena.waveserver.interfaces.WaveserverInterfaces.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.WaveserverInterfacesWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "Top level container for configuration and operational data for physical\n and logical network interfaces.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.WaveserverInterfaces", + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/logical-interface/": { + "post": { + "description": "List of logical IP management interfaces (e.g. 'local').", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface", + "parameters": [ + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterfaceWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + } + }, + "/data/waveserver-interfaces/logical-interface={index}/": { + "get": { + "description": "List of logical IP management interfaces (e.g. 'local').", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterfaceWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "List of logical IP management interfaces (e.g. 'local').", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterfaceWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "delete": { + "description": "List of logical IP management interfaces (e.g. 'local').", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/logical-interface={index}/id/": { + "get": { + "description": "Identification information of this logical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.IdWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "Identification information of this logical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.IdWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "Identification information of this logical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.IdWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "Identification information of this logical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/logical-interface={index}/properties/": { + "get": { + "description": "All the configuration data of the logical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.PropertiesWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "All the configuration data of the logical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.PropertiesWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "All the configuration data of the logical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.PropertiesWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "All the configuration data of the logical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/logical-interface={index}/properties/ipv4/": { + "get": { + "description": "IPv4 configuration and operational data.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4Wrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "IPv4 configuration and operational data.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4 to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4Wrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "IPv4 configuration and operational data.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4 to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4Wrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "IPv4 configuration and operational data.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/logical-interface={index}/state/": { + "get": { + "description": "Logical interface state information.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.StateWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "Logical interface state information.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.StateWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "Logical interface state information.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.StateWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "Logical interface state information.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State", + "parameters": [ + { + "type": "integer", + "format": "int64", + "description": "Id of logical-interface", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/physical-interface/": { + "post": { + "description": "List of physical Ethernet management interfaces.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface", + "parameters": [ + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterfaceWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + } + }, + "/data/waveserver-interfaces/physical-interface={name}/": { + "get": { + "description": "List of physical Ethernet management interfaces.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterfaceWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "List of physical Ethernet management interfaces.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterfaceWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "delete": { + "description": "List of physical Ethernet management interfaces.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/physical-interface={name}/id/": { + "get": { + "description": "Identification information of this management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.IdWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "Identification information of this management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.IdWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "Identification information of this management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.IdWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "Identification information of this management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/physical-interface={name}/properties/": { + "get": { + "description": "All the configuration data of the physical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.PropertiesWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "All the configuration data of the physical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.PropertiesWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "All the configuration data of the physical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.PropertiesWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "All the configuration data of the physical management interface.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/physical-interface={name}/properties/ethernet/": { + "get": { + "description": "Ethernet interface attributes.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.EthernetIfPropertiesGroup", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.EthernetIfPropertiesGroup", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.EthernetIfPropertiesGroupWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "Ethernet interface attributes.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.EthernetIfPropertiesGroup", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.EthernetIfPropertiesGroup to be added or updated", + "name": "ciena.waveserver.interfaces.EthernetIfPropertiesGroup.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.EthernetIfPropertiesGroupWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "Ethernet interface attributes.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.EthernetIfPropertiesGroup", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.EthernetIfPropertiesGroup to be added to list", + "name": "ciena.waveserver.interfaces.EthernetIfPropertiesGroup.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.EthernetIfPropertiesGroupWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "Ethernet interface attributes.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.EthernetIfPropertiesGroup", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/physical-interface={name}/properties/management/": { + "get": { + "description": "Management interface attributes.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.ManagementIfPropertiesGroup", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.ManagementIfPropertiesGroup", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.ManagementIfPropertiesGroupWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "Management interface attributes.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.ManagementIfPropertiesGroup", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.ManagementIfPropertiesGroup to be added or updated", + "name": "ciena.waveserver.interfaces.ManagementIfPropertiesGroup.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.ManagementIfPropertiesGroupWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "Management interface attributes.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.ManagementIfPropertiesGroup", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.ManagementIfPropertiesGroup to be added to list", + "name": "ciena.waveserver.interfaces.ManagementIfPropertiesGroup.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.ManagementIfPropertiesGroupWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "Management interface attributes.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.ManagementIfPropertiesGroup", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/physical-interface={name}/state/": { + "get": { + "description": "Physical management interface state information.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.StateWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "Physical management interface state information.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.StateWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "Physical management interface state information.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.StateWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "Physical management interface state information.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State", + "parameters": [ + { + "type": "string", + "description": "Id of physical-interface", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/routes/": { + "get": { + "description": "Top-level container for IP route configuration and operational data.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.Routes", + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.Routes", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.RoutesWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "Top-level container for IP route configuration and operational data.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.Routes", + "parameters": [ + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.Routes to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.Routes.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.RoutesWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "post": { + "description": "Top-level container for IP route configuration and operational data.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.Routes", + "parameters": [ + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.Routes to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.Routes.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.RoutesWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + }, + "delete": { + "description": "Top-level container for IP route configuration and operational data.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.Routes", + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/routes/ipv4-static-route/": { + "post": { + "description": "List of IPv4 static routing entries.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute", + "parameters": [ + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRouteWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + } + }, + "/data/waveserver-interfaces/routes/ipv4-static-route={destination}/": { + "get": { + "description": "List of IPv4 static routing entries.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute", + "parameters": [ + { + "type": "string", + "description": "Id of ipv4-static-route", + "name": "destination", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRouteWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "List of IPv4 static routing entries.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute", + "parameters": [ + { + "type": "string", + "description": "Id of ipv4-static-route", + "name": "destination", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRouteWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "delete": { + "description": "List of IPv4 static routing entries.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute", + "parameters": [ + { + "type": "string", + "description": "Id of ipv4-static-route", + "name": "destination", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + }, + "/data/waveserver-interfaces/routes/ipv4-static-route={destination}/next-hop/": { + "post": { + "description": "A list of next-hop entries associated with the static route.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop", + "parameters": [ + { + "type": "string", + "description": "Id of ipv4-static-route", + "name": "destination", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop to be added to list", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHopWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "400": { + "description": "Internal error" + }, + "409": { + "description": "Object already exists" + } + } + } + }, + "/data/waveserver-interfaces/routes/ipv4-static-route={destination}/next-hop={index}/": { + "get": { + "description": "A list of next-hop entries associated with the static route.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "returns ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop", + "parameters": [ + { + "type": "string", + "description": "Id of ipv4-static-route", + "name": "destination", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "Id of next-hop", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHopWrapper" + } + }, + "400": { + "description": "Internal error" + } + } + }, + "put": { + "description": "A list of next-hop entries associated with the static route.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop", + "parameters": [ + { + "type": "string", + "description": "Id of ipv4-static-route", + "name": "destination", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "Id of next-hop", + "name": "index", + "in": "path", + "required": true + }, + { + "description": "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop to be added or updated", + "name": "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop.body-param", + "in": "body", + "schema": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHopWrapper" + } + } + ], + "responses": { + "201": { + "description": "Object created" + }, + "204": { + "description": "Object modified" + }, + "400": { + "description": "Internal error" + } + } + }, + "delete": { + "description": "A list of next-hop entries associated with the static route.", + "tags": [ + "ciena-waveserver-interfaces" + ], + "summary": "removes ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop", + "parameters": [ + { + "type": "string", + "description": "Id of ipv4-static-route", + "name": "destination", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "Id of next-hop", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Object deleted" + }, + "400": { + "description": "Internal error" + } + } + } + } + }, + "definitions": { + "ciena.waveserver.interfaces.DuplexEnumeration": { + "type": "string", + "enum": [ + "Unknown", + "full", + "half" + ] + }, + "ciena.waveserver.interfaces.EthernetIfPropertiesGroup": { + "type": "object", + "properties": { + "auto-negotiation": { + "description": "Specifies whether the interface should negotiate common transmission\n parameters, such as speed, duplex, and flow control with its peer. REF:IEEE 802.3-2012 auto-negotiation transmission parameters", + "type": "boolean", + "default": false + }, + "duplex": { + "description": "Ethernet interface duplex mode. For ports with auto-negotiation enabled,\n this represents the negotiated duplex mode.", + "$ref": "#/definitions/ciena.waveserver.interfaces.DuplexEnumeration" + }, + "flow-control": { + "description": "Specifies whether this interface will participate in Ethernet flow\n control, via pause frames.", + "type": "boolean", + "default": false + }, + "mac-address": { + "description": "The system-assigned MAC address of the Ethernet interface.", + "type": "string" + }, + "speed": { + "description": "Ethernet port speed. For ports with auto-negotiation enabled, this\n represents the negotiated port speed.", + "$ref": "#/definitions/ciena.waveserver.interfaces.SpeedEnumeration" + } + } + }, + "ciena.waveserver.interfaces.EthernetIfPropertiesGroupWrapper": { + "properties": { + "ethernet": { + "$ref": "#/definitions/ciena.waveserver.interfaces.EthernetIfPropertiesGroup" + } + } + }, + "ciena.waveserver.interfaces.ManagementIfPropertiesGroup": { + "type": "object", + "properties": { + "mode": { + "description": "Management port mode. Specifies whether the port is configured as a\n local management interface or wayside communications channel (carry\n through).", + "$ref": "#/definitions/ciena.waveserver.interfaces.ModeEnumeration" + } + } + }, + "ciena.waveserver.interfaces.ManagementIfPropertiesGroupWrapper": { + "properties": { + "management": { + "$ref": "#/definitions/ciena.waveserver.interfaces.ManagementIfPropertiesGroup" + } + } + }, + "ciena.waveserver.interfaces.ModeEnumeration": { + "type": "string", + "enum": [ + "management", + "wayside-channel" + ] + }, + "ciena.waveserver.interfaces.RouteNextHopGroup": { + "type": "object", + "properties": { + "active": { + "description": "Specifies whether the route is active (present in the kernel IP\n routing table).", + "type": "boolean", + "default": false + }, + "associated-interface": { + "description": "Reference to the associated logical-interface name of the route entry.\n Defaults to the 'local' interface for routes within the subnet\n associated with the active IP address configured on the local\n management interface.", + "type": "string" + }, + "metric": { + "description": "Routing metric cost.", + "type": "integer", + "format": "int64", + "default": 0 + }, + "static": { + "description": "Specifies whether the route entry is user-created (static) or\n dynamically created by a routing protocol.", + "type": "boolean", + "default": false + } + } + }, + "ciena.waveserver.interfaces.SpeedEnumeration": { + "type": "string", + "enum": [ + "Unknown", + "10M", + "100M", + "1G", + "10G" + ] + }, + "ciena.waveserver.interfaces.TypeEnumeration": { + "type": "string", + "enum": [ + "ethernet", + "serial" + ] + }, + "ciena.waveserver.interfaces.WaveserverInterfaces": { + "type": "object", + "properties": { + "logical-interface": { + "description": "List of logical IP management interfaces (e.g. 'local').", + "type": "array", + "items": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface" + } + }, + "physical-interface": { + "description": "List of physical Ethernet management interfaces.", + "type": "array", + "items": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface" + } + }, + "routes": { + "description": "Top-level container for IP route configuration and operational data.", + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.Routes" + } + } + }, + "ciena.waveserver.interfaces.WaveserverInterfacesWrapper": { + "properties": { + "waveserver-interfaces": { + "$ref": "#/definitions/ciena.waveserver.interfaces.WaveserverInterfaces" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface": { + "type": "object", + "properties": { + "id": { + "description": "Identification information of this logical management interface.", + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id" + }, + "index": { + "description": "References the system-assigned index of the logical interface.", + "type": "integer", + "format": "int64", + "x-path": "../id/index" + }, + "properties": { + "description": "All the configuration data of the logical management interface.", + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties" + }, + "state": { + "description": "Logical interface state information.", + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterfaceWrapper": { + "properties": { + "logical-interface": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface": { + "type": "object", + "properties": { + "id": { + "description": "Identification information of this management interface.", + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id" + }, + "name": { + "description": "References the system-assigned name of the interface.", + "type": "string", + "x-path": "../id/name" + }, + "properties": { + "description": "All the configuration data of the physical management interface.", + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties" + }, + "state": { + "description": "Physical management interface state information.", + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterfaceWrapper": { + "properties": { + "physical-interface": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.Routes": { + "type": "object", + "properties": { + "ipv4-static-route": { + "description": "List of IPv4 static routing entries.", + "type": "array", + "items": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute" + } + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.RoutesWrapper": { + "properties": { + "routes": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.Routes" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id": { + "type": "object", + "properties": { + "ifindex": { + "description": "The system-assigned interface index number, corresponding to the\n ifIndex in SNMP IF-MIB. REF:RFC 2863 - The Interfaces Group MIB", + "type": "integer", + "format": "int64" + }, + "index": { + "description": "The index of the logical management interface. Waveserver supports\n a single logical interface 'local' that is automatically created by\n the system. The default index is 1 for the 'local' interface.", + "type": "integer", + "format": "int64" + }, + "name": { + "description": "The name of the logical management interface, e.g. 'local'.", + "type": "string" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.IdWrapper": { + "properties": { + "id": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties": { + "type": "object", + "properties": { + "ipv4": { + "description": "IPv4 configuration and operational data.", + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.PropertiesWrapper": { + "properties": { + "properties": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State": { + "type": "object", + "properties": { + "admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface.", + "$ref": "#/definitions/ciena.waveserver.typedefs.EnabledDisabledEnum" + }, + "operational-state": { + "description": "Operational state of this management interface.", + "$ref": "#/definitions/ciena.waveserver.typedefs.UpDownEnum" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.StateWrapper": { + "properties": { + "state": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4": { + "type": "object", + "properties": { + "admin-state": { + "description": "Whether IPv4 stack is enabled or disabled on this interface.\n Always enabled for the local management interface.", + "$ref": "#/definitions/ciena.waveserver.typedefs.EnabledDisabledEnum" + }, + "apipa-ip-address": { + "description": "The Automatic Private IP Addressing (APIPA) assigned IPv4 address\n and prefix on the interface.", + "type": "string" + }, + "backup-gateway": { + "description": "The user-configured backup IPv4 gateway on the interface.", + "type": "string" + }, + "dhcp-gateway": { + "description": "The DHCP-assigned IPv4 gateway on the interface.", + "type": "string" + }, + "dhcp-ip-address": { + "description": "The DHCP-assigned IPv4 address and prefix on the interface.", + "type": "string" + }, + "oper-gateway": { + "description": "The operational IPv4 gateway on the interface.", + "type": "string" + }, + "oper-ip-address": { + "description": "The operational IPv4 address and prefix on the interface.", + "type": "string" + }, + "user-gateway": { + "description": "The user-configured primary IPv4 gateway on the interface.", + "type": "string" + }, + "user-ip-address": { + "description": "The user-configured IPv4 address and prefix on the interface.", + "type": "string" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4Wrapper": { + "properties": { + "ipv4": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id": { + "type": "object", + "properties": { + "description": { + "description": "Physical interface description, e.g. 'Management'.", + "type": "string" + }, + "ifindex": { + "description": "The system-assigned interface index number, corresponding to the\n ifIndex in SNMP IF-MIB. REF:RFC 2863 - The Interfaces Group MIB", + "type": "integer", + "format": "int64" + }, + "name": { + "description": "The system-assigned name of the physical interface (e.g. DCN,\n ILAN-1, ILAN-2). The names are predefined.", + "type": "string" + }, + "type": { + "description": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\n port type will be 'ethernet'. If the port is Console, the port\n type will be 'serial'. REF:RFC 2863 - The Interfaces Group MIB", + "$ref": "#/definitions/ciena.waveserver.interfaces.TypeEnumeration" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.IdWrapper": { + "properties": { + "id": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties": { + "type": "object", + "properties": { + "ethernet": { + "description": "Ethernet interface attributes.", + "$ref": "#/definitions/ciena.waveserver.interfaces.EthernetIfPropertiesGroup" + }, + "management": { + "description": "Management interface attributes.", + "$ref": "#/definitions/ciena.waveserver.interfaces.ManagementIfPropertiesGroup" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.PropertiesWrapper": { + "properties": { + "properties": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State": { + "type": "object", + "properties": { + "admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface.", + "$ref": "#/definitions/ciena.waveserver.typedefs.EnabledDisabledEnum" + }, + "operational-state": { + "description": "Operational state of this management interface.", + "$ref": "#/definitions/ciena.waveserver.typedefs.UpDownEnum" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.StateWrapper": { + "properties": { + "state": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute": { + "type": "object", + "properties": { + "destination": { + "description": "IPv4 route destination prefix for the static route. Only one static\n routing entry per unique destination ip/prefix can be configured.", + "type": "string" + }, + "next-hop": { + "description": "A list of next-hop entries associated with the static route.", + "type": "array", + "items": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop" + } + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRouteWrapper": { + "properties": { + "ipv4-static-route": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute" + } + } + }, + "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop": { + "allOf": [ + { + "$ref": "#/definitions/ciena.waveserver.interfaces.RouteNextHopGroup" + }, + { + "$ref": "#/definitions/cienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopAllOf1" + } + ] + }, + "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHopWrapper": { + "properties": { + "next-hop": { + "$ref": "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop" + } + } + }, + "ciena.waveserver.typedefs.EnabledDisabledEnum": { + "type": "string", + "enum": [ + "disabled", + "enabled" + ] + }, + "ciena.waveserver.typedefs.UpDownEnum": { + "type": "string", + "enum": [ + "down", + "up" + ] + }, + "cienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopAllOf1": { + "description": "A list of next-hop entries associated with the static route.", + "type": "object", + "properties": { + "index": { + "description": "The index key of the entry in the next-hop list. Currently only\n one static entry is supported per destination prefix, so the\n index should always be 1.", + "type": "integer", + "format": "int64" + }, + "ip-address": { + "description": "IPv4 route next-hop or gateway address associated with the route. If\n not specified, the default gateway value for the local management\n interface will be used.", + "type": "string" + } + }, + "x-go-gen-location": "models" + } + } +}`)) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces.go new file mode 100644 index 0000000000000000000000000000000000000000..3d2ef05f0d35f4f478404495b844010030ee990a --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteDataWaveserverInterfacesHandlerFunc turns a function with the right signature into a delete data waveserver interfaces handler +type DeleteDataWaveserverInterfacesHandlerFunc func(DeleteDataWaveserverInterfacesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteDataWaveserverInterfacesHandlerFunc) Handle(params DeleteDataWaveserverInterfacesParams) middleware.Responder { + return fn(params) +} + +// DeleteDataWaveserverInterfacesHandler interface for that can handle valid delete data waveserver interfaces params +type DeleteDataWaveserverInterfacesHandler interface { + Handle(DeleteDataWaveserverInterfacesParams) middleware.Responder +} + +// NewDeleteDataWaveserverInterfaces creates a new http.Handler for the delete data waveserver interfaces operation +func NewDeleteDataWaveserverInterfaces(ctx *middleware.Context, handler DeleteDataWaveserverInterfacesHandler) *DeleteDataWaveserverInterfaces { + return &DeleteDataWaveserverInterfaces{Context: ctx, Handler: handler} +} + +/*DeleteDataWaveserverInterfaces swagger:route DELETE /data/waveserver-interfaces/ ciena-waveserver-interfaces deleteDataWaveserverInterfaces + +removes ciena.waveserver.interfaces.WaveserverInterfaces + +Top level container for configuration and operational data for physical + and logical network interfaces. + +*/ +type DeleteDataWaveserverInterfaces struct { + Context *middleware.Context + Handler DeleteDataWaveserverInterfacesHandler +} + +func (o *DeleteDataWaveserverInterfaces) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDeleteDataWaveserverInterfacesParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index.go new file mode 100644 index 0000000000000000000000000000000000000000..49a509e93b07382a5b58c23267b313be196b2c4f --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexHandlerFunc turns a function with the right signature into a delete data waveserver interfaces logical interface index handler +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexHandlerFunc func(DeleteDataWaveserverInterfacesLogicalInterfaceIndexParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteDataWaveserverInterfacesLogicalInterfaceIndexHandlerFunc) Handle(params DeleteDataWaveserverInterfacesLogicalInterfaceIndexParams) middleware.Responder { + return fn(params) +} + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexHandler interface for that can handle valid delete data waveserver interfaces logical interface index params +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexHandler interface { + Handle(DeleteDataWaveserverInterfacesLogicalInterfaceIndexParams) middleware.Responder +} + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndex creates a new http.Handler for the delete data waveserver interfaces logical interface index operation +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndex(ctx *middleware.Context, handler DeleteDataWaveserverInterfacesLogicalInterfaceIndexHandler) *DeleteDataWaveserverInterfacesLogicalInterfaceIndex { + return &DeleteDataWaveserverInterfacesLogicalInterfaceIndex{Context: ctx, Handler: handler} +} + +/*DeleteDataWaveserverInterfacesLogicalInterfaceIndex swagger:route DELETE /data/waveserver-interfaces/logical-interface={index}/ ciena-waveserver-interfaces deleteDataWaveserverInterfacesLogicalInterfaceIndex + +removes ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface + +List of logical IP management interfaces (e.g. 'local'). + +*/ +type DeleteDataWaveserverInterfacesLogicalInterfaceIndex struct { + Context *middleware.Context + Handler DeleteDataWaveserverInterfacesLogicalInterfaceIndexHandler +} + +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndex) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_id.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_id.go new file mode 100644 index 0000000000000000000000000000000000000000..fe7e5610f4e58c7da1e6cd20f074a4d04aa0d931 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_id.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc turns a function with the right signature into a delete data waveserver interfaces logical interface index ID handler +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc func(DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc) Handle(params DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder { + return fn(params) +} + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDHandler interface for that can handle valid delete data waveserver interfaces logical interface index ID params +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDHandler interface { + Handle(DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder +} + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexID creates a new http.Handler for the delete data waveserver interfaces logical interface index ID operation +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexID(ctx *middleware.Context, handler DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDHandler) *DeleteDataWaveserverInterfacesLogicalInterfaceIndexID { + return &DeleteDataWaveserverInterfacesLogicalInterfaceIndexID{Context: ctx, Handler: handler} +} + +/*DeleteDataWaveserverInterfacesLogicalInterfaceIndexID swagger:route DELETE /data/waveserver-interfaces/logical-interface={index}/id/ ciena-waveserver-interfaces deleteDataWaveserverInterfacesLogicalInterfaceIndexId + +removes ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id + +Identification information of this logical management interface. + +*/ +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexID struct { + Context *middleware.Context + Handler DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDHandler +} + +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexIDParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_id_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_id_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..74045109105610fc359e658df44a86cd612d972a --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_id_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexIDParams creates a new DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDParams object +// no default values defined in spec. +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexIDParams() DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDParams { + + return DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDParams{} +} + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDParams contains all the bound params for the delete data waveserver interfaces logical interface index ID operation +// typically these are obtained from a http.Request +// +// swagger:parameters DeleteDataWaveserverInterfacesLogicalInterfaceIndexID +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexIDParams() beforehand. +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDParams) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_id_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_id_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..88941a4d623c0a7e33bd322e4f4fa85d45c7cf12 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_id_responses.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDNoContentCode is the HTTP code returned for type DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDNoContent +const DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDNoContentCode int = 204 + +/*DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDNoContent Object deleted + +swagger:response deleteDataWaveserverInterfacesLogicalInterfaceIndexIdNoContent +*/ +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDNoContent struct { +} + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexIDNoContent creates DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDNoContent with default headers values +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexIDNoContent() *DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDNoContent { + + return &DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDNoContent{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequestCode is the HTTP code returned for type DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest +const DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequestCode int = 400 + +/*DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest Internal error + +swagger:response deleteDataWaveserverInterfacesLogicalInterfaceIndexIdBadRequest +*/ +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest struct { +} + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest creates DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest with default headers values +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest() *DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest { + + return &DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_id_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_id_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..385515657ac522beb04d638b63c203de2afa3aed --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_id_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDURL generates an URL for the delete data waveserver interfaces logical interface index ID operation +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDURL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDURL) WithBasePath(bp string) *DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/id/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0ac73aa924989432e7f75d929dea7bd24d6d9888 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexParams creates a new DeleteDataWaveserverInterfacesLogicalInterfaceIndexParams object +// no default values defined in spec. +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexParams() DeleteDataWaveserverInterfacesLogicalInterfaceIndexParams { + + return DeleteDataWaveserverInterfacesLogicalInterfaceIndexParams{} +} + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexParams contains all the bound params for the delete data waveserver interfaces logical interface index operation +// typically these are obtained from a http.Request +// +// swagger:parameters DeleteDataWaveserverInterfacesLogicalInterfaceIndex +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexParams() beforehand. +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexParams) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties.go new file mode 100644 index 0000000000000000000000000000000000000000..7a54d104a6f30af9e52faddb7303a2c256f6a3af --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc turns a function with the right signature into a delete data waveserver interfaces logical interface index properties handler +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc func(DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc) Handle(params DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder { + return fn(params) +} + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler interface for that can handle valid delete data waveserver interfaces logical interface index properties params +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler interface { + Handle(DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder +} + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexProperties creates a new http.Handler for the delete data waveserver interfaces logical interface index properties operation +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexProperties(ctx *middleware.Context, handler DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler) *DeleteDataWaveserverInterfacesLogicalInterfaceIndexProperties { + return &DeleteDataWaveserverInterfacesLogicalInterfaceIndexProperties{Context: ctx, Handler: handler} +} + +/*DeleteDataWaveserverInterfacesLogicalInterfaceIndexProperties swagger:route DELETE /data/waveserver-interfaces/logical-interface={index}/properties/ ciena-waveserver-interfaces deleteDataWaveserverInterfacesLogicalInterfaceIndexProperties + +removes ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties + +All the configuration data of the logical management interface. + +*/ +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexProperties struct { + Context *middleware.Context + Handler DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler +} + +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexProperties) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_ip_v4.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_ip_v4.go new file mode 100644 index 0000000000000000000000000000000000000000..81dd23953001f4b5a68e2d4057fa19faf6353a2d --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_ip_v4.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc turns a function with the right signature into a delete data waveserver interfaces logical interface index properties IP v4 handler +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc func(DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc) Handle(params DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder { + return fn(params) +} + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler interface for that can handle valid delete data waveserver interfaces logical interface index properties IP v4 params +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler interface { + Handle(DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder +} + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 creates a new http.Handler for the delete data waveserver interfaces logical interface index properties IP v4 operation +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4(ctx *middleware.Context, handler DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler) *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 { + return &DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4{Context: ctx, Handler: handler} +} + +/*DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 swagger:route DELETE /data/waveserver-interfaces/logical-interface={index}/properties/ipv4/ ciena-waveserver-interfaces deleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIpV4 + +removes ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4 + +IPv4 configuration and operational data. + +*/ +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 struct { + Context *middleware.Context + Handler DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler +} + +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..81c0f12660debe951cc9237bb44fb98b16462752 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params creates a new DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params object +// no default values defined in spec. +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params() DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params { + + return DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params{} +} + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params contains all the bound params for the delete data waveserver interfaces logical interface index properties IP v4 operation +// typically these are obtained from a http.Request +// +// swagger:parameters DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params() beforehand. +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e54c5117cf40a151d4965a25cbd244bc71caac6b --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_responses.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContentCode is the HTTP code returned for type DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContent +const DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContentCode int = 204 + +/*DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContent Object deleted + +swagger:response deleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIpV4NoContent +*/ +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContent struct { +} + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContent creates DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContent with default headers values +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContent() *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContent { + + return &DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContent{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequestCode is the HTTP code returned for type DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest +const DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequestCode int = 400 + +/*DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest Internal error + +swagger:response deleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIpV4BadRequest +*/ +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest struct { +} + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest creates DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest with default headers values +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest() *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest { + + return &DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..1eced62fbb2eedb562013fff5b701c8670f39c56 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL generates an URL for the delete data waveserver interfaces logical interface index properties IP v4 operation +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) WithBasePath(bp string) *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/properties/ipv4/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..040a2f1aeda74bd92c8ec1efa361e8a79c2bb1f9 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams creates a new DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams object +// no default values defined in spec. +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams() DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams { + + return DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams{} +} + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams contains all the bound params for the delete data waveserver interfaces logical interface index properties operation +// typically these are obtained from a http.Request +// +// swagger:parameters DeleteDataWaveserverInterfacesLogicalInterfaceIndexProperties +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams() beforehand. +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..0d1b812c4bf858a6ecd9492d18960e0c749039a8 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_responses.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContentCode is the HTTP code returned for type DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent +const DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContentCode int = 204 + +/*DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent Object deleted + +swagger:response deleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent +*/ +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent struct { +} + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent creates DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent with default headers values +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent() *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent { + + return &DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequestCode is the HTTP code returned for type DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest +const DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequestCode int = 400 + +/*DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest Internal error + +swagger:response deleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest +*/ +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest struct { +} + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest creates DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest with default headers values +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest() *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest { + + return &DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..2e13a5a0bf4ae83d0aee0caeac9ced9bf810d20c --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_properties_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL generates an URL for the delete data waveserver interfaces logical interface index properties operation +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) WithBasePath(bp string) *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/properties/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7b5e1b874cefd6c199b7ff918143cb7403190694 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_responses.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexNoContentCode is the HTTP code returned for type DeleteDataWaveserverInterfacesLogicalInterfaceIndexNoContent +const DeleteDataWaveserverInterfacesLogicalInterfaceIndexNoContentCode int = 204 + +/*DeleteDataWaveserverInterfacesLogicalInterfaceIndexNoContent Object deleted + +swagger:response deleteDataWaveserverInterfacesLogicalInterfaceIndexNoContent +*/ +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexNoContent struct { +} + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexNoContent creates DeleteDataWaveserverInterfacesLogicalInterfaceIndexNoContent with default headers values +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexNoContent() *DeleteDataWaveserverInterfacesLogicalInterfaceIndexNoContent { + + return &DeleteDataWaveserverInterfacesLogicalInterfaceIndexNoContent{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexBadRequestCode is the HTTP code returned for type DeleteDataWaveserverInterfacesLogicalInterfaceIndexBadRequest +const DeleteDataWaveserverInterfacesLogicalInterfaceIndexBadRequestCode int = 400 + +/*DeleteDataWaveserverInterfacesLogicalInterfaceIndexBadRequest Internal error + +swagger:response deleteDataWaveserverInterfacesLogicalInterfaceIndexBadRequest +*/ +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexBadRequest struct { +} + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexBadRequest creates DeleteDataWaveserverInterfacesLogicalInterfaceIndexBadRequest with default headers values +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexBadRequest() *DeleteDataWaveserverInterfacesLogicalInterfaceIndexBadRequest { + + return &DeleteDataWaveserverInterfacesLogicalInterfaceIndexBadRequest{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_state.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_state.go new file mode 100644 index 0000000000000000000000000000000000000000..24a148bc7d4c55ef03435b203901f89301ff7c5e --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_state.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc turns a function with the right signature into a delete data waveserver interfaces logical interface index state handler +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc func(DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc) Handle(params DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder { + return fn(params) +} + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateHandler interface for that can handle valid delete data waveserver interfaces logical interface index state params +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateHandler interface { + Handle(DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder +} + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexState creates a new http.Handler for the delete data waveserver interfaces logical interface index state operation +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexState(ctx *middleware.Context, handler DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateHandler) *DeleteDataWaveserverInterfacesLogicalInterfaceIndexState { + return &DeleteDataWaveserverInterfacesLogicalInterfaceIndexState{Context: ctx, Handler: handler} +} + +/*DeleteDataWaveserverInterfacesLogicalInterfaceIndexState swagger:route DELETE /data/waveserver-interfaces/logical-interface={index}/state/ ciena-waveserver-interfaces deleteDataWaveserverInterfacesLogicalInterfaceIndexState + +removes ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State + +Logical interface state information. + +*/ +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexState struct { + Context *middleware.Context + Handler DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateHandler +} + +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexState) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexStateParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_state_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_state_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..44eb357ea749c8721d47ceb2efb3f586963e8733 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_state_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexStateParams creates a new DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateParams object +// no default values defined in spec. +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexStateParams() DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateParams { + + return DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateParams{} +} + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateParams contains all the bound params for the delete data waveserver interfaces logical interface index state operation +// typically these are obtained from a http.Request +// +// swagger:parameters DeleteDataWaveserverInterfacesLogicalInterfaceIndexState +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexStateParams() beforehand. +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateParams) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_state_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_state_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..d9d7e7d328e54e22f673eabff1c3646dde9068c3 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_state_responses.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateNoContentCode is the HTTP code returned for type DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent +const DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateNoContentCode int = 204 + +/*DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent Object deleted + +swagger:response deleteDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent +*/ +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent struct { +} + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent creates DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent with default headers values +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent() *DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent { + + return &DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequestCode is the HTTP code returned for type DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest +const DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequestCode int = 400 + +/*DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest Internal error + +swagger:response deleteDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest +*/ +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest struct { +} + +// NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest creates DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest with default headers values +func NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest() *DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest { + + return &DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_state_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_state_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..ff5ccdfd378be696ab2bbd8f02ccdfa36ff05bd3 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_state_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateURL generates an URL for the delete data waveserver interfaces logical interface index state operation +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateURL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateURL) WithBasePath(bp string) *DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/state/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..c603bcd8f516d0c6de92efbef60f1f4dcc3792d0 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_logical_interface_index_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DeleteDataWaveserverInterfacesLogicalInterfaceIndexURL generates an URL for the delete data waveserver interfaces logical interface index operation +type DeleteDataWaveserverInterfacesLogicalInterfaceIndexURL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexURL) WithBasePath(bp string) *DeleteDataWaveserverInterfacesLogicalInterfaceIndexURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on DeleteDataWaveserverInterfacesLogicalInterfaceIndexURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteDataWaveserverInterfacesLogicalInterfaceIndexURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteDataWaveserverInterfacesLogicalInterfaceIndexURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteDataWaveserverInterfacesLogicalInterfaceIndexURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..565c813a2782e92e29eaef77318c093862d65d56 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_parameters.go @@ -0,0 +1,45 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewDeleteDataWaveserverInterfacesParams creates a new DeleteDataWaveserverInterfacesParams object +// no default values defined in spec. +func NewDeleteDataWaveserverInterfacesParams() DeleteDataWaveserverInterfacesParams { + + return DeleteDataWaveserverInterfacesParams{} +} + +// DeleteDataWaveserverInterfacesParams contains all the bound params for the delete data waveserver interfaces operation +// typically these are obtained from a http.Request +// +// swagger:parameters DeleteDataWaveserverInterfaces +type DeleteDataWaveserverInterfacesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteDataWaveserverInterfacesParams() beforehand. +func (o *DeleteDataWaveserverInterfacesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name.go new file mode 100644 index 0000000000000000000000000000000000000000..7292165fe4e53bc2483c500a553c246af1e83a1a --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNameHandlerFunc turns a function with the right signature into a delete data waveserver interfaces physical interface name handler +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameHandlerFunc func(DeleteDataWaveserverInterfacesPhysicalInterfaceNameParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteDataWaveserverInterfacesPhysicalInterfaceNameHandlerFunc) Handle(params DeleteDataWaveserverInterfacesPhysicalInterfaceNameParams) middleware.Responder { + return fn(params) +} + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNameHandler interface for that can handle valid delete data waveserver interfaces physical interface name params +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameHandler interface { + Handle(DeleteDataWaveserverInterfacesPhysicalInterfaceNameParams) middleware.Responder +} + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceName creates a new http.Handler for the delete data waveserver interfaces physical interface name operation +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceName(ctx *middleware.Context, handler DeleteDataWaveserverInterfacesPhysicalInterfaceNameHandler) *DeleteDataWaveserverInterfacesPhysicalInterfaceName { + return &DeleteDataWaveserverInterfacesPhysicalInterfaceName{Context: ctx, Handler: handler} +} + +/*DeleteDataWaveserverInterfacesPhysicalInterfaceName swagger:route DELETE /data/waveserver-interfaces/physical-interface={name}/ ciena-waveserver-interfaces deleteDataWaveserverInterfacesPhysicalInterfaceName + +removes ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface + +List of physical Ethernet management interfaces. + +*/ +type DeleteDataWaveserverInterfacesPhysicalInterfaceName struct { + Context *middleware.Context + Handler DeleteDataWaveserverInterfacesPhysicalInterfaceNameHandler +} + +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceName) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_id.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_id.go new file mode 100644 index 0000000000000000000000000000000000000000..2096b9e1bb5fbcd2eff21dcde520408f673b9fdc --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_id.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc turns a function with the right signature into a delete data waveserver interfaces physical interface name ID handler +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc func(DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc) Handle(params DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder { + return fn(params) +} + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDHandler interface for that can handle valid delete data waveserver interfaces physical interface name ID params +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDHandler interface { + Handle(DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder +} + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameID creates a new http.Handler for the delete data waveserver interfaces physical interface name ID operation +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameID(ctx *middleware.Context, handler DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDHandler) *DeleteDataWaveserverInterfacesPhysicalInterfaceNameID { + return &DeleteDataWaveserverInterfacesPhysicalInterfaceNameID{Context: ctx, Handler: handler} +} + +/*DeleteDataWaveserverInterfacesPhysicalInterfaceNameID swagger:route DELETE /data/waveserver-interfaces/physical-interface={name}/id/ ciena-waveserver-interfaces deleteDataWaveserverInterfacesPhysicalInterfaceNameId + +removes ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id + +Identification information of this management interface. + +*/ +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameID struct { + Context *middleware.Context + Handler DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDHandler +} + +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameIDParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_id_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_id_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..ac1f18ce5d7959b9f497d7e9cfa54e95d3b43d9c --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_id_parameters.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameIDParams creates a new DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDParams object +// no default values defined in spec. +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameIDParams() DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDParams { + + return DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDParams{} +} + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDParams contains all the bound params for the delete data waveserver interfaces physical interface name ID operation +// typically these are obtained from a http.Request +// +// swagger:parameters DeleteDataWaveserverInterfacesPhysicalInterfaceNameID +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameIDParams() beforehand. +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_id_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_id_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..448c69efb5d827b38b6f14d1a74c1027d64fdf88 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_id_responses.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDNoContentCode is the HTTP code returned for type DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDNoContent +const DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDNoContentCode int = 204 + +/*DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDNoContent Object deleted + +swagger:response deleteDataWaveserverInterfacesPhysicalInterfaceNameIdNoContent +*/ +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDNoContent struct { +} + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameIDNoContent creates DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDNoContent with default headers values +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameIDNoContent() *DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDNoContent { + + return &DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDNoContent{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequestCode is the HTTP code returned for type DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest +const DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequestCode int = 400 + +/*DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest Internal error + +swagger:response deleteDataWaveserverInterfacesPhysicalInterfaceNameIdBadRequest +*/ +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest struct { +} + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest creates DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest with default headers values +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest() *DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest { + + return &DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_id_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_id_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..215f268045ab352287fb852f0732726338f1de40 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_id_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDURL generates an URL for the delete data waveserver interfaces physical interface name ID operation +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDURL) WithBasePath(bp string) *DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/id/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..1db334cf5ffec7e4c068533fc5848fee9dbe6e0b --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_parameters.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameParams creates a new DeleteDataWaveserverInterfacesPhysicalInterfaceNameParams object +// no default values defined in spec. +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameParams() DeleteDataWaveserverInterfacesPhysicalInterfaceNameParams { + + return DeleteDataWaveserverInterfacesPhysicalInterfaceNameParams{} +} + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNameParams contains all the bound params for the delete data waveserver interfaces physical interface name operation +// typically these are obtained from a http.Request +// +// swagger:parameters DeleteDataWaveserverInterfacesPhysicalInterfaceName +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameParams() beforehand. +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties.go new file mode 100644 index 0000000000000000000000000000000000000000..2b85e58afba52f1fd7b2bdf448087f956e0a6bdf --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc turns a function with the right signature into a delete data waveserver interfaces physical interface name properties handler +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc func(DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc) Handle(params DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder { + return fn(params) +} + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler interface for that can handle valid delete data waveserver interfaces physical interface name properties params +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler interface { + Handle(DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder +} + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameProperties creates a new http.Handler for the delete data waveserver interfaces physical interface name properties operation +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameProperties(ctx *middleware.Context, handler DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler) *DeleteDataWaveserverInterfacesPhysicalInterfaceNameProperties { + return &DeleteDataWaveserverInterfacesPhysicalInterfaceNameProperties{Context: ctx, Handler: handler} +} + +/*DeleteDataWaveserverInterfacesPhysicalInterfaceNameProperties swagger:route DELETE /data/waveserver-interfaces/physical-interface={name}/properties/ ciena-waveserver-interfaces deleteDataWaveserverInterfacesPhysicalInterfaceNameProperties + +removes ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties + +All the configuration data of the physical management interface. + +*/ +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameProperties struct { + Context *middleware.Context + Handler DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler +} + +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameProperties) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_ethernet.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_ethernet.go new file mode 100644 index 0000000000000000000000000000000000000000..47d944255c916c8319b15d28ae97510e1373f61c --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_ethernet.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc turns a function with the right signature into a delete data waveserver interfaces physical interface name properties ethernet handler +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc func(DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc) Handle(params DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder { + return fn(params) +} + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler interface for that can handle valid delete data waveserver interfaces physical interface name properties ethernet params +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler interface { + Handle(DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder +} + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet creates a new http.Handler for the delete data waveserver interfaces physical interface name properties ethernet operation +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet(ctx *middleware.Context, handler DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler) *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet { + return &DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet{Context: ctx, Handler: handler} +} + +/*DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet swagger:route DELETE /data/waveserver-interfaces/physical-interface={name}/properties/ethernet/ ciena-waveserver-interfaces deleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet + +removes ciena.waveserver.interfaces.EthernetIfPropertiesGroup + +Ethernet interface attributes. + +*/ +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet struct { + Context *middleware.Context + Handler DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler +} + +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_ethernet_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_ethernet_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..dc8724195f70b3ea0c66051abaab63755473e481 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_ethernet_parameters.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams creates a new DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams object +// no default values defined in spec. +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams() DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams { + + return DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams{} +} + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams contains all the bound params for the delete data waveserver interfaces physical interface name properties ethernet operation +// typically these are obtained from a http.Request +// +// swagger:parameters DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams() beforehand. +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_ethernet_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_ethernet_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..1ea3cf85b72cee2b9dc640758cd104eac1fe4377 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_ethernet_responses.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContentCode is the HTTP code returned for type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent +const DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContentCode int = 204 + +/*DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent Object deleted + +swagger:response deleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent +*/ +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent struct { +} + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent creates DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent with default headers values +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent() *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent { + + return &DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequestCode is the HTTP code returned for type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest +const DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequestCode int = 400 + +/*DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest Internal error + +swagger:response deleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest +*/ +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest struct { +} + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest creates DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest with default headers values +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest() *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest { + + return &DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_ethernet_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_ethernet_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..a93ae6aa3620ff3cca5a84003753411df18a6f6e --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_ethernet_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL generates an URL for the delete data waveserver interfaces physical interface name properties ethernet operation +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) WithBasePath(bp string) *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/properties/ethernet/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_management.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_management.go new file mode 100644 index 0000000000000000000000000000000000000000..dac171fe76310d7af3d0bf49ea59503e92b0694c --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_management.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc turns a function with the right signature into a delete data waveserver interfaces physical interface name properties management handler +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc func(DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc) Handle(params DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder { + return fn(params) +} + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler interface for that can handle valid delete data waveserver interfaces physical interface name properties management params +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler interface { + Handle(DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder +} + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement creates a new http.Handler for the delete data waveserver interfaces physical interface name properties management operation +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement(ctx *middleware.Context, handler DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler) *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement { + return &DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement{Context: ctx, Handler: handler} +} + +/*DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement swagger:route DELETE /data/waveserver-interfaces/physical-interface={name}/properties/management/ ciena-waveserver-interfaces deleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement + +removes ciena.waveserver.interfaces.ManagementIfPropertiesGroup + +Management interface attributes. + +*/ +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement struct { + Context *middleware.Context + Handler DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler +} + +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_management_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_management_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..3b3ab41eefda86189303d7b072bdc106be435de7 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_management_parameters.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams creates a new DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams object +// no default values defined in spec. +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams() DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams { + + return DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams{} +} + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams contains all the bound params for the delete data waveserver interfaces physical interface name properties management operation +// typically these are obtained from a http.Request +// +// swagger:parameters DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams() beforehand. +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_management_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_management_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..ed70bfbc50cd16e50a888823d76fe53436050e47 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_management_responses.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContentCode is the HTTP code returned for type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent +const DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContentCode int = 204 + +/*DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent Object deleted + +swagger:response deleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent +*/ +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent struct { +} + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent creates DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent with default headers values +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent() *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent { + + return &DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequestCode is the HTTP code returned for type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest +const DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequestCode int = 400 + +/*DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest Internal error + +swagger:response deleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest +*/ +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest struct { +} + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest creates DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest with default headers values +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest() *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest { + + return &DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_management_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_management_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..5293d352b6f3f92a49aa497f19b810c7b7fe967b --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_management_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL generates an URL for the delete data waveserver interfaces physical interface name properties management operation +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) WithBasePath(bp string) *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/properties/management/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..e7d02f137d622433d692b0aff10ecc00682a9711 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_parameters.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams creates a new DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams object +// no default values defined in spec. +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams() DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams { + + return DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams{} +} + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams contains all the bound params for the delete data waveserver interfaces physical interface name properties operation +// typically these are obtained from a http.Request +// +// swagger:parameters DeleteDataWaveserverInterfacesPhysicalInterfaceNameProperties +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams() beforehand. +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..8dec9acd6d0317ddd67b082a9186b09270ab5491 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_responses.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContentCode is the HTTP code returned for type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent +const DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContentCode int = 204 + +/*DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent Object deleted + +swagger:response deleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent +*/ +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent struct { +} + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent creates DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent with default headers values +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent() *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent { + + return &DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequestCode is the HTTP code returned for type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest +const DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequestCode int = 400 + +/*DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest Internal error + +swagger:response deleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest +*/ +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest struct { +} + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest creates DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest with default headers values +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest() *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest { + + return &DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..200f07c8f8d65bd94ea5692eda6f3868dbb37045 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_properties_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL generates an URL for the delete data waveserver interfaces physical interface name properties operation +type DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) WithBasePath(bp string) *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/properties/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b1e8d8f8134752e73cc8992e57d80a04e8f2215f --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_responses.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNameNoContentCode is the HTTP code returned for type DeleteDataWaveserverInterfacesPhysicalInterfaceNameNoContent +const DeleteDataWaveserverInterfacesPhysicalInterfaceNameNoContentCode int = 204 + +/*DeleteDataWaveserverInterfacesPhysicalInterfaceNameNoContent Object deleted + +swagger:response deleteDataWaveserverInterfacesPhysicalInterfaceNameNoContent +*/ +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameNoContent struct { +} + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameNoContent creates DeleteDataWaveserverInterfacesPhysicalInterfaceNameNoContent with default headers values +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameNoContent() *DeleteDataWaveserverInterfacesPhysicalInterfaceNameNoContent { + + return &DeleteDataWaveserverInterfacesPhysicalInterfaceNameNoContent{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNameBadRequestCode is the HTTP code returned for type DeleteDataWaveserverInterfacesPhysicalInterfaceNameBadRequest +const DeleteDataWaveserverInterfacesPhysicalInterfaceNameBadRequestCode int = 400 + +/*DeleteDataWaveserverInterfacesPhysicalInterfaceNameBadRequest Internal error + +swagger:response deleteDataWaveserverInterfacesPhysicalInterfaceNameBadRequest +*/ +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameBadRequest struct { +} + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameBadRequest creates DeleteDataWaveserverInterfacesPhysicalInterfaceNameBadRequest with default headers values +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameBadRequest() *DeleteDataWaveserverInterfacesPhysicalInterfaceNameBadRequest { + + return &DeleteDataWaveserverInterfacesPhysicalInterfaceNameBadRequest{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_state.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_state.go new file mode 100644 index 0000000000000000000000000000000000000000..b0d694324cecd8ac0e501c5b6773ffacd66e214b --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_state.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc turns a function with the right signature into a delete data waveserver interfaces physical interface name state handler +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc func(DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc) Handle(params DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder { + return fn(params) +} + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateHandler interface for that can handle valid delete data waveserver interfaces physical interface name state params +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateHandler interface { + Handle(DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder +} + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameState creates a new http.Handler for the delete data waveserver interfaces physical interface name state operation +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameState(ctx *middleware.Context, handler DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateHandler) *DeleteDataWaveserverInterfacesPhysicalInterfaceNameState { + return &DeleteDataWaveserverInterfacesPhysicalInterfaceNameState{Context: ctx, Handler: handler} +} + +/*DeleteDataWaveserverInterfacesPhysicalInterfaceNameState swagger:route DELETE /data/waveserver-interfaces/physical-interface={name}/state/ ciena-waveserver-interfaces deleteDataWaveserverInterfacesPhysicalInterfaceNameState + +removes ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State + +Physical management interface state information. + +*/ +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameState struct { + Context *middleware.Context + Handler DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateHandler +} + +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameState) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameStateParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_state_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_state_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..24cc6fa04f755a6049142b93df17e9f5cafb46d5 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_state_parameters.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameStateParams creates a new DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateParams object +// no default values defined in spec. +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameStateParams() DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateParams { + + return DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateParams{} +} + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateParams contains all the bound params for the delete data waveserver interfaces physical interface name state operation +// typically these are obtained from a http.Request +// +// swagger:parameters DeleteDataWaveserverInterfacesPhysicalInterfaceNameState +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameStateParams() beforehand. +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_state_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_state_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..9b23740e00e8167bbc38c7248e0560342f9479c9 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_state_responses.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateNoContentCode is the HTTP code returned for type DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent +const DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateNoContentCode int = 204 + +/*DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent Object deleted + +swagger:response deleteDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent +*/ +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent struct { +} + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent creates DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent with default headers values +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent() *DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent { + + return &DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequestCode is the HTTP code returned for type DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest +const DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequestCode int = 400 + +/*DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest Internal error + +swagger:response deleteDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest +*/ +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest struct { +} + +// NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest creates DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest with default headers values +func NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest() *DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest { + + return &DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_state_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_state_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..e16e48fc53c23003be9ccffb1737e1bb5cab1820 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_state_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateURL generates an URL for the delete data waveserver interfaces physical interface name state operation +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateURL) WithBasePath(bp string) *DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/state/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..1d1031527724b21531c4365c6a555b1ebf6c3883 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_physical_interface_name_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// DeleteDataWaveserverInterfacesPhysicalInterfaceNameURL generates an URL for the delete data waveserver interfaces physical interface name operation +type DeleteDataWaveserverInterfacesPhysicalInterfaceNameURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameURL) WithBasePath(bp string) *DeleteDataWaveserverInterfacesPhysicalInterfaceNameURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on DeleteDataWaveserverInterfacesPhysicalInterfaceNameURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteDataWaveserverInterfacesPhysicalInterfaceNameURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteDataWaveserverInterfacesPhysicalInterfaceNameURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteDataWaveserverInterfacesPhysicalInterfaceNameURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..60fde80fe1c65fcbceed8ce2e8cebd3173161163 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_responses.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DeleteDataWaveserverInterfacesNoContentCode is the HTTP code returned for type DeleteDataWaveserverInterfacesNoContent +const DeleteDataWaveserverInterfacesNoContentCode int = 204 + +/*DeleteDataWaveserverInterfacesNoContent Object deleted + +swagger:response deleteDataWaveserverInterfacesNoContent +*/ +type DeleteDataWaveserverInterfacesNoContent struct { +} + +// NewDeleteDataWaveserverInterfacesNoContent creates DeleteDataWaveserverInterfacesNoContent with default headers values +func NewDeleteDataWaveserverInterfacesNoContent() *DeleteDataWaveserverInterfacesNoContent { + + return &DeleteDataWaveserverInterfacesNoContent{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteDataWaveserverInterfacesBadRequestCode is the HTTP code returned for type DeleteDataWaveserverInterfacesBadRequest +const DeleteDataWaveserverInterfacesBadRequestCode int = 400 + +/*DeleteDataWaveserverInterfacesBadRequest Internal error + +swagger:response deleteDataWaveserverInterfacesBadRequest +*/ +type DeleteDataWaveserverInterfacesBadRequest struct { +} + +// NewDeleteDataWaveserverInterfacesBadRequest creates DeleteDataWaveserverInterfacesBadRequest with default headers values +func NewDeleteDataWaveserverInterfacesBadRequest() *DeleteDataWaveserverInterfacesBadRequest { + + return &DeleteDataWaveserverInterfacesBadRequest{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes.go new file mode 100644 index 0000000000000000000000000000000000000000..35aed68eac8fdfcadce50b8eb3e0a51aadcbcfc0 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteDataWaveserverInterfacesRoutesHandlerFunc turns a function with the right signature into a delete data waveserver interfaces routes handler +type DeleteDataWaveserverInterfacesRoutesHandlerFunc func(DeleteDataWaveserverInterfacesRoutesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteDataWaveserverInterfacesRoutesHandlerFunc) Handle(params DeleteDataWaveserverInterfacesRoutesParams) middleware.Responder { + return fn(params) +} + +// DeleteDataWaveserverInterfacesRoutesHandler interface for that can handle valid delete data waveserver interfaces routes params +type DeleteDataWaveserverInterfacesRoutesHandler interface { + Handle(DeleteDataWaveserverInterfacesRoutesParams) middleware.Responder +} + +// NewDeleteDataWaveserverInterfacesRoutes creates a new http.Handler for the delete data waveserver interfaces routes operation +func NewDeleteDataWaveserverInterfacesRoutes(ctx *middleware.Context, handler DeleteDataWaveserverInterfacesRoutesHandler) *DeleteDataWaveserverInterfacesRoutes { + return &DeleteDataWaveserverInterfacesRoutes{Context: ctx, Handler: handler} +} + +/*DeleteDataWaveserverInterfacesRoutes swagger:route DELETE /data/waveserver-interfaces/routes/ ciena-waveserver-interfaces deleteDataWaveserverInterfacesRoutes + +removes ciena.waveserver.interfaces.waveserverinterfaces.Routes + +Top-level container for IP route configuration and operational data. + +*/ +type DeleteDataWaveserverInterfacesRoutes struct { + Context *middleware.Context + Handler DeleteDataWaveserverInterfacesRoutesHandler +} + +func (o *DeleteDataWaveserverInterfacesRoutes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDeleteDataWaveserverInterfacesRoutesParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination.go new file mode 100644 index 0000000000000000000000000000000000000000..0730133d0a91d7d34c8fb12b40c7a9ab6a8512f7 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandlerFunc turns a function with the right signature into a delete data waveserver interfaces routes IP v4 static route destination handler +type DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandlerFunc func(DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandlerFunc) Handle(params DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) middleware.Responder { + return fn(params) +} + +// DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler interface for that can handle valid delete data waveserver interfaces routes IP v4 static route destination params +type DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler interface { + Handle(DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) middleware.Responder +} + +// NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestination creates a new http.Handler for the delete data waveserver interfaces routes IP v4 static route destination operation +func NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestination(ctx *middleware.Context, handler DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler) *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestination { + return &DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestination{Context: ctx, Handler: handler} +} + +/*DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestination swagger:route DELETE /data/waveserver-interfaces/routes/ipv4-static-route={destination}/ ciena-waveserver-interfaces deleteDataWaveserverInterfacesRoutesIpV4StaticRouteDestination + +removes ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute + +List of IPv4 static routing entries. + +*/ +type DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestination struct { + Context *middleware.Context + Handler DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler +} + +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestination) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index.go new file mode 100644 index 0000000000000000000000000000000000000000..1900f2aec74cb009352538bb462fd6f769acae7c --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandlerFunc turns a function with the right signature into a delete data waveserver interfaces routes IP v4 static route destination next hop index handler +type DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandlerFunc func(DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandlerFunc) Handle(params DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) middleware.Responder { + return fn(params) +} + +// DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler interface for that can handle valid delete data waveserver interfaces routes IP v4 static route destination next hop index params +type DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler interface { + Handle(DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) middleware.Responder +} + +// NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex creates a new http.Handler for the delete data waveserver interfaces routes IP v4 static route destination next hop index operation +func NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex(ctx *middleware.Context, handler DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler) *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex { + return &DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex{Context: ctx, Handler: handler} +} + +/*DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex swagger:route DELETE /data/waveserver-interfaces/routes/ipv4-static-route={destination}/next-hop={index}/ ciena-waveserver-interfaces deleteDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationNextHopIndex + +removes ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop + +A list of next-hop entries associated with the static route. + +*/ +type DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex struct { + Context *middleware.Context + Handler DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler +} + +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..3f38e95fcce0b3ef69fb982e015db8c387ae8dde --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_parameters.go @@ -0,0 +1,102 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams creates a new DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams object +// no default values defined in spec. +func NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams() DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams { + + return DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams{} +} + +// DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams contains all the bound params for the delete data waveserver interfaces routes IP v4 static route destination next hop index operation +// typically these are obtained from a http.Request +// +// swagger:parameters DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex +type DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of ipv4-static-route + Required: true + In: path + */ + Destination string + /*Id of next-hop + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams() beforehand. +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rDestination, rhkDestination, _ := route.Params.GetOK("destination") + if err := o.bindDestination(rDestination, rhkDestination, route.Formats); err != nil { + res = append(res, err) + } + + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindDestination binds and validates parameter Destination from path. +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) bindDestination(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Destination = raw + + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f86ba4e59bd60163a7b6c421edc6b9f4ad8a82ce --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_responses.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContentCode is the HTTP code returned for type DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContent +const DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContentCode int = 204 + +/*DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContent Object deleted + +swagger:response deleteDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationNextHopIndexNoContent +*/ +type DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContent struct { +} + +// NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContent creates DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContent with default headers values +func NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContent() *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContent { + + return &DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContent{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequestCode is the HTTP code returned for type DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest +const DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequestCode int = 400 + +/*DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest Internal error + +swagger:response deleteDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationNextHopIndexBadRequest +*/ +type DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest struct { +} + +// NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest creates DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest with default headers values +func NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest() *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest { + + return &DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..de36efdc63431737b826c7c6174a7aa22c663c40 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_urlbuilder.go @@ -0,0 +1,106 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL generates an URL for the delete data waveserver interfaces routes IP v4 static route destination next hop index operation +type DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL struct { + Destination string + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) WithBasePath(bp string) *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/routes/ipv4-static-route={destination}/next-hop={index}/" + + destination := o.Destination + if destination != "" { + _path = strings.Replace(_path, "{destination}", destination, -1) + } else { + return nil, errors.New("destination is required on DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL") + } + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..3248ab3805266671f1a21e0781e1a7ce67c1368a --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_parameters.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams creates a new DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams object +// no default values defined in spec. +func NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams() DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams { + + return DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams{} +} + +// DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams contains all the bound params for the delete data waveserver interfaces routes IP v4 static route destination operation +// typically these are obtained from a http.Request +// +// swagger:parameters DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestination +type DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of ipv4-static-route + Required: true + In: path + */ + Destination string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams() beforehand. +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rDestination, rhkDestination, _ := route.Params.GetOK("destination") + if err := o.bindDestination(rDestination, rhkDestination, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindDestination binds and validates parameter Destination from path. +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) bindDestination(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Destination = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..39540b5fcfe2d0e458bb8900f4ac26c08f4ce26c --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_responses.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContentCode is the HTTP code returned for type DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContent +const DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContentCode int = 204 + +/*DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContent Object deleted + +swagger:response deleteDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationNoContent +*/ +type DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContent struct { +} + +// NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContent creates DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContent with default headers values +func NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContent() *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContent { + + return &DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContent{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequestCode is the HTTP code returned for type DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest +const DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequestCode int = 400 + +/*DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest Internal error + +swagger:response deleteDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationBadRequest +*/ +type DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest struct { +} + +// NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest creates DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest with default headers values +func NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest() *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest { + + return &DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..90a83b0ff61ddee9f2af8a8471de9674371241ef --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_ip_v4_static_route_destination_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL generates an URL for the delete data waveserver interfaces routes IP v4 static route destination operation +type DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL struct { + Destination string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) WithBasePath(bp string) *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/routes/ipv4-static-route={destination}/" + + destination := o.Destination + if destination != "" { + _path = strings.Replace(_path, "{destination}", destination, -1) + } else { + return nil, errors.New("destination is required on DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..dc9a372ba410e5d91fd9d6585aa4d8ef3e1e6d8c --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_parameters.go @@ -0,0 +1,45 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewDeleteDataWaveserverInterfacesRoutesParams creates a new DeleteDataWaveserverInterfacesRoutesParams object +// no default values defined in spec. +func NewDeleteDataWaveserverInterfacesRoutesParams() DeleteDataWaveserverInterfacesRoutesParams { + + return DeleteDataWaveserverInterfacesRoutesParams{} +} + +// DeleteDataWaveserverInterfacesRoutesParams contains all the bound params for the delete data waveserver interfaces routes operation +// typically these are obtained from a http.Request +// +// swagger:parameters DeleteDataWaveserverInterfacesRoutes +type DeleteDataWaveserverInterfacesRoutesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteDataWaveserverInterfacesRoutesParams() beforehand. +func (o *DeleteDataWaveserverInterfacesRoutesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..0da3a1ccb6a9a54268d27fb85151854075554c53 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_responses.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// DeleteDataWaveserverInterfacesRoutesNoContentCode is the HTTP code returned for type DeleteDataWaveserverInterfacesRoutesNoContent +const DeleteDataWaveserverInterfacesRoutesNoContentCode int = 204 + +/*DeleteDataWaveserverInterfacesRoutesNoContent Object deleted + +swagger:response deleteDataWaveserverInterfacesRoutesNoContent +*/ +type DeleteDataWaveserverInterfacesRoutesNoContent struct { +} + +// NewDeleteDataWaveserverInterfacesRoutesNoContent creates DeleteDataWaveserverInterfacesRoutesNoContent with default headers values +func NewDeleteDataWaveserverInterfacesRoutesNoContent() *DeleteDataWaveserverInterfacesRoutesNoContent { + + return &DeleteDataWaveserverInterfacesRoutesNoContent{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesRoutesNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteDataWaveserverInterfacesRoutesBadRequestCode is the HTTP code returned for type DeleteDataWaveserverInterfacesRoutesBadRequest +const DeleteDataWaveserverInterfacesRoutesBadRequestCode int = 400 + +/*DeleteDataWaveserverInterfacesRoutesBadRequest Internal error + +swagger:response deleteDataWaveserverInterfacesRoutesBadRequest +*/ +type DeleteDataWaveserverInterfacesRoutesBadRequest struct { +} + +// NewDeleteDataWaveserverInterfacesRoutesBadRequest creates DeleteDataWaveserverInterfacesRoutesBadRequest with default headers values +func NewDeleteDataWaveserverInterfacesRoutesBadRequest() *DeleteDataWaveserverInterfacesRoutesBadRequest { + + return &DeleteDataWaveserverInterfacesRoutesBadRequest{} +} + +// WriteResponse to the client +func (o *DeleteDataWaveserverInterfacesRoutesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..92e095d314d9eab229fddcd5135119e51fc8c414 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_routes_urlbuilder.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// DeleteDataWaveserverInterfacesRoutesURL generates an URL for the delete data waveserver interfaces routes operation +type DeleteDataWaveserverInterfacesRoutesURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesRoutesURL) WithBasePath(bp string) *DeleteDataWaveserverInterfacesRoutesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesRoutesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteDataWaveserverInterfacesRoutesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/routes/" + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteDataWaveserverInterfacesRoutesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteDataWaveserverInterfacesRoutesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteDataWaveserverInterfacesRoutesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteDataWaveserverInterfacesRoutesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteDataWaveserverInterfacesRoutesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteDataWaveserverInterfacesRoutesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..133b995a1fa3a2a98f0c8d31f46a7d7a1493dc8e --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/delete_data_waveserver_interfaces_urlbuilder.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// DeleteDataWaveserverInterfacesURL generates an URL for the delete data waveserver interfaces operation +type DeleteDataWaveserverInterfacesURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesURL) WithBasePath(bp string) *DeleteDataWaveserverInterfacesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteDataWaveserverInterfacesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteDataWaveserverInterfacesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/" + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteDataWaveserverInterfacesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteDataWaveserverInterfacesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteDataWaveserverInterfacesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteDataWaveserverInterfacesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteDataWaveserverInterfacesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteDataWaveserverInterfacesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces.go new file mode 100644 index 0000000000000000000000000000000000000000..516ba66240f3df25feaffd3c736ea9e998acb386 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetDataWaveserverInterfacesHandlerFunc turns a function with the right signature into a get data waveserver interfaces handler +type GetDataWaveserverInterfacesHandlerFunc func(GetDataWaveserverInterfacesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetDataWaveserverInterfacesHandlerFunc) Handle(params GetDataWaveserverInterfacesParams) middleware.Responder { + return fn(params) +} + +// GetDataWaveserverInterfacesHandler interface for that can handle valid get data waveserver interfaces params +type GetDataWaveserverInterfacesHandler interface { + Handle(GetDataWaveserverInterfacesParams) middleware.Responder +} + +// NewGetDataWaveserverInterfaces creates a new http.Handler for the get data waveserver interfaces operation +func NewGetDataWaveserverInterfaces(ctx *middleware.Context, handler GetDataWaveserverInterfacesHandler) *GetDataWaveserverInterfaces { + return &GetDataWaveserverInterfaces{Context: ctx, Handler: handler} +} + +/*GetDataWaveserverInterfaces swagger:route GET /data/waveserver-interfaces/ ciena-waveserver-interfaces getDataWaveserverInterfaces + +returns ciena.waveserver.interfaces.WaveserverInterfaces + +Top level container for configuration and operational data for physical + and logical network interfaces. + +*/ +type GetDataWaveserverInterfaces struct { + Context *middleware.Context + Handler GetDataWaveserverInterfacesHandler +} + +func (o *GetDataWaveserverInterfaces) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewGetDataWaveserverInterfacesParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index.go new file mode 100644 index 0000000000000000000000000000000000000000..f5e1ff7235a984e7e1e7b4baae896ea87a22874b --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetDataWaveserverInterfacesLogicalInterfaceIndexHandlerFunc turns a function with the right signature into a get data waveserver interfaces logical interface index handler +type GetDataWaveserverInterfacesLogicalInterfaceIndexHandlerFunc func(GetDataWaveserverInterfacesLogicalInterfaceIndexParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetDataWaveserverInterfacesLogicalInterfaceIndexHandlerFunc) Handle(params GetDataWaveserverInterfacesLogicalInterfaceIndexParams) middleware.Responder { + return fn(params) +} + +// GetDataWaveserverInterfacesLogicalInterfaceIndexHandler interface for that can handle valid get data waveserver interfaces logical interface index params +type GetDataWaveserverInterfacesLogicalInterfaceIndexHandler interface { + Handle(GetDataWaveserverInterfacesLogicalInterfaceIndexParams) middleware.Responder +} + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndex creates a new http.Handler for the get data waveserver interfaces logical interface index operation +func NewGetDataWaveserverInterfacesLogicalInterfaceIndex(ctx *middleware.Context, handler GetDataWaveserverInterfacesLogicalInterfaceIndexHandler) *GetDataWaveserverInterfacesLogicalInterfaceIndex { + return &GetDataWaveserverInterfacesLogicalInterfaceIndex{Context: ctx, Handler: handler} +} + +/*GetDataWaveserverInterfacesLogicalInterfaceIndex swagger:route GET /data/waveserver-interfaces/logical-interface={index}/ ciena-waveserver-interfaces getDataWaveserverInterfacesLogicalInterfaceIndex + +returns ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface + +List of logical IP management interfaces (e.g. 'local'). + +*/ +type GetDataWaveserverInterfacesLogicalInterfaceIndex struct { + Context *middleware.Context + Handler GetDataWaveserverInterfacesLogicalInterfaceIndexHandler +} + +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndex) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewGetDataWaveserverInterfacesLogicalInterfaceIndexParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_id.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_id.go new file mode 100644 index 0000000000000000000000000000000000000000..c001d922252fb9265c281cd05f703c40e41cc2f6 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_id.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc turns a function with the right signature into a get data waveserver interfaces logical interface index ID handler +type GetDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc func(GetDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc) Handle(params GetDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder { + return fn(params) +} + +// GetDataWaveserverInterfacesLogicalInterfaceIndexIDHandler interface for that can handle valid get data waveserver interfaces logical interface index ID params +type GetDataWaveserverInterfacesLogicalInterfaceIndexIDHandler interface { + Handle(GetDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder +} + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexID creates a new http.Handler for the get data waveserver interfaces logical interface index ID operation +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexID(ctx *middleware.Context, handler GetDataWaveserverInterfacesLogicalInterfaceIndexIDHandler) *GetDataWaveserverInterfacesLogicalInterfaceIndexID { + return &GetDataWaveserverInterfacesLogicalInterfaceIndexID{Context: ctx, Handler: handler} +} + +/*GetDataWaveserverInterfacesLogicalInterfaceIndexID swagger:route GET /data/waveserver-interfaces/logical-interface={index}/id/ ciena-waveserver-interfaces getDataWaveserverInterfacesLogicalInterfaceIndexId + +returns ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id + +Identification information of this logical management interface. + +*/ +type GetDataWaveserverInterfacesLogicalInterfaceIndexID struct { + Context *middleware.Context + Handler GetDataWaveserverInterfacesLogicalInterfaceIndexIDHandler +} + +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewGetDataWaveserverInterfacesLogicalInterfaceIndexIDParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_id_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_id_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6bcf7abd2e84d8dc9ad5c3a2e285f55f91c9b7fa --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_id_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexIDParams creates a new GetDataWaveserverInterfacesLogicalInterfaceIndexIDParams object +// no default values defined in spec. +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexIDParams() GetDataWaveserverInterfacesLogicalInterfaceIndexIDParams { + + return GetDataWaveserverInterfacesLogicalInterfaceIndexIDParams{} +} + +// GetDataWaveserverInterfacesLogicalInterfaceIndexIDParams contains all the bound params for the get data waveserver interfaces logical interface index ID operation +// typically these are obtained from a http.Request +// +// swagger:parameters GetDataWaveserverInterfacesLogicalInterfaceIndexID +type GetDataWaveserverInterfacesLogicalInterfaceIndexIDParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetDataWaveserverInterfacesLogicalInterfaceIndexIDParams() beforehand. +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexIDParams) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_id_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_id_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..72ec05c69a964e69dd1410b03ff25a816ee94aa3 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_id_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// GetDataWaveserverInterfacesLogicalInterfaceIndexIDOKCode is the HTTP code returned for type GetDataWaveserverInterfacesLogicalInterfaceIndexIDOK +const GetDataWaveserverInterfacesLogicalInterfaceIndexIDOKCode int = 200 + +/*GetDataWaveserverInterfacesLogicalInterfaceIndexIDOK ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id + +swagger:response getDataWaveserverInterfacesLogicalInterfaceIndexIdOK +*/ +type GetDataWaveserverInterfacesLogicalInterfaceIndexIDOK struct { + + /* + In: Body + */ + Payload *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIDWrapper `json:"body,omitempty"` +} + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexIDOK creates GetDataWaveserverInterfacesLogicalInterfaceIndexIDOK with default headers values +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexIDOK() *GetDataWaveserverInterfacesLogicalInterfaceIndexIDOK { + + return &GetDataWaveserverInterfacesLogicalInterfaceIndexIDOK{} +} + +// WithPayload adds the payload to the get data waveserver interfaces logical interface index Id o k response +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexIDOK) WithPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIDWrapper) *GetDataWaveserverInterfacesLogicalInterfaceIndexIDOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get data waveserver interfaces logical interface index Id o k response +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexIDOK) SetPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIDWrapper) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequestCode is the HTTP code returned for type GetDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest +const GetDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequestCode int = 400 + +/*GetDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest Internal error + +swagger:response getDataWaveserverInterfacesLogicalInterfaceIndexIdBadRequest +*/ +type GetDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest struct { +} + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest creates GetDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest with default headers values +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest() *GetDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest { + + return &GetDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest{} +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_id_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_id_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..629ecd853e8f74cffb2b2b7ad175b50b64e86e35 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_id_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// GetDataWaveserverInterfacesLogicalInterfaceIndexIDURL generates an URL for the get data waveserver interfaces logical interface index ID operation +type GetDataWaveserverInterfacesLogicalInterfaceIndexIDURL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexIDURL) WithBasePath(bp string) *GetDataWaveserverInterfacesLogicalInterfaceIndexIDURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexIDURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexIDURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/id/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on GetDataWaveserverInterfacesLogicalInterfaceIndexIDURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexIDURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexIDURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexIDURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetDataWaveserverInterfacesLogicalInterfaceIndexIDURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetDataWaveserverInterfacesLogicalInterfaceIndexIDURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexIDURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..f685ccd4d0533dc41a8e35753d7b99e6ec3007d5 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexParams creates a new GetDataWaveserverInterfacesLogicalInterfaceIndexParams object +// no default values defined in spec. +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexParams() GetDataWaveserverInterfacesLogicalInterfaceIndexParams { + + return GetDataWaveserverInterfacesLogicalInterfaceIndexParams{} +} + +// GetDataWaveserverInterfacesLogicalInterfaceIndexParams contains all the bound params for the get data waveserver interfaces logical interface index operation +// typically these are obtained from a http.Request +// +// swagger:parameters GetDataWaveserverInterfacesLogicalInterfaceIndex +type GetDataWaveserverInterfacesLogicalInterfaceIndexParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetDataWaveserverInterfacesLogicalInterfaceIndexParams() beforehand. +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexParams) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties.go new file mode 100644 index 0000000000000000000000000000000000000000..eebf1c8f9c084b4f2f26076f5da452be06d9f371 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc turns a function with the right signature into a get data waveserver interfaces logical interface index properties handler +type GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc func(GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc) Handle(params GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder { + return fn(params) +} + +// GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler interface for that can handle valid get data waveserver interfaces logical interface index properties params +type GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler interface { + Handle(GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder +} + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexProperties creates a new http.Handler for the get data waveserver interfaces logical interface index properties operation +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexProperties(ctx *middleware.Context, handler GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler) *GetDataWaveserverInterfacesLogicalInterfaceIndexProperties { + return &GetDataWaveserverInterfacesLogicalInterfaceIndexProperties{Context: ctx, Handler: handler} +} + +/*GetDataWaveserverInterfacesLogicalInterfaceIndexProperties swagger:route GET /data/waveserver-interfaces/logical-interface={index}/properties/ ciena-waveserver-interfaces getDataWaveserverInterfacesLogicalInterfaceIndexProperties + +returns ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties + +All the configuration data of the logical management interface. + +*/ +type GetDataWaveserverInterfacesLogicalInterfaceIndexProperties struct { + Context *middleware.Context + Handler GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler +} + +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexProperties) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_ip_v4.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_ip_v4.go new file mode 100644 index 0000000000000000000000000000000000000000..eaae12babb2387692283e179e7e189afcd933e16 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_ip_v4.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc turns a function with the right signature into a get data waveserver interfaces logical interface index properties IP v4 handler +type GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc func(GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc) Handle(params GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder { + return fn(params) +} + +// GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler interface for that can handle valid get data waveserver interfaces logical interface index properties IP v4 params +type GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler interface { + Handle(GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder +} + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 creates a new http.Handler for the get data waveserver interfaces logical interface index properties IP v4 operation +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4(ctx *middleware.Context, handler GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler) *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 { + return &GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4{Context: ctx, Handler: handler} +} + +/*GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 swagger:route GET /data/waveserver-interfaces/logical-interface={index}/properties/ipv4/ ciena-waveserver-interfaces getDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIpV4 + +returns ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4 + +IPv4 configuration and operational data. + +*/ +type GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 struct { + Context *middleware.Context + Handler GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler +} + +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d0cbbde54e057181b031be17177ddf1c50b1b1d4 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params creates a new GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params object +// no default values defined in spec. +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params() GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params { + + return GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params{} +} + +// GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params contains all the bound params for the get data waveserver interfaces logical interface index properties IP v4 operation +// typically these are obtained from a http.Request +// +// swagger:parameters GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 +type GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params() beforehand. +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..986543fcb23b15bb7eb192ae4c1adb66eb4105f9 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4OKCode is the HTTP code returned for type GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4OK +const GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4OKCode int = 200 + +/*GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4OK ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4 + +swagger:response getDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIpV4OK +*/ +type GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4OK struct { + + /* + In: Body + */ + Payload *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4Wrapper `json:"body,omitempty"` +} + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4OK creates GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4OK with default headers values +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4OK() *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4OK { + + return &GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4OK{} +} + +// WithPayload adds the payload to the get data waveserver interfaces logical interface index properties Ip v4 o k response +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4OK) WithPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4Wrapper) *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4OK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get data waveserver interfaces logical interface index properties Ip v4 o k response +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4OK) SetPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4Wrapper) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4OK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequestCode is the HTTP code returned for type GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest +const GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequestCode int = 400 + +/*GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest Internal error + +swagger:response getDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIpV4BadRequest +*/ +type GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest struct { +} + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest creates GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest with default headers values +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest() *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest { + + return &GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest{} +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..6740e1fb1e75ef7f48a4b65c23e2cddb3d326f04 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL generates an URL for the get data waveserver interfaces logical interface index properties IP v4 operation +type GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) WithBasePath(bp string) *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/properties/ipv4/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..282709d9da4cf00b0efb4ec234670055fac9596f --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams creates a new GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams object +// no default values defined in spec. +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams() GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams { + + return GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams{} +} + +// GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams contains all the bound params for the get data waveserver interfaces logical interface index properties operation +// typically these are obtained from a http.Request +// +// swagger:parameters GetDataWaveserverInterfacesLogicalInterfaceIndexProperties +type GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams() beforehand. +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..488c89c4205311bfdde5bd14a557baa6e1e0f300 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesOKCode is the HTTP code returned for type GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesOK +const GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesOKCode int = 200 + +/*GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesOK ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties + +swagger:response getDataWaveserverInterfacesLogicalInterfaceIndexPropertiesOK +*/ +type GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesOK struct { + + /* + In: Body + */ + Payload *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesWrapper `json:"body,omitempty"` +} + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesOK creates GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesOK with default headers values +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesOK() *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesOK { + + return &GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesOK{} +} + +// WithPayload adds the payload to the get data waveserver interfaces logical interface index properties o k response +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesOK) WithPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesWrapper) *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get data waveserver interfaces logical interface index properties o k response +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesOK) SetPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesWrapper) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequestCode is the HTTP code returned for type GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest +const GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequestCode int = 400 + +/*GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest Internal error + +swagger:response getDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest +*/ +type GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest struct { +} + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest creates GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest with default headers values +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest() *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest { + + return &GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest{} +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..137e9b1278504573919b646d16078a08ae465a8d --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_properties_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL generates an URL for the get data waveserver interfaces logical interface index properties operation +type GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) WithBasePath(bp string) *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/properties/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..5d848c14c80d7afe64cb167fbca9038d1c46ddd3 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// GetDataWaveserverInterfacesLogicalInterfaceIndexOKCode is the HTTP code returned for type GetDataWaveserverInterfacesLogicalInterfaceIndexOK +const GetDataWaveserverInterfacesLogicalInterfaceIndexOKCode int = 200 + +/*GetDataWaveserverInterfacesLogicalInterfaceIndexOK ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface + +swagger:response getDataWaveserverInterfacesLogicalInterfaceIndexOK +*/ +type GetDataWaveserverInterfacesLogicalInterfaceIndexOK struct { + + /* + In: Body + */ + Payload *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceWrapper `json:"body,omitempty"` +} + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexOK creates GetDataWaveserverInterfacesLogicalInterfaceIndexOK with default headers values +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexOK() *GetDataWaveserverInterfacesLogicalInterfaceIndexOK { + + return &GetDataWaveserverInterfacesLogicalInterfaceIndexOK{} +} + +// WithPayload adds the payload to the get data waveserver interfaces logical interface index o k response +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexOK) WithPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceWrapper) *GetDataWaveserverInterfacesLogicalInterfaceIndexOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get data waveserver interfaces logical interface index o k response +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexOK) SetPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceWrapper) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDataWaveserverInterfacesLogicalInterfaceIndexBadRequestCode is the HTTP code returned for type GetDataWaveserverInterfacesLogicalInterfaceIndexBadRequest +const GetDataWaveserverInterfacesLogicalInterfaceIndexBadRequestCode int = 400 + +/*GetDataWaveserverInterfacesLogicalInterfaceIndexBadRequest Internal error + +swagger:response getDataWaveserverInterfacesLogicalInterfaceIndexBadRequest +*/ +type GetDataWaveserverInterfacesLogicalInterfaceIndexBadRequest struct { +} + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexBadRequest creates GetDataWaveserverInterfacesLogicalInterfaceIndexBadRequest with default headers values +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexBadRequest() *GetDataWaveserverInterfacesLogicalInterfaceIndexBadRequest { + + return &GetDataWaveserverInterfacesLogicalInterfaceIndexBadRequest{} +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_state.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_state.go new file mode 100644 index 0000000000000000000000000000000000000000..168d467907b12937c6da3ad545f70b2e5291117f --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_state.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc turns a function with the right signature into a get data waveserver interfaces logical interface index state handler +type GetDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc func(GetDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc) Handle(params GetDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder { + return fn(params) +} + +// GetDataWaveserverInterfacesLogicalInterfaceIndexStateHandler interface for that can handle valid get data waveserver interfaces logical interface index state params +type GetDataWaveserverInterfacesLogicalInterfaceIndexStateHandler interface { + Handle(GetDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder +} + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexState creates a new http.Handler for the get data waveserver interfaces logical interface index state operation +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexState(ctx *middleware.Context, handler GetDataWaveserverInterfacesLogicalInterfaceIndexStateHandler) *GetDataWaveserverInterfacesLogicalInterfaceIndexState { + return &GetDataWaveserverInterfacesLogicalInterfaceIndexState{Context: ctx, Handler: handler} +} + +/*GetDataWaveserverInterfacesLogicalInterfaceIndexState swagger:route GET /data/waveserver-interfaces/logical-interface={index}/state/ ciena-waveserver-interfaces getDataWaveserverInterfacesLogicalInterfaceIndexState + +returns ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State + +Logical interface state information. + +*/ +type GetDataWaveserverInterfacesLogicalInterfaceIndexState struct { + Context *middleware.Context + Handler GetDataWaveserverInterfacesLogicalInterfaceIndexStateHandler +} + +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexState) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewGetDataWaveserverInterfacesLogicalInterfaceIndexStateParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_state_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_state_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..5b71f28c9ae640a79827645f5d9a250e4ff821b7 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_state_parameters.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexStateParams creates a new GetDataWaveserverInterfacesLogicalInterfaceIndexStateParams object +// no default values defined in spec. +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexStateParams() GetDataWaveserverInterfacesLogicalInterfaceIndexStateParams { + + return GetDataWaveserverInterfacesLogicalInterfaceIndexStateParams{} +} + +// GetDataWaveserverInterfacesLogicalInterfaceIndexStateParams contains all the bound params for the get data waveserver interfaces logical interface index state operation +// typically these are obtained from a http.Request +// +// swagger:parameters GetDataWaveserverInterfacesLogicalInterfaceIndexState +type GetDataWaveserverInterfacesLogicalInterfaceIndexStateParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetDataWaveserverInterfacesLogicalInterfaceIndexStateParams() beforehand. +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexStateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexStateParams) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_state_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_state_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..366158ba4fe445cd15506a1231dab3d93c847f0b --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_state_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// GetDataWaveserverInterfacesLogicalInterfaceIndexStateOKCode is the HTTP code returned for type GetDataWaveserverInterfacesLogicalInterfaceIndexStateOK +const GetDataWaveserverInterfacesLogicalInterfaceIndexStateOKCode int = 200 + +/*GetDataWaveserverInterfacesLogicalInterfaceIndexStateOK ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State + +swagger:response getDataWaveserverInterfacesLogicalInterfaceIndexStateOK +*/ +type GetDataWaveserverInterfacesLogicalInterfaceIndexStateOK struct { + + /* + In: Body + */ + Payload *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateWrapper `json:"body,omitempty"` +} + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexStateOK creates GetDataWaveserverInterfacesLogicalInterfaceIndexStateOK with default headers values +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexStateOK() *GetDataWaveserverInterfacesLogicalInterfaceIndexStateOK { + + return &GetDataWaveserverInterfacesLogicalInterfaceIndexStateOK{} +} + +// WithPayload adds the payload to the get data waveserver interfaces logical interface index state o k response +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexStateOK) WithPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateWrapper) *GetDataWaveserverInterfacesLogicalInterfaceIndexStateOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get data waveserver interfaces logical interface index state o k response +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexStateOK) SetPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateWrapper) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexStateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequestCode is the HTTP code returned for type GetDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest +const GetDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequestCode int = 400 + +/*GetDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest Internal error + +swagger:response getDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest +*/ +type GetDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest struct { +} + +// NewGetDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest creates GetDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest with default headers values +func NewGetDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest() *GetDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest { + + return &GetDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest{} +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_state_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_state_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..b06e3518c6e02257bed39c8c1de1c0486f0280c3 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_state_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// GetDataWaveserverInterfacesLogicalInterfaceIndexStateURL generates an URL for the get data waveserver interfaces logical interface index state operation +type GetDataWaveserverInterfacesLogicalInterfaceIndexStateURL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexStateURL) WithBasePath(bp string) *GetDataWaveserverInterfacesLogicalInterfaceIndexStateURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexStateURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexStateURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/state/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on GetDataWaveserverInterfacesLogicalInterfaceIndexStateURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexStateURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexStateURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexStateURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetDataWaveserverInterfacesLogicalInterfaceIndexStateURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetDataWaveserverInterfacesLogicalInterfaceIndexStateURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexStateURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..f1b9c16690c39ee80420f03fc148ea40ea26cfc7 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_logical_interface_index_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// GetDataWaveserverInterfacesLogicalInterfaceIndexURL generates an URL for the get data waveserver interfaces logical interface index operation +type GetDataWaveserverInterfacesLogicalInterfaceIndexURL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexURL) WithBasePath(bp string) *GetDataWaveserverInterfacesLogicalInterfaceIndexURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on GetDataWaveserverInterfacesLogicalInterfaceIndexURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetDataWaveserverInterfacesLogicalInterfaceIndexURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetDataWaveserverInterfacesLogicalInterfaceIndexURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetDataWaveserverInterfacesLogicalInterfaceIndexURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..9068d4771da26a7fc3e8b4b94ae4427a3affeb41 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_parameters.go @@ -0,0 +1,45 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewGetDataWaveserverInterfacesParams creates a new GetDataWaveserverInterfacesParams object +// no default values defined in spec. +func NewGetDataWaveserverInterfacesParams() GetDataWaveserverInterfacesParams { + + return GetDataWaveserverInterfacesParams{} +} + +// GetDataWaveserverInterfacesParams contains all the bound params for the get data waveserver interfaces operation +// typically these are obtained from a http.Request +// +// swagger:parameters GetDataWaveserverInterfaces +type GetDataWaveserverInterfacesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetDataWaveserverInterfacesParams() beforehand. +func (o *GetDataWaveserverInterfacesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name.go new file mode 100644 index 0000000000000000000000000000000000000000..3b9bb2afab51338da3ec671d65aa8ab21df7095a --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetDataWaveserverInterfacesPhysicalInterfaceNameHandlerFunc turns a function with the right signature into a get data waveserver interfaces physical interface name handler +type GetDataWaveserverInterfacesPhysicalInterfaceNameHandlerFunc func(GetDataWaveserverInterfacesPhysicalInterfaceNameParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetDataWaveserverInterfacesPhysicalInterfaceNameHandlerFunc) Handle(params GetDataWaveserverInterfacesPhysicalInterfaceNameParams) middleware.Responder { + return fn(params) +} + +// GetDataWaveserverInterfacesPhysicalInterfaceNameHandler interface for that can handle valid get data waveserver interfaces physical interface name params +type GetDataWaveserverInterfacesPhysicalInterfaceNameHandler interface { + Handle(GetDataWaveserverInterfacesPhysicalInterfaceNameParams) middleware.Responder +} + +// NewGetDataWaveserverInterfacesPhysicalInterfaceName creates a new http.Handler for the get data waveserver interfaces physical interface name operation +func NewGetDataWaveserverInterfacesPhysicalInterfaceName(ctx *middleware.Context, handler GetDataWaveserverInterfacesPhysicalInterfaceNameHandler) *GetDataWaveserverInterfacesPhysicalInterfaceName { + return &GetDataWaveserverInterfacesPhysicalInterfaceName{Context: ctx, Handler: handler} +} + +/*GetDataWaveserverInterfacesPhysicalInterfaceName swagger:route GET /data/waveserver-interfaces/physical-interface={name}/ ciena-waveserver-interfaces getDataWaveserverInterfacesPhysicalInterfaceName + +returns ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface + +List of physical Ethernet management interfaces. + +*/ +type GetDataWaveserverInterfacesPhysicalInterfaceName struct { + Context *middleware.Context + Handler GetDataWaveserverInterfacesPhysicalInterfaceNameHandler +} + +func (o *GetDataWaveserverInterfacesPhysicalInterfaceName) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewGetDataWaveserverInterfacesPhysicalInterfaceNameParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_id.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_id.go new file mode 100644 index 0000000000000000000000000000000000000000..18f7eeb992aa69bfae074e04cdd9d174c9e02146 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_id.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc turns a function with the right signature into a get data waveserver interfaces physical interface name ID handler +type GetDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc func(GetDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc) Handle(params GetDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder { + return fn(params) +} + +// GetDataWaveserverInterfacesPhysicalInterfaceNameIDHandler interface for that can handle valid get data waveserver interfaces physical interface name ID params +type GetDataWaveserverInterfacesPhysicalInterfaceNameIDHandler interface { + Handle(GetDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder +} + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNameID creates a new http.Handler for the get data waveserver interfaces physical interface name ID operation +func NewGetDataWaveserverInterfacesPhysicalInterfaceNameID(ctx *middleware.Context, handler GetDataWaveserverInterfacesPhysicalInterfaceNameIDHandler) *GetDataWaveserverInterfacesPhysicalInterfaceNameID { + return &GetDataWaveserverInterfacesPhysicalInterfaceNameID{Context: ctx, Handler: handler} +} + +/*GetDataWaveserverInterfacesPhysicalInterfaceNameID swagger:route GET /data/waveserver-interfaces/physical-interface={name}/id/ ciena-waveserver-interfaces getDataWaveserverInterfacesPhysicalInterfaceNameId + +returns ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id + +Identification information of this management interface. + +*/ +type GetDataWaveserverInterfacesPhysicalInterfaceNameID struct { + Context *middleware.Context + Handler GetDataWaveserverInterfacesPhysicalInterfaceNameIDHandler +} + +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewGetDataWaveserverInterfacesPhysicalInterfaceNameIDParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_id_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_id_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d0817e73ca1a618461081c1122fcdf94f964bcf0 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_id_parameters.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNameIDParams creates a new GetDataWaveserverInterfacesPhysicalInterfaceNameIDParams object +// no default values defined in spec. +func NewGetDataWaveserverInterfacesPhysicalInterfaceNameIDParams() GetDataWaveserverInterfacesPhysicalInterfaceNameIDParams { + + return GetDataWaveserverInterfacesPhysicalInterfaceNameIDParams{} +} + +// GetDataWaveserverInterfacesPhysicalInterfaceNameIDParams contains all the bound params for the get data waveserver interfaces physical interface name ID operation +// typically these are obtained from a http.Request +// +// swagger:parameters GetDataWaveserverInterfacesPhysicalInterfaceNameID +type GetDataWaveserverInterfacesPhysicalInterfaceNameIDParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetDataWaveserverInterfacesPhysicalInterfaceNameIDParams() beforehand. +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameIDParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_id_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_id_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..9bf620b021251e69aaf9bf35658d5ce58822e95c --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_id_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// GetDataWaveserverInterfacesPhysicalInterfaceNameIDOKCode is the HTTP code returned for type GetDataWaveserverInterfacesPhysicalInterfaceNameIDOK +const GetDataWaveserverInterfacesPhysicalInterfaceNameIDOKCode int = 200 + +/*GetDataWaveserverInterfacesPhysicalInterfaceNameIDOK ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id + +swagger:response getDataWaveserverInterfacesPhysicalInterfaceNameIdOK +*/ +type GetDataWaveserverInterfacesPhysicalInterfaceNameIDOK struct { + + /* + In: Body + */ + Payload *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIDWrapper `json:"body,omitempty"` +} + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNameIDOK creates GetDataWaveserverInterfacesPhysicalInterfaceNameIDOK with default headers values +func NewGetDataWaveserverInterfacesPhysicalInterfaceNameIDOK() *GetDataWaveserverInterfacesPhysicalInterfaceNameIDOK { + + return &GetDataWaveserverInterfacesPhysicalInterfaceNameIDOK{} +} + +// WithPayload adds the payload to the get data waveserver interfaces physical interface name Id o k response +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameIDOK) WithPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIDWrapper) *GetDataWaveserverInterfacesPhysicalInterfaceNameIDOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get data waveserver interfaces physical interface name Id o k response +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameIDOK) SetPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIDWrapper) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequestCode is the HTTP code returned for type GetDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest +const GetDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequestCode int = 400 + +/*GetDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest Internal error + +swagger:response getDataWaveserverInterfacesPhysicalInterfaceNameIdBadRequest +*/ +type GetDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest struct { +} + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest creates GetDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest with default headers values +func NewGetDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest() *GetDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest { + + return &GetDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest{} +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_id_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_id_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..84231fd182f1a975ec290a5c964878b23954df42 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_id_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetDataWaveserverInterfacesPhysicalInterfaceNameIDURL generates an URL for the get data waveserver interfaces physical interface name ID operation +type GetDataWaveserverInterfacesPhysicalInterfaceNameIDURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameIDURL) WithBasePath(bp string) *GetDataWaveserverInterfacesPhysicalInterfaceNameIDURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameIDURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameIDURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/id/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on GetDataWaveserverInterfacesPhysicalInterfaceNameIDURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameIDURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameIDURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameIDURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetDataWaveserverInterfacesPhysicalInterfaceNameIDURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetDataWaveserverInterfacesPhysicalInterfaceNameIDURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameIDURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..1f35f5a0ea8fef1d8c5434a839546d880a907843 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_parameters.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNameParams creates a new GetDataWaveserverInterfacesPhysicalInterfaceNameParams object +// no default values defined in spec. +func NewGetDataWaveserverInterfacesPhysicalInterfaceNameParams() GetDataWaveserverInterfacesPhysicalInterfaceNameParams { + + return GetDataWaveserverInterfacesPhysicalInterfaceNameParams{} +} + +// GetDataWaveserverInterfacesPhysicalInterfaceNameParams contains all the bound params for the get data waveserver interfaces physical interface name operation +// typically these are obtained from a http.Request +// +// swagger:parameters GetDataWaveserverInterfacesPhysicalInterfaceName +type GetDataWaveserverInterfacesPhysicalInterfaceNameParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetDataWaveserverInterfacesPhysicalInterfaceNameParams() beforehand. +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties.go new file mode 100644 index 0000000000000000000000000000000000000000..9008263ca3793b3e00fd19cc6bde770aaa295f27 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc turns a function with the right signature into a get data waveserver interfaces physical interface name properties handler +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc func(GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc) Handle(params GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder { + return fn(params) +} + +// GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler interface for that can handle valid get data waveserver interfaces physical interface name properties params +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler interface { + Handle(GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder +} + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNameProperties creates a new http.Handler for the get data waveserver interfaces physical interface name properties operation +func NewGetDataWaveserverInterfacesPhysicalInterfaceNameProperties(ctx *middleware.Context, handler GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler) *GetDataWaveserverInterfacesPhysicalInterfaceNameProperties { + return &GetDataWaveserverInterfacesPhysicalInterfaceNameProperties{Context: ctx, Handler: handler} +} + +/*GetDataWaveserverInterfacesPhysicalInterfaceNameProperties swagger:route GET /data/waveserver-interfaces/physical-interface={name}/properties/ ciena-waveserver-interfaces getDataWaveserverInterfacesPhysicalInterfaceNameProperties + +returns ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties + +All the configuration data of the physical management interface. + +*/ +type GetDataWaveserverInterfacesPhysicalInterfaceNameProperties struct { + Context *middleware.Context + Handler GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler +} + +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameProperties) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_ethernet.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_ethernet.go new file mode 100644 index 0000000000000000000000000000000000000000..b6f89f6dce0f7ecdb96d1004bd942f2ad045d2f8 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_ethernet.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc turns a function with the right signature into a get data waveserver interfaces physical interface name properties ethernet handler +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc func(GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc) Handle(params GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder { + return fn(params) +} + +// GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler interface for that can handle valid get data waveserver interfaces physical interface name properties ethernet params +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler interface { + Handle(GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder +} + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet creates a new http.Handler for the get data waveserver interfaces physical interface name properties ethernet operation +func NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet(ctx *middleware.Context, handler GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler) *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet { + return &GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet{Context: ctx, Handler: handler} +} + +/*GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet swagger:route GET /data/waveserver-interfaces/physical-interface={name}/properties/ethernet/ ciena-waveserver-interfaces getDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet + +returns ciena.waveserver.interfaces.EthernetIfPropertiesGroup + +Ethernet interface attributes. + +*/ +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet struct { + Context *middleware.Context + Handler GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler +} + +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_ethernet_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_ethernet_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a7292515923fd0ef5b1ce93293add5a8953c00dd --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_ethernet_parameters.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams creates a new GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams object +// no default values defined in spec. +func NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams() GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams { + + return GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams{} +} + +// GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams contains all the bound params for the get data waveserver interfaces physical interface name properties ethernet operation +// typically these are obtained from a http.Request +// +// swagger:parameters GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams() beforehand. +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_ethernet_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_ethernet_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..75a2e720bfcda145d5cf14c9f0d37cac2e6b7d7d --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_ethernet_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetOKCode is the HTTP code returned for type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetOK +const GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetOKCode int = 200 + +/*GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetOK ciena.waveserver.interfaces.EthernetIfPropertiesGroup + +swagger:response getDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetOK +*/ +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetOK struct { + + /* + In: Body + */ + Payload *models.CienaWaveserverInterfacesEthernetIfPropertiesGroupWrapper `json:"body,omitempty"` +} + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetOK creates GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetOK with default headers values +func NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetOK() *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetOK { + + return &GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetOK{} +} + +// WithPayload adds the payload to the get data waveserver interfaces physical interface name properties ethernet o k response +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetOK) WithPayload(payload *models.CienaWaveserverInterfacesEthernetIfPropertiesGroupWrapper) *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get data waveserver interfaces physical interface name properties ethernet o k response +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetOK) SetPayload(payload *models.CienaWaveserverInterfacesEthernetIfPropertiesGroupWrapper) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequestCode is the HTTP code returned for type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest +const GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequestCode int = 400 + +/*GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest Internal error + +swagger:response getDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest +*/ +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest struct { +} + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest creates GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest with default headers values +func NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest() *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest { + + return &GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest{} +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_ethernet_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_ethernet_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..3337a42b19f3e07f135087a3d4cd7e0b160f1083 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_ethernet_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL generates an URL for the get data waveserver interfaces physical interface name properties ethernet operation +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) WithBasePath(bp string) *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/properties/ethernet/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_management.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_management.go new file mode 100644 index 0000000000000000000000000000000000000000..0536a918cd3428b04ab67ce2707597a8fb33f607 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_management.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc turns a function with the right signature into a get data waveserver interfaces physical interface name properties management handler +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc func(GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc) Handle(params GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder { + return fn(params) +} + +// GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler interface for that can handle valid get data waveserver interfaces physical interface name properties management params +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler interface { + Handle(GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder +} + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement creates a new http.Handler for the get data waveserver interfaces physical interface name properties management operation +func NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement(ctx *middleware.Context, handler GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler) *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement { + return &GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement{Context: ctx, Handler: handler} +} + +/*GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement swagger:route GET /data/waveserver-interfaces/physical-interface={name}/properties/management/ ciena-waveserver-interfaces getDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement + +returns ciena.waveserver.interfaces.ManagementIfPropertiesGroup + +Management interface attributes. + +*/ +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement struct { + Context *middleware.Context + Handler GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler +} + +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_management_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_management_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..f94c0bc2ad8d0eeba6bdec8342baf8cad89ee2f1 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_management_parameters.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams creates a new GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams object +// no default values defined in spec. +func NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams() GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams { + + return GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams{} +} + +// GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams contains all the bound params for the get data waveserver interfaces physical interface name properties management operation +// typically these are obtained from a http.Request +// +// swagger:parameters GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams() beforehand. +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_management_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_management_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..94208807a66263a131874411b12030ebd5c44422 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_management_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementOKCode is the HTTP code returned for type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementOK +const GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementOKCode int = 200 + +/*GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementOK ciena.waveserver.interfaces.ManagementIfPropertiesGroup + +swagger:response getDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementOK +*/ +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementOK struct { + + /* + In: Body + */ + Payload *models.CienaWaveserverInterfacesManagementIfPropertiesGroupWrapper `json:"body,omitempty"` +} + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementOK creates GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementOK with default headers values +func NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementOK() *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementOK { + + return &GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementOK{} +} + +// WithPayload adds the payload to the get data waveserver interfaces physical interface name properties management o k response +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementOK) WithPayload(payload *models.CienaWaveserverInterfacesManagementIfPropertiesGroupWrapper) *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get data waveserver interfaces physical interface name properties management o k response +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementOK) SetPayload(payload *models.CienaWaveserverInterfacesManagementIfPropertiesGroupWrapper) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequestCode is the HTTP code returned for type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest +const GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequestCode int = 400 + +/*GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest Internal error + +swagger:response getDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest +*/ +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest struct { +} + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest creates GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest with default headers values +func NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest() *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest { + + return &GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest{} +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_management_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_management_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..c3a8914a31d8a3628342db40f37304d0cb0f28fa --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_management_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL generates an URL for the get data waveserver interfaces physical interface name properties management operation +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) WithBasePath(bp string) *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/properties/management/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..4700cb7931187dc9a76d1d8ccddb576767a9c27f --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_parameters.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams creates a new GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams object +// no default values defined in spec. +func NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams() GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams { + + return GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams{} +} + +// GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams contains all the bound params for the get data waveserver interfaces physical interface name properties operation +// typically these are obtained from a http.Request +// +// swagger:parameters GetDataWaveserverInterfacesPhysicalInterfaceNameProperties +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams() beforehand. +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..80a423cd248e46f3509a71dcdda23fbfa3ffc5ec --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesOKCode is the HTTP code returned for type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesOK +const GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesOKCode int = 200 + +/*GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesOK ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties + +swagger:response getDataWaveserverInterfacesPhysicalInterfaceNamePropertiesOK +*/ +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesOK struct { + + /* + In: Body + */ + Payload *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesWrapper `json:"body,omitempty"` +} + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesOK creates GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesOK with default headers values +func NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesOK() *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesOK { + + return &GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesOK{} +} + +// WithPayload adds the payload to the get data waveserver interfaces physical interface name properties o k response +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesOK) WithPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesWrapper) *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get data waveserver interfaces physical interface name properties o k response +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesOK) SetPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesWrapper) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequestCode is the HTTP code returned for type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest +const GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequestCode int = 400 + +/*GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest Internal error + +swagger:response getDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest +*/ +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest struct { +} + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest creates GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest with default headers values +func NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest() *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest { + + return &GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest{} +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..cdffcb5b878e411f6b1fab6997677a117b72d400 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_properties_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL generates an URL for the get data waveserver interfaces physical interface name properties operation +type GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) WithBasePath(bp string) *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/properties/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..51d92424348e8f7cc9eade4e42864d819558565d --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// GetDataWaveserverInterfacesPhysicalInterfaceNameOKCode is the HTTP code returned for type GetDataWaveserverInterfacesPhysicalInterfaceNameOK +const GetDataWaveserverInterfacesPhysicalInterfaceNameOKCode int = 200 + +/*GetDataWaveserverInterfacesPhysicalInterfaceNameOK ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface + +swagger:response getDataWaveserverInterfacesPhysicalInterfaceNameOK +*/ +type GetDataWaveserverInterfacesPhysicalInterfaceNameOK struct { + + /* + In: Body + */ + Payload *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceWrapper `json:"body,omitempty"` +} + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNameOK creates GetDataWaveserverInterfacesPhysicalInterfaceNameOK with default headers values +func NewGetDataWaveserverInterfacesPhysicalInterfaceNameOK() *GetDataWaveserverInterfacesPhysicalInterfaceNameOK { + + return &GetDataWaveserverInterfacesPhysicalInterfaceNameOK{} +} + +// WithPayload adds the payload to the get data waveserver interfaces physical interface name o k response +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameOK) WithPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceWrapper) *GetDataWaveserverInterfacesPhysicalInterfaceNameOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get data waveserver interfaces physical interface name o k response +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameOK) SetPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceWrapper) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDataWaveserverInterfacesPhysicalInterfaceNameBadRequestCode is the HTTP code returned for type GetDataWaveserverInterfacesPhysicalInterfaceNameBadRequest +const GetDataWaveserverInterfacesPhysicalInterfaceNameBadRequestCode int = 400 + +/*GetDataWaveserverInterfacesPhysicalInterfaceNameBadRequest Internal error + +swagger:response getDataWaveserverInterfacesPhysicalInterfaceNameBadRequest +*/ +type GetDataWaveserverInterfacesPhysicalInterfaceNameBadRequest struct { +} + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNameBadRequest creates GetDataWaveserverInterfacesPhysicalInterfaceNameBadRequest with default headers values +func NewGetDataWaveserverInterfacesPhysicalInterfaceNameBadRequest() *GetDataWaveserverInterfacesPhysicalInterfaceNameBadRequest { + + return &GetDataWaveserverInterfacesPhysicalInterfaceNameBadRequest{} +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_state.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_state.go new file mode 100644 index 0000000000000000000000000000000000000000..128d8cf4d42f21eb8a8e24789b6b63c925a8597d --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_state.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc turns a function with the right signature into a get data waveserver interfaces physical interface name state handler +type GetDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc func(GetDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc) Handle(params GetDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder { + return fn(params) +} + +// GetDataWaveserverInterfacesPhysicalInterfaceNameStateHandler interface for that can handle valid get data waveserver interfaces physical interface name state params +type GetDataWaveserverInterfacesPhysicalInterfaceNameStateHandler interface { + Handle(GetDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder +} + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNameState creates a new http.Handler for the get data waveserver interfaces physical interface name state operation +func NewGetDataWaveserverInterfacesPhysicalInterfaceNameState(ctx *middleware.Context, handler GetDataWaveserverInterfacesPhysicalInterfaceNameStateHandler) *GetDataWaveserverInterfacesPhysicalInterfaceNameState { + return &GetDataWaveserverInterfacesPhysicalInterfaceNameState{Context: ctx, Handler: handler} +} + +/*GetDataWaveserverInterfacesPhysicalInterfaceNameState swagger:route GET /data/waveserver-interfaces/physical-interface={name}/state/ ciena-waveserver-interfaces getDataWaveserverInterfacesPhysicalInterfaceNameState + +returns ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State + +Physical management interface state information. + +*/ +type GetDataWaveserverInterfacesPhysicalInterfaceNameState struct { + Context *middleware.Context + Handler GetDataWaveserverInterfacesPhysicalInterfaceNameStateHandler +} + +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameState) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewGetDataWaveserverInterfacesPhysicalInterfaceNameStateParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_state_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_state_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..59b66f364003868997712c8094cc2a4b5a3c1839 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_state_parameters.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNameStateParams creates a new GetDataWaveserverInterfacesPhysicalInterfaceNameStateParams object +// no default values defined in spec. +func NewGetDataWaveserverInterfacesPhysicalInterfaceNameStateParams() GetDataWaveserverInterfacesPhysicalInterfaceNameStateParams { + + return GetDataWaveserverInterfacesPhysicalInterfaceNameStateParams{} +} + +// GetDataWaveserverInterfacesPhysicalInterfaceNameStateParams contains all the bound params for the get data waveserver interfaces physical interface name state operation +// typically these are obtained from a http.Request +// +// swagger:parameters GetDataWaveserverInterfacesPhysicalInterfaceNameState +type GetDataWaveserverInterfacesPhysicalInterfaceNameStateParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetDataWaveserverInterfacesPhysicalInterfaceNameStateParams() beforehand. +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameStateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameStateParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_state_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_state_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..5f142a37d2217ad47396b90f111a76a97f382e32 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_state_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// GetDataWaveserverInterfacesPhysicalInterfaceNameStateOKCode is the HTTP code returned for type GetDataWaveserverInterfacesPhysicalInterfaceNameStateOK +const GetDataWaveserverInterfacesPhysicalInterfaceNameStateOKCode int = 200 + +/*GetDataWaveserverInterfacesPhysicalInterfaceNameStateOK ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State + +swagger:response getDataWaveserverInterfacesPhysicalInterfaceNameStateOK +*/ +type GetDataWaveserverInterfacesPhysicalInterfaceNameStateOK struct { + + /* + In: Body + */ + Payload *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateWrapper `json:"body,omitempty"` +} + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNameStateOK creates GetDataWaveserverInterfacesPhysicalInterfaceNameStateOK with default headers values +func NewGetDataWaveserverInterfacesPhysicalInterfaceNameStateOK() *GetDataWaveserverInterfacesPhysicalInterfaceNameStateOK { + + return &GetDataWaveserverInterfacesPhysicalInterfaceNameStateOK{} +} + +// WithPayload adds the payload to the get data waveserver interfaces physical interface name state o k response +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameStateOK) WithPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateWrapper) *GetDataWaveserverInterfacesPhysicalInterfaceNameStateOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get data waveserver interfaces physical interface name state o k response +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameStateOK) SetPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateWrapper) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameStateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequestCode is the HTTP code returned for type GetDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest +const GetDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequestCode int = 400 + +/*GetDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest Internal error + +swagger:response getDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest +*/ +type GetDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest struct { +} + +// NewGetDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest creates GetDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest with default headers values +func NewGetDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest() *GetDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest { + + return &GetDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest{} +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_state_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_state_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..14e9c972fbab6403553c5a9a664fa952f6419d1f --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_state_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetDataWaveserverInterfacesPhysicalInterfaceNameStateURL generates an URL for the get data waveserver interfaces physical interface name state operation +type GetDataWaveserverInterfacesPhysicalInterfaceNameStateURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameStateURL) WithBasePath(bp string) *GetDataWaveserverInterfacesPhysicalInterfaceNameStateURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameStateURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameStateURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/state/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on GetDataWaveserverInterfacesPhysicalInterfaceNameStateURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameStateURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameStateURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameStateURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetDataWaveserverInterfacesPhysicalInterfaceNameStateURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetDataWaveserverInterfacesPhysicalInterfaceNameStateURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameStateURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..119b7267bd828dc11c24840e4c030703e58f0f34 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_physical_interface_name_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetDataWaveserverInterfacesPhysicalInterfaceNameURL generates an URL for the get data waveserver interfaces physical interface name operation +type GetDataWaveserverInterfacesPhysicalInterfaceNameURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameURL) WithBasePath(bp string) *GetDataWaveserverInterfacesPhysicalInterfaceNameURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on GetDataWaveserverInterfacesPhysicalInterfaceNameURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetDataWaveserverInterfacesPhysicalInterfaceNameURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetDataWaveserverInterfacesPhysicalInterfaceNameURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetDataWaveserverInterfacesPhysicalInterfaceNameURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..3dd563f40bb42a20d100c23e8cd3e5ae49e0a3a2 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// GetDataWaveserverInterfacesOKCode is the HTTP code returned for type GetDataWaveserverInterfacesOK +const GetDataWaveserverInterfacesOKCode int = 200 + +/*GetDataWaveserverInterfacesOK ciena.waveserver.interfaces.WaveserverInterfaces + +swagger:response getDataWaveserverInterfacesOK +*/ +type GetDataWaveserverInterfacesOK struct { + + /* + In: Body + */ + Payload *models.CienaWaveserverInterfacesWaveserverInterfacesWrapper `json:"body,omitempty"` +} + +// NewGetDataWaveserverInterfacesOK creates GetDataWaveserverInterfacesOK with default headers values +func NewGetDataWaveserverInterfacesOK() *GetDataWaveserverInterfacesOK { + + return &GetDataWaveserverInterfacesOK{} +} + +// WithPayload adds the payload to the get data waveserver interfaces o k response +func (o *GetDataWaveserverInterfacesOK) WithPayload(payload *models.CienaWaveserverInterfacesWaveserverInterfacesWrapper) *GetDataWaveserverInterfacesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get data waveserver interfaces o k response +func (o *GetDataWaveserverInterfacesOK) SetPayload(payload *models.CienaWaveserverInterfacesWaveserverInterfacesWrapper) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDataWaveserverInterfacesBadRequestCode is the HTTP code returned for type GetDataWaveserverInterfacesBadRequest +const GetDataWaveserverInterfacesBadRequestCode int = 400 + +/*GetDataWaveserverInterfacesBadRequest Internal error + +swagger:response getDataWaveserverInterfacesBadRequest +*/ +type GetDataWaveserverInterfacesBadRequest struct { +} + +// NewGetDataWaveserverInterfacesBadRequest creates GetDataWaveserverInterfacesBadRequest with default headers values +func NewGetDataWaveserverInterfacesBadRequest() *GetDataWaveserverInterfacesBadRequest { + + return &GetDataWaveserverInterfacesBadRequest{} +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes.go new file mode 100644 index 0000000000000000000000000000000000000000..c83bce9e12f7aaa4591ff18dacd69499a4999e81 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetDataWaveserverInterfacesRoutesHandlerFunc turns a function with the right signature into a get data waveserver interfaces routes handler +type GetDataWaveserverInterfacesRoutesHandlerFunc func(GetDataWaveserverInterfacesRoutesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetDataWaveserverInterfacesRoutesHandlerFunc) Handle(params GetDataWaveserverInterfacesRoutesParams) middleware.Responder { + return fn(params) +} + +// GetDataWaveserverInterfacesRoutesHandler interface for that can handle valid get data waveserver interfaces routes params +type GetDataWaveserverInterfacesRoutesHandler interface { + Handle(GetDataWaveserverInterfacesRoutesParams) middleware.Responder +} + +// NewGetDataWaveserverInterfacesRoutes creates a new http.Handler for the get data waveserver interfaces routes operation +func NewGetDataWaveserverInterfacesRoutes(ctx *middleware.Context, handler GetDataWaveserverInterfacesRoutesHandler) *GetDataWaveserverInterfacesRoutes { + return &GetDataWaveserverInterfacesRoutes{Context: ctx, Handler: handler} +} + +/*GetDataWaveserverInterfacesRoutes swagger:route GET /data/waveserver-interfaces/routes/ ciena-waveserver-interfaces getDataWaveserverInterfacesRoutes + +returns ciena.waveserver.interfaces.waveserverinterfaces.Routes + +Top-level container for IP route configuration and operational data. + +*/ +type GetDataWaveserverInterfacesRoutes struct { + Context *middleware.Context + Handler GetDataWaveserverInterfacesRoutesHandler +} + +func (o *GetDataWaveserverInterfacesRoutes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewGetDataWaveserverInterfacesRoutesParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination.go new file mode 100644 index 0000000000000000000000000000000000000000..05ebf005728dd047d3a9011e321906cefdcb14c5 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandlerFunc turns a function with the right signature into a get data waveserver interfaces routes IP v4 static route destination handler +type GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandlerFunc func(GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandlerFunc) Handle(params GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) middleware.Responder { + return fn(params) +} + +// GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler interface for that can handle valid get data waveserver interfaces routes IP v4 static route destination params +type GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler interface { + Handle(GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) middleware.Responder +} + +// NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestination creates a new http.Handler for the get data waveserver interfaces routes IP v4 static route destination operation +func NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestination(ctx *middleware.Context, handler GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler) *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestination { + return &GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestination{Context: ctx, Handler: handler} +} + +/*GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestination swagger:route GET /data/waveserver-interfaces/routes/ipv4-static-route={destination}/ ciena-waveserver-interfaces getDataWaveserverInterfacesRoutesIpV4StaticRouteDestination + +returns ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute + +List of IPv4 static routing entries. + +*/ +type GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestination struct { + Context *middleware.Context + Handler GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler +} + +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestination) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index.go new file mode 100644 index 0000000000000000000000000000000000000000..880e62db86d9b3368c555ed71b4b2089c0636baa --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandlerFunc turns a function with the right signature into a get data waveserver interfaces routes IP v4 static route destination next hop index handler +type GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandlerFunc func(GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandlerFunc) Handle(params GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) middleware.Responder { + return fn(params) +} + +// GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler interface for that can handle valid get data waveserver interfaces routes IP v4 static route destination next hop index params +type GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler interface { + Handle(GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) middleware.Responder +} + +// NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex creates a new http.Handler for the get data waveserver interfaces routes IP v4 static route destination next hop index operation +func NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex(ctx *middleware.Context, handler GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler) *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex { + return &GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex{Context: ctx, Handler: handler} +} + +/*GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex swagger:route GET /data/waveserver-interfaces/routes/ipv4-static-route={destination}/next-hop={index}/ ciena-waveserver-interfaces getDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationNextHopIndex + +returns ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop + +A list of next-hop entries associated with the static route. + +*/ +type GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex struct { + Context *middleware.Context + Handler GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler +} + +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..5cf2042604f02bdc7dd746e16540c4b2d10d5191 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_parameters.go @@ -0,0 +1,102 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams creates a new GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams object +// no default values defined in spec. +func NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams() GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams { + + return GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams{} +} + +// GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams contains all the bound params for the get data waveserver interfaces routes IP v4 static route destination next hop index operation +// typically these are obtained from a http.Request +// +// swagger:parameters GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex +type GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of ipv4-static-route + Required: true + In: path + */ + Destination string + /*Id of next-hop + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams() beforehand. +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rDestination, rhkDestination, _ := route.Params.GetOK("destination") + if err := o.bindDestination(rDestination, rhkDestination, route.Formats); err != nil { + res = append(res, err) + } + + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindDestination binds and validates parameter Destination from path. +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) bindDestination(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Destination = raw + + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..3eead84bc47d2a7e4e5701f6c032cafbece8a719 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexOKCode is the HTTP code returned for type GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexOK +const GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexOKCode int = 200 + +/*GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexOK ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop + +swagger:response getDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationNextHopIndexOK +*/ +type GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexOK struct { + + /* + In: Body + */ + Payload *models.CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopWrapper `json:"body,omitempty"` +} + +// NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexOK creates GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexOK with default headers values +func NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexOK() *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexOK { + + return &GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexOK{} +} + +// WithPayload adds the payload to the get data waveserver interfaces routes Ip v4 static route destination next hop index o k response +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexOK) WithPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopWrapper) *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get data waveserver interfaces routes Ip v4 static route destination next hop index o k response +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexOK) SetPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopWrapper) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequestCode is the HTTP code returned for type GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest +const GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequestCode int = 400 + +/*GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest Internal error + +swagger:response getDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationNextHopIndexBadRequest +*/ +type GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest struct { +} + +// NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest creates GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest with default headers values +func NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest() *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest { + + return &GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest{} +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..f21c3486c3a016bba11966db57bb576831316c6c --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_urlbuilder.go @@ -0,0 +1,106 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL generates an URL for the get data waveserver interfaces routes IP v4 static route destination next hop index operation +type GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL struct { + Destination string + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) WithBasePath(bp string) *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/routes/ipv4-static-route={destination}/next-hop={index}/" + + destination := o.Destination + if destination != "" { + _path = strings.Replace(_path, "{destination}", destination, -1) + } else { + return nil, errors.New("destination is required on GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL") + } + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..791d7c6606feb6bcfa33f6410b7c8db744694887 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_parameters.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams creates a new GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams object +// no default values defined in spec. +func NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams() GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams { + + return GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams{} +} + +// GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams contains all the bound params for the get data waveserver interfaces routes IP v4 static route destination operation +// typically these are obtained from a http.Request +// +// swagger:parameters GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestination +type GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Id of ipv4-static-route + Required: true + In: path + */ + Destination string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams() beforehand. +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rDestination, rhkDestination, _ := route.Params.GetOK("destination") + if err := o.bindDestination(rDestination, rhkDestination, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindDestination binds and validates parameter Destination from path. +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) bindDestination(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Destination = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..44e61cf4fdbb8fca3a7991e834fc80188442ce29 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationOKCode is the HTTP code returned for type GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationOK +const GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationOKCode int = 200 + +/*GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationOK ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute + +swagger:response getDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationOK +*/ +type GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationOK struct { + + /* + In: Body + */ + Payload *models.CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRouteWrapper `json:"body,omitempty"` +} + +// NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationOK creates GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationOK with default headers values +func NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationOK() *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationOK { + + return &GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationOK{} +} + +// WithPayload adds the payload to the get data waveserver interfaces routes Ip v4 static route destination o k response +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationOK) WithPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRouteWrapper) *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get data waveserver interfaces routes Ip v4 static route destination o k response +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationOK) SetPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRouteWrapper) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequestCode is the HTTP code returned for type GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest +const GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequestCode int = 400 + +/*GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest Internal error + +swagger:response getDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationBadRequest +*/ +type GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest struct { +} + +// NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest creates GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest with default headers values +func NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest() *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest { + + return &GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest{} +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..1e6acd426d2f8299ebe22ffb41356f3b720008d2 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_ip_v4_static_route_destination_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL generates an URL for the get data waveserver interfaces routes IP v4 static route destination operation +type GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL struct { + Destination string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) WithBasePath(bp string) *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/routes/ipv4-static-route={destination}/" + + destination := o.Destination + if destination != "" { + _path = strings.Replace(_path, "{destination}", destination, -1) + } else { + return nil, errors.New("destination is required on GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..9d54415f3418fc205b89ca108e28720732dd7d9d --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_parameters.go @@ -0,0 +1,45 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewGetDataWaveserverInterfacesRoutesParams creates a new GetDataWaveserverInterfacesRoutesParams object +// no default values defined in spec. +func NewGetDataWaveserverInterfacesRoutesParams() GetDataWaveserverInterfacesRoutesParams { + + return GetDataWaveserverInterfacesRoutesParams{} +} + +// GetDataWaveserverInterfacesRoutesParams contains all the bound params for the get data waveserver interfaces routes operation +// typically these are obtained from a http.Request +// +// swagger:parameters GetDataWaveserverInterfacesRoutes +type GetDataWaveserverInterfacesRoutesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetDataWaveserverInterfacesRoutesParams() beforehand. +func (o *GetDataWaveserverInterfacesRoutesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..2dbd56a6c2f3c8d00ac8e23aa01d2e1f40fefd9a --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// GetDataWaveserverInterfacesRoutesOKCode is the HTTP code returned for type GetDataWaveserverInterfacesRoutesOK +const GetDataWaveserverInterfacesRoutesOKCode int = 200 + +/*GetDataWaveserverInterfacesRoutesOK ciena.waveserver.interfaces.waveserverinterfaces.Routes + +swagger:response getDataWaveserverInterfacesRoutesOK +*/ +type GetDataWaveserverInterfacesRoutesOK struct { + + /* + In: Body + */ + Payload *models.CienaWaveserverInterfacesWaveserverinterfacesRoutesWrapper `json:"body,omitempty"` +} + +// NewGetDataWaveserverInterfacesRoutesOK creates GetDataWaveserverInterfacesRoutesOK with default headers values +func NewGetDataWaveserverInterfacesRoutesOK() *GetDataWaveserverInterfacesRoutesOK { + + return &GetDataWaveserverInterfacesRoutesOK{} +} + +// WithPayload adds the payload to the get data waveserver interfaces routes o k response +func (o *GetDataWaveserverInterfacesRoutesOK) WithPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesRoutesWrapper) *GetDataWaveserverInterfacesRoutesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get data waveserver interfaces routes o k response +func (o *GetDataWaveserverInterfacesRoutesOK) SetPayload(payload *models.CienaWaveserverInterfacesWaveserverinterfacesRoutesWrapper) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesRoutesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDataWaveserverInterfacesRoutesBadRequestCode is the HTTP code returned for type GetDataWaveserverInterfacesRoutesBadRequest +const GetDataWaveserverInterfacesRoutesBadRequestCode int = 400 + +/*GetDataWaveserverInterfacesRoutesBadRequest Internal error + +swagger:response getDataWaveserverInterfacesRoutesBadRequest +*/ +type GetDataWaveserverInterfacesRoutesBadRequest struct { +} + +// NewGetDataWaveserverInterfacesRoutesBadRequest creates GetDataWaveserverInterfacesRoutesBadRequest with default headers values +func NewGetDataWaveserverInterfacesRoutesBadRequest() *GetDataWaveserverInterfacesRoutesBadRequest { + + return &GetDataWaveserverInterfacesRoutesBadRequest{} +} + +// WriteResponse to the client +func (o *GetDataWaveserverInterfacesRoutesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/restapi/operations/interface_operations/get_h_w_addresses_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_urlbuilder.go similarity index 62% rename from restapi/operations/interface_operations/get_h_w_addresses_urlbuilder.go rename to waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_urlbuilder.go index 735ae77ae5e70f2e3a3a6227c496214dfd836014..2f66842042fe97d8526a1b65ebbc5ae592a5d537 100644 --- a/restapi/operations/interface_operations/get_h_w_addresses_urlbuilder.go +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_routes_urlbuilder.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package interface_operations +package ciena_waveserver_interfaces // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the generate command @@ -9,22 +9,17 @@ import ( "errors" "net/url" golangswaggerpaths "path" - "strings" ) -// GetHWAddressesURL generates an URL for the get h w addresses operation -type GetHWAddressesURL struct { - Interface string - +// GetDataWaveserverInterfacesRoutesURL generates an URL for the get data waveserver interfaces routes operation +type GetDataWaveserverInterfacesRoutesURL struct { _basePath string - // avoid unkeyed usage - _ struct{} } // WithBasePath sets the base path for this url builder, only required when it's different from the // base path specified in the swagger spec. // When the value of the base path is an empty string -func (o *GetHWAddressesURL) WithBasePath(bp string) *GetHWAddressesURL { +func (o *GetDataWaveserverInterfacesRoutesURL) WithBasePath(bp string) *GetDataWaveserverInterfacesRoutesURL { o.SetBasePath(bp) return o } @@ -32,34 +27,24 @@ func (o *GetHWAddressesURL) WithBasePath(bp string) *GetHWAddressesURL { // SetBasePath sets the base path for this url builder, only required when it's different from the // base path specified in the swagger spec. // When the value of the base path is an empty string -func (o *GetHWAddressesURL) SetBasePath(bp string) { +func (o *GetDataWaveserverInterfacesRoutesURL) SetBasePath(bp string) { o._basePath = bp } // Build a url path and query string -func (o *GetHWAddressesURL) Build() (*url.URL, error) { +func (o *GetDataWaveserverInterfacesRoutesURL) Build() (*url.URL, error) { var _result url.URL - var _path = "/data/cocsn-interface/{interface}/mac-address" - - interfaceVar := o.Interface - if interfaceVar != "" { - _path = strings.Replace(_path, "{interface}", interfaceVar, -1) - } else { - return nil, errors.New("interface is required on GetHWAddressesURL") - } + var _path = "/data/waveserver-interfaces/routes/" _basePath := o._basePath - if _basePath == "" { - _basePath = "/restconf" - } _result.Path = golangswaggerpaths.Join(_basePath, _path) return &_result, nil } // Must is a helper function to panic when the url builder returns an error -func (o *GetHWAddressesURL) Must(u *url.URL, err error) *url.URL { +func (o *GetDataWaveserverInterfacesRoutesURL) Must(u *url.URL, err error) *url.URL { if err != nil { panic(err) } @@ -70,17 +55,17 @@ func (o *GetHWAddressesURL) Must(u *url.URL, err error) *url.URL { } // String returns the string representation of the path with query string -func (o *GetHWAddressesURL) String() string { +func (o *GetDataWaveserverInterfacesRoutesURL) String() string { return o.Must(o.Build()).String() } // BuildFull builds a full url with scheme, host, path and query string -func (o *GetHWAddressesURL) BuildFull(scheme, host string) (*url.URL, error) { +func (o *GetDataWaveserverInterfacesRoutesURL) BuildFull(scheme, host string) (*url.URL, error) { if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetHWAddressesURL") + return nil, errors.New("scheme is required for a full url on GetDataWaveserverInterfacesRoutesURL") } if host == "" { - return nil, errors.New("host is required for a full url on GetHWAddressesURL") + return nil, errors.New("host is required for a full url on GetDataWaveserverInterfacesRoutesURL") } base, err := o.Build() @@ -94,6 +79,6 @@ func (o *GetHWAddressesURL) BuildFull(scheme, host string) (*url.URL, error) { } // StringFull returns the string representation of a complete url -func (o *GetHWAddressesURL) StringFull(scheme, host string) string { +func (o *GetDataWaveserverInterfacesRoutesURL) StringFull(scheme, host string) string { return o.Must(o.BuildFull(scheme, host)).String() } diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..4774e577765caa336a21c2b26065f11d46342573 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/get_data_waveserver_interfaces_urlbuilder.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// GetDataWaveserverInterfacesURL generates an URL for the get data waveserver interfaces operation +type GetDataWaveserverInterfacesURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesURL) WithBasePath(bp string) *GetDataWaveserverInterfacesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDataWaveserverInterfacesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetDataWaveserverInterfacesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/" + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetDataWaveserverInterfacesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetDataWaveserverInterfacesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetDataWaveserverInterfacesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetDataWaveserverInterfacesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetDataWaveserverInterfacesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetDataWaveserverInterfacesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces.go new file mode 100644 index 0000000000000000000000000000000000000000..a0b58bf8b46d3dda4410df0e6533e187f1b93bfd --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PostDataWaveserverInterfacesHandlerFunc turns a function with the right signature into a post data waveserver interfaces handler +type PostDataWaveserverInterfacesHandlerFunc func(PostDataWaveserverInterfacesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PostDataWaveserverInterfacesHandlerFunc) Handle(params PostDataWaveserverInterfacesParams) middleware.Responder { + return fn(params) +} + +// PostDataWaveserverInterfacesHandler interface for that can handle valid post data waveserver interfaces params +type PostDataWaveserverInterfacesHandler interface { + Handle(PostDataWaveserverInterfacesParams) middleware.Responder +} + +// NewPostDataWaveserverInterfaces creates a new http.Handler for the post data waveserver interfaces operation +func NewPostDataWaveserverInterfaces(ctx *middleware.Context, handler PostDataWaveserverInterfacesHandler) *PostDataWaveserverInterfaces { + return &PostDataWaveserverInterfaces{Context: ctx, Handler: handler} +} + +/*PostDataWaveserverInterfaces swagger:route POST /data/waveserver-interfaces/ ciena-waveserver-interfaces postDataWaveserverInterfaces + +creates ciena.waveserver.interfaces.WaveserverInterfaces + +Top level container for configuration and operational data for physical + and logical network interfaces. + +*/ +type PostDataWaveserverInterfaces struct { + Context *middleware.Context + Handler PostDataWaveserverInterfacesHandler +} + +func (o *PostDataWaveserverInterfaces) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPostDataWaveserverInterfacesParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface.go new file mode 100644 index 0000000000000000000000000000000000000000..616594623fcbfe0b6b78116303c0ff80cd909365 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PostDataWaveserverInterfacesLogicalInterfaceHandlerFunc turns a function with the right signature into a post data waveserver interfaces logical interface handler +type PostDataWaveserverInterfacesLogicalInterfaceHandlerFunc func(PostDataWaveserverInterfacesLogicalInterfaceParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PostDataWaveserverInterfacesLogicalInterfaceHandlerFunc) Handle(params PostDataWaveserverInterfacesLogicalInterfaceParams) middleware.Responder { + return fn(params) +} + +// PostDataWaveserverInterfacesLogicalInterfaceHandler interface for that can handle valid post data waveserver interfaces logical interface params +type PostDataWaveserverInterfacesLogicalInterfaceHandler interface { + Handle(PostDataWaveserverInterfacesLogicalInterfaceParams) middleware.Responder +} + +// NewPostDataWaveserverInterfacesLogicalInterface creates a new http.Handler for the post data waveserver interfaces logical interface operation +func NewPostDataWaveserverInterfacesLogicalInterface(ctx *middleware.Context, handler PostDataWaveserverInterfacesLogicalInterfaceHandler) *PostDataWaveserverInterfacesLogicalInterface { + return &PostDataWaveserverInterfacesLogicalInterface{Context: ctx, Handler: handler} +} + +/*PostDataWaveserverInterfacesLogicalInterface swagger:route POST /data/waveserver-interfaces/logical-interface/ ciena-waveserver-interfaces postDataWaveserverInterfacesLogicalInterface + +creates ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface + +List of logical IP management interfaces (e.g. 'local'). + +*/ +type PostDataWaveserverInterfacesLogicalInterface struct { + Context *middleware.Context + Handler PostDataWaveserverInterfacesLogicalInterfaceHandler +} + +func (o *PostDataWaveserverInterfacesLogicalInterface) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPostDataWaveserverInterfacesLogicalInterfaceParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_id.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_id.go new file mode 100644 index 0000000000000000000000000000000000000000..25bf907081f8377be8916108f1386b3aed0b47bd --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_id.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PostDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc turns a function with the right signature into a post data waveserver interfaces logical interface index ID handler +type PostDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc func(PostDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PostDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc) Handle(params PostDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder { + return fn(params) +} + +// PostDataWaveserverInterfacesLogicalInterfaceIndexIDHandler interface for that can handle valid post data waveserver interfaces logical interface index ID params +type PostDataWaveserverInterfacesLogicalInterfaceIndexIDHandler interface { + Handle(PostDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexID creates a new http.Handler for the post data waveserver interfaces logical interface index ID operation +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexID(ctx *middleware.Context, handler PostDataWaveserverInterfacesLogicalInterfaceIndexIDHandler) *PostDataWaveserverInterfacesLogicalInterfaceIndexID { + return &PostDataWaveserverInterfacesLogicalInterfaceIndexID{Context: ctx, Handler: handler} +} + +/*PostDataWaveserverInterfacesLogicalInterfaceIndexID swagger:route POST /data/waveserver-interfaces/logical-interface={index}/id/ ciena-waveserver-interfaces postDataWaveserverInterfacesLogicalInterfaceIndexId + +creates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id + +Identification information of this logical management interface. + +*/ +type PostDataWaveserverInterfacesLogicalInterfaceIndexID struct { + Context *middleware.Context + Handler PostDataWaveserverInterfacesLogicalInterfaceIndexIDHandler +} + +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPostDataWaveserverInterfacesLogicalInterfaceIndexIDParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_id_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_id_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..47d955c40e1795f93e543f62c6bf36ffa1b1325e --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_id_parameters.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexIDParams creates a new PostDataWaveserverInterfacesLogicalInterfaceIndexIDParams object +// no default values defined in spec. +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexIDParams() PostDataWaveserverInterfacesLogicalInterfaceIndexIDParams { + + return PostDataWaveserverInterfacesLogicalInterfaceIndexIDParams{} +} + +// PostDataWaveserverInterfacesLogicalInterfaceIndexIDParams contains all the bound params for the post data waveserver interfaces logical interface index ID operation +// typically these are obtained from a http.Request +// +// swagger:parameters PostDataWaveserverInterfacesLogicalInterfaceIndexID +type PostDataWaveserverInterfacesLogicalInterfaceIndexIDParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id to be added to list + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIDBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIDWrapper + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPostDataWaveserverInterfacesLogicalInterfaceIndexIDParams() beforehand. +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIDWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIdBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIDBodyParam = &body + } + } + } + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexIDParams) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_id_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_id_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..1275d937b704bb359df1967fbf4b614d8d5d3382 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_id_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PostDataWaveserverInterfacesLogicalInterfaceIndexIDCreatedCode is the HTTP code returned for type PostDataWaveserverInterfacesLogicalInterfaceIndexIDCreated +const PostDataWaveserverInterfacesLogicalInterfaceIndexIDCreatedCode int = 201 + +/*PostDataWaveserverInterfacesLogicalInterfaceIndexIDCreated Object created + +swagger:response postDataWaveserverInterfacesLogicalInterfaceIndexIdCreated +*/ +type PostDataWaveserverInterfacesLogicalInterfaceIndexIDCreated struct { +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexIDCreated creates PostDataWaveserverInterfacesLogicalInterfaceIndexIDCreated with default headers values +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexIDCreated() *PostDataWaveserverInterfacesLogicalInterfaceIndexIDCreated { + + return &PostDataWaveserverInterfacesLogicalInterfaceIndexIDCreated{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexIDCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PostDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequestCode is the HTTP code returned for type PostDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest +const PostDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequestCode int = 400 + +/*PostDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest Internal error + +swagger:response postDataWaveserverInterfacesLogicalInterfaceIndexIdBadRequest +*/ +type PostDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest struct { +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest creates PostDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest with default headers values +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest() *PostDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest { + + return &PostDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// PostDataWaveserverInterfacesLogicalInterfaceIndexIDConflictCode is the HTTP code returned for type PostDataWaveserverInterfacesLogicalInterfaceIndexIDConflict +const PostDataWaveserverInterfacesLogicalInterfaceIndexIDConflictCode int = 409 + +/*PostDataWaveserverInterfacesLogicalInterfaceIndexIDConflict Object already exists + +swagger:response postDataWaveserverInterfacesLogicalInterfaceIndexIdConflict +*/ +type PostDataWaveserverInterfacesLogicalInterfaceIndexIDConflict struct { +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexIDConflict creates PostDataWaveserverInterfacesLogicalInterfaceIndexIDConflict with default headers values +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexIDConflict() *PostDataWaveserverInterfacesLogicalInterfaceIndexIDConflict { + + return &PostDataWaveserverInterfacesLogicalInterfaceIndexIDConflict{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexIDConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_id_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_id_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..cce5359b9ddbcf68ba7d4db2be9afc30e00eb90c --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_id_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// PostDataWaveserverInterfacesLogicalInterfaceIndexIDURL generates an URL for the post data waveserver interfaces logical interface index ID operation +type PostDataWaveserverInterfacesLogicalInterfaceIndexIDURL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexIDURL) WithBasePath(bp string) *PostDataWaveserverInterfacesLogicalInterfaceIndexIDURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexIDURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexIDURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/id/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on PostDataWaveserverInterfacesLogicalInterfaceIndexIDURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexIDURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexIDURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexIDURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PostDataWaveserverInterfacesLogicalInterfaceIndexIDURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PostDataWaveserverInterfacesLogicalInterfaceIndexIDURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexIDURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties.go new file mode 100644 index 0000000000000000000000000000000000000000..763b46daff0db8551cae5a2251089562bfea7d10 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc turns a function with the right signature into a post data waveserver interfaces logical interface index properties handler +type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc func(PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc) Handle(params PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder { + return fn(params) +} + +// PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler interface for that can handle valid post data waveserver interfaces logical interface index properties params +type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler interface { + Handle(PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexProperties creates a new http.Handler for the post data waveserver interfaces logical interface index properties operation +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexProperties(ctx *middleware.Context, handler PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler) *PostDataWaveserverInterfacesLogicalInterfaceIndexProperties { + return &PostDataWaveserverInterfacesLogicalInterfaceIndexProperties{Context: ctx, Handler: handler} +} + +/*PostDataWaveserverInterfacesLogicalInterfaceIndexProperties swagger:route POST /data/waveserver-interfaces/logical-interface={index}/properties/ ciena-waveserver-interfaces postDataWaveserverInterfacesLogicalInterfaceIndexProperties + +creates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties + +All the configuration data of the logical management interface. + +*/ +type PostDataWaveserverInterfacesLogicalInterfaceIndexProperties struct { + Context *middleware.Context + Handler PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler +} + +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexProperties) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_ip_v4.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_ip_v4.go new file mode 100644 index 0000000000000000000000000000000000000000..5835039aa852cfa8c1a478ec1327d72dd110f9b1 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_ip_v4.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc turns a function with the right signature into a post data waveserver interfaces logical interface index properties IP v4 handler +type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc func(PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder + +// Handle executing the request and returning a response +func (fn PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc) Handle(params PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder { + return fn(params) +} + +// PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler interface for that can handle valid post data waveserver interfaces logical interface index properties IP v4 params +type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler interface { + Handle(PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 creates a new http.Handler for the post data waveserver interfaces logical interface index properties IP v4 operation +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4(ctx *middleware.Context, handler PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler) *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 { + return &PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4{Context: ctx, Handler: handler} +} + +/*PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 swagger:route POST /data/waveserver-interfaces/logical-interface={index}/properties/ipv4/ ciena-waveserver-interfaces postDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIpV4 + +creates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4 + +IPv4 configuration and operational data. + +*/ +type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 struct { + Context *middleware.Context + Handler PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler +} + +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..854c392818b553797a653c67ef96a5962582e415 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_parameters.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params creates a new PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params object +// no default values defined in spec. +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params() PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params { + + return PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params{} +} + +// PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params contains all the bound params for the post data waveserver interfaces logical interface index properties IP v4 operation +// typically these are obtained from a http.Request +// +// swagger:parameters PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 +type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4 to be added to list + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4BodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4Wrapper + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params() beforehand. +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4Wrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIpv4BodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4BodyParam = &body + } + } + } + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..2fbf86669711d0f0b10103cd055c5708572efc38 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4CreatedCode is the HTTP code returned for type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Created +const PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4CreatedCode int = 201 + +/*PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Created Object created + +swagger:response postDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIpV4Created +*/ +type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Created struct { +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Created creates PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Created with default headers values +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Created() *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Created { + + return &PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Created{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Created) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequestCode is the HTTP code returned for type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest +const PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequestCode int = 400 + +/*PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest Internal error + +swagger:response postDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIpV4BadRequest +*/ +type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest struct { +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest creates PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest with default headers values +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest() *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest { + + return &PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4ConflictCode is the HTTP code returned for type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Conflict +const PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4ConflictCode int = 409 + +/*PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Conflict Object already exists + +swagger:response postDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIpV4Conflict +*/ +type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Conflict struct { +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Conflict creates PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Conflict with default headers values +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Conflict() *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Conflict { + + return &PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Conflict{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Conflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..0a1707528ec88113f710081cd35c6c5404ec6a27 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL generates an URL for the post data waveserver interfaces logical interface index properties IP v4 operation +type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) WithBasePath(bp string) *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/properties/ipv4/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..7500864f6d60ac26ba19c3d4c21692600e36f5e3 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_parameters.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams creates a new PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams object +// no default values defined in spec. +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams() PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams { + + return PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams{} +} + +// PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams contains all the bound params for the post data waveserver interfaces logical interface index properties operation +// typically these are obtained from a http.Request +// +// swagger:parameters PostDataWaveserverInterfacesLogicalInterfaceIndexProperties +type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties to be added to list + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesWrapper + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams() beforehand. +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesBodyParam = &body + } + } + } + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..8ce929f600fdb3763c7a6bb3df0f7e6f2a689730 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreatedCode is the HTTP code returned for type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated +const PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreatedCode int = 201 + +/*PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated Object created + +swagger:response postDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated +*/ +type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated struct { +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated creates PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated with default headers values +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated() *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated { + + return &PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequestCode is the HTTP code returned for type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest +const PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequestCode int = 400 + +/*PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest Internal error + +swagger:response postDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest +*/ +type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest struct { +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest creates PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest with default headers values +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest() *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest { + + return &PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesConflictCode is the HTTP code returned for type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesConflict +const PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesConflictCode int = 409 + +/*PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesConflict Object already exists + +swagger:response postDataWaveserverInterfacesLogicalInterfaceIndexPropertiesConflict +*/ +type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesConflict struct { +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesConflict creates PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesConflict with default headers values +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesConflict() *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesConflict { + + return &PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesConflict{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..e4f169ba81c583d27840b0ba4e4704f8c43c9752 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_properties_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL generates an URL for the post data waveserver interfaces logical interface index properties operation +type PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) WithBasePath(bp string) *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/properties/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_state.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_state.go new file mode 100644 index 0000000000000000000000000000000000000000..1243434280790ef1eeac14e7fe033d473c0f728d --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_state.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PostDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc turns a function with the right signature into a post data waveserver interfaces logical interface index state handler +type PostDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc func(PostDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PostDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc) Handle(params PostDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder { + return fn(params) +} + +// PostDataWaveserverInterfacesLogicalInterfaceIndexStateHandler interface for that can handle valid post data waveserver interfaces logical interface index state params +type PostDataWaveserverInterfacesLogicalInterfaceIndexStateHandler interface { + Handle(PostDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexState creates a new http.Handler for the post data waveserver interfaces logical interface index state operation +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexState(ctx *middleware.Context, handler PostDataWaveserverInterfacesLogicalInterfaceIndexStateHandler) *PostDataWaveserverInterfacesLogicalInterfaceIndexState { + return &PostDataWaveserverInterfacesLogicalInterfaceIndexState{Context: ctx, Handler: handler} +} + +/*PostDataWaveserverInterfacesLogicalInterfaceIndexState swagger:route POST /data/waveserver-interfaces/logical-interface={index}/state/ ciena-waveserver-interfaces postDataWaveserverInterfacesLogicalInterfaceIndexState + +creates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State + +Logical interface state information. + +*/ +type PostDataWaveserverInterfacesLogicalInterfaceIndexState struct { + Context *middleware.Context + Handler PostDataWaveserverInterfacesLogicalInterfaceIndexStateHandler +} + +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexState) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPostDataWaveserverInterfacesLogicalInterfaceIndexStateParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_state_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_state_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..009ad6e84a696d4cc264ada409e93b55026b6f5b --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_state_parameters.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexStateParams creates a new PostDataWaveserverInterfacesLogicalInterfaceIndexStateParams object +// no default values defined in spec. +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexStateParams() PostDataWaveserverInterfacesLogicalInterfaceIndexStateParams { + + return PostDataWaveserverInterfacesLogicalInterfaceIndexStateParams{} +} + +// PostDataWaveserverInterfacesLogicalInterfaceIndexStateParams contains all the bound params for the post data waveserver interfaces logical interface index state operation +// typically these are obtained from a http.Request +// +// swagger:parameters PostDataWaveserverInterfacesLogicalInterfaceIndexState +type PostDataWaveserverInterfacesLogicalInterfaceIndexStateParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State to be added to list + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateWrapper + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPostDataWaveserverInterfacesLogicalInterfaceIndexStateParams() beforehand. +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexStateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateBodyParam = &body + } + } + } + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexStateParams) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_state_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_state_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..247a7e83d7e13f13c572c3f4a6dace9af06e844e --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_state_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PostDataWaveserverInterfacesLogicalInterfaceIndexStateCreatedCode is the HTTP code returned for type PostDataWaveserverInterfacesLogicalInterfaceIndexStateCreated +const PostDataWaveserverInterfacesLogicalInterfaceIndexStateCreatedCode int = 201 + +/*PostDataWaveserverInterfacesLogicalInterfaceIndexStateCreated Object created + +swagger:response postDataWaveserverInterfacesLogicalInterfaceIndexStateCreated +*/ +type PostDataWaveserverInterfacesLogicalInterfaceIndexStateCreated struct { +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexStateCreated creates PostDataWaveserverInterfacesLogicalInterfaceIndexStateCreated with default headers values +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexStateCreated() *PostDataWaveserverInterfacesLogicalInterfaceIndexStateCreated { + + return &PostDataWaveserverInterfacesLogicalInterfaceIndexStateCreated{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexStateCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PostDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequestCode is the HTTP code returned for type PostDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest +const PostDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequestCode int = 400 + +/*PostDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest Internal error + +swagger:response postDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest +*/ +type PostDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest struct { +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest creates PostDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest with default headers values +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest() *PostDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest { + + return &PostDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// PostDataWaveserverInterfacesLogicalInterfaceIndexStateConflictCode is the HTTP code returned for type PostDataWaveserverInterfacesLogicalInterfaceIndexStateConflict +const PostDataWaveserverInterfacesLogicalInterfaceIndexStateConflictCode int = 409 + +/*PostDataWaveserverInterfacesLogicalInterfaceIndexStateConflict Object already exists + +swagger:response postDataWaveserverInterfacesLogicalInterfaceIndexStateConflict +*/ +type PostDataWaveserverInterfacesLogicalInterfaceIndexStateConflict struct { +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceIndexStateConflict creates PostDataWaveserverInterfacesLogicalInterfaceIndexStateConflict with default headers values +func NewPostDataWaveserverInterfacesLogicalInterfaceIndexStateConflict() *PostDataWaveserverInterfacesLogicalInterfaceIndexStateConflict { + + return &PostDataWaveserverInterfacesLogicalInterfaceIndexStateConflict{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexStateConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_state_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_state_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..60c971af5f408b5995eda556a205af3882c6b94c --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_index_state_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// PostDataWaveserverInterfacesLogicalInterfaceIndexStateURL generates an URL for the post data waveserver interfaces logical interface index state operation +type PostDataWaveserverInterfacesLogicalInterfaceIndexStateURL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexStateURL) WithBasePath(bp string) *PostDataWaveserverInterfacesLogicalInterfaceIndexStateURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexStateURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexStateURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/state/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on PostDataWaveserverInterfacesLogicalInterfaceIndexStateURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexStateURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexStateURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexStateURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PostDataWaveserverInterfacesLogicalInterfaceIndexStateURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PostDataWaveserverInterfacesLogicalInterfaceIndexStateURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PostDataWaveserverInterfacesLogicalInterfaceIndexStateURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c2930334e30e915ae2f7a831d65ebf9e5df6c435 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_parameters.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPostDataWaveserverInterfacesLogicalInterfaceParams creates a new PostDataWaveserverInterfacesLogicalInterfaceParams object +// no default values defined in spec. +func NewPostDataWaveserverInterfacesLogicalInterfaceParams() PostDataWaveserverInterfacesLogicalInterfaceParams { + + return PostDataWaveserverInterfacesLogicalInterfaceParams{} +} + +// PostDataWaveserverInterfacesLogicalInterfaceParams contains all the bound params for the post data waveserver interfaces logical interface operation +// typically these are obtained from a http.Request +// +// swagger:parameters PostDataWaveserverInterfacesLogicalInterface +type PostDataWaveserverInterfacesLogicalInterfaceParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface to be added to list + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceWrapper +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPostDataWaveserverInterfacesLogicalInterfaceParams() beforehand. +func (o *PostDataWaveserverInterfacesLogicalInterfaceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceBodyParam = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7af9539dda16197ce6f84749f33439c80ddd321c --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PostDataWaveserverInterfacesLogicalInterfaceCreatedCode is the HTTP code returned for type PostDataWaveserverInterfacesLogicalInterfaceCreated +const PostDataWaveserverInterfacesLogicalInterfaceCreatedCode int = 201 + +/*PostDataWaveserverInterfacesLogicalInterfaceCreated Object created + +swagger:response postDataWaveserverInterfacesLogicalInterfaceCreated +*/ +type PostDataWaveserverInterfacesLogicalInterfaceCreated struct { +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceCreated creates PostDataWaveserverInterfacesLogicalInterfaceCreated with default headers values +func NewPostDataWaveserverInterfacesLogicalInterfaceCreated() *PostDataWaveserverInterfacesLogicalInterfaceCreated { + + return &PostDataWaveserverInterfacesLogicalInterfaceCreated{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesLogicalInterfaceCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PostDataWaveserverInterfacesLogicalInterfaceBadRequestCode is the HTTP code returned for type PostDataWaveserverInterfacesLogicalInterfaceBadRequest +const PostDataWaveserverInterfacesLogicalInterfaceBadRequestCode int = 400 + +/*PostDataWaveserverInterfacesLogicalInterfaceBadRequest Internal error + +swagger:response postDataWaveserverInterfacesLogicalInterfaceBadRequest +*/ +type PostDataWaveserverInterfacesLogicalInterfaceBadRequest struct { +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceBadRequest creates PostDataWaveserverInterfacesLogicalInterfaceBadRequest with default headers values +func NewPostDataWaveserverInterfacesLogicalInterfaceBadRequest() *PostDataWaveserverInterfacesLogicalInterfaceBadRequest { + + return &PostDataWaveserverInterfacesLogicalInterfaceBadRequest{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesLogicalInterfaceBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// PostDataWaveserverInterfacesLogicalInterfaceConflictCode is the HTTP code returned for type PostDataWaveserverInterfacesLogicalInterfaceConflict +const PostDataWaveserverInterfacesLogicalInterfaceConflictCode int = 409 + +/*PostDataWaveserverInterfacesLogicalInterfaceConflict Object already exists + +swagger:response postDataWaveserverInterfacesLogicalInterfaceConflict +*/ +type PostDataWaveserverInterfacesLogicalInterfaceConflict struct { +} + +// NewPostDataWaveserverInterfacesLogicalInterfaceConflict creates PostDataWaveserverInterfacesLogicalInterfaceConflict with default headers values +func NewPostDataWaveserverInterfacesLogicalInterfaceConflict() *PostDataWaveserverInterfacesLogicalInterfaceConflict { + + return &PostDataWaveserverInterfacesLogicalInterfaceConflict{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesLogicalInterfaceConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..254124974e3983554612bfc657f10a3a9434c9d0 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_logical_interface_urlbuilder.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// PostDataWaveserverInterfacesLogicalInterfaceURL generates an URL for the post data waveserver interfaces logical interface operation +type PostDataWaveserverInterfacesLogicalInterfaceURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesLogicalInterfaceURL) WithBasePath(bp string) *PostDataWaveserverInterfacesLogicalInterfaceURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesLogicalInterfaceURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PostDataWaveserverInterfacesLogicalInterfaceURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface/" + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PostDataWaveserverInterfacesLogicalInterfaceURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PostDataWaveserverInterfacesLogicalInterfaceURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PostDataWaveserverInterfacesLogicalInterfaceURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PostDataWaveserverInterfacesLogicalInterfaceURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PostDataWaveserverInterfacesLogicalInterfaceURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PostDataWaveserverInterfacesLogicalInterfaceURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..32bd73be2c357973a2faad3a0178de9858290df2 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_parameters.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPostDataWaveserverInterfacesParams creates a new PostDataWaveserverInterfacesParams object +// no default values defined in spec. +func NewPostDataWaveserverInterfacesParams() PostDataWaveserverInterfacesParams { + + return PostDataWaveserverInterfacesParams{} +} + +// PostDataWaveserverInterfacesParams contains all the bound params for the post data waveserver interfaces operation +// typically these are obtained from a http.Request +// +// swagger:parameters PostDataWaveserverInterfaces +type PostDataWaveserverInterfacesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.WaveserverInterfaces to be added to list + In: body + */ + CienaWaveserverInterfacesWaveserverInterfacesBodyParam *models.CienaWaveserverInterfacesWaveserverInterfacesWrapper +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPostDataWaveserverInterfacesParams() beforehand. +func (o *PostDataWaveserverInterfacesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverInterfacesWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverInterfacesBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverInterfacesBodyParam = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface.go new file mode 100644 index 0000000000000000000000000000000000000000..c0bc9555f8fc3342eb6b8e0d17a39d4e654b996a --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PostDataWaveserverInterfacesPhysicalInterfaceHandlerFunc turns a function with the right signature into a post data waveserver interfaces physical interface handler +type PostDataWaveserverInterfacesPhysicalInterfaceHandlerFunc func(PostDataWaveserverInterfacesPhysicalInterfaceParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PostDataWaveserverInterfacesPhysicalInterfaceHandlerFunc) Handle(params PostDataWaveserverInterfacesPhysicalInterfaceParams) middleware.Responder { + return fn(params) +} + +// PostDataWaveserverInterfacesPhysicalInterfaceHandler interface for that can handle valid post data waveserver interfaces physical interface params +type PostDataWaveserverInterfacesPhysicalInterfaceHandler interface { + Handle(PostDataWaveserverInterfacesPhysicalInterfaceParams) middleware.Responder +} + +// NewPostDataWaveserverInterfacesPhysicalInterface creates a new http.Handler for the post data waveserver interfaces physical interface operation +func NewPostDataWaveserverInterfacesPhysicalInterface(ctx *middleware.Context, handler PostDataWaveserverInterfacesPhysicalInterfaceHandler) *PostDataWaveserverInterfacesPhysicalInterface { + return &PostDataWaveserverInterfacesPhysicalInterface{Context: ctx, Handler: handler} +} + +/*PostDataWaveserverInterfacesPhysicalInterface swagger:route POST /data/waveserver-interfaces/physical-interface/ ciena-waveserver-interfaces postDataWaveserverInterfacesPhysicalInterface + +creates ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface + +List of physical Ethernet management interfaces. + +*/ +type PostDataWaveserverInterfacesPhysicalInterface struct { + Context *middleware.Context + Handler PostDataWaveserverInterfacesPhysicalInterfaceHandler +} + +func (o *PostDataWaveserverInterfacesPhysicalInterface) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPostDataWaveserverInterfacesPhysicalInterfaceParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_id.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_id.go new file mode 100644 index 0000000000000000000000000000000000000000..f9b40d96d8a2bf870a7c6c28a741cd347fdba767 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_id.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PostDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc turns a function with the right signature into a post data waveserver interfaces physical interface name ID handler +type PostDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc func(PostDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PostDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc) Handle(params PostDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder { + return fn(params) +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNameIDHandler interface for that can handle valid post data waveserver interfaces physical interface name ID params +type PostDataWaveserverInterfacesPhysicalInterfaceNameIDHandler interface { + Handle(PostDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNameID creates a new http.Handler for the post data waveserver interfaces physical interface name ID operation +func NewPostDataWaveserverInterfacesPhysicalInterfaceNameID(ctx *middleware.Context, handler PostDataWaveserverInterfacesPhysicalInterfaceNameIDHandler) *PostDataWaveserverInterfacesPhysicalInterfaceNameID { + return &PostDataWaveserverInterfacesPhysicalInterfaceNameID{Context: ctx, Handler: handler} +} + +/*PostDataWaveserverInterfacesPhysicalInterfaceNameID swagger:route POST /data/waveserver-interfaces/physical-interface={name}/id/ ciena-waveserver-interfaces postDataWaveserverInterfacesPhysicalInterfaceNameId + +creates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id + +Identification information of this management interface. + +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNameID struct { + Context *middleware.Context + Handler PostDataWaveserverInterfacesPhysicalInterfaceNameIDHandler +} + +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPostDataWaveserverInterfacesPhysicalInterfaceNameIDParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_id_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_id_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0bf5494e7e845e531498be40b5918f02919cd430 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_id_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNameIDParams creates a new PostDataWaveserverInterfacesPhysicalInterfaceNameIDParams object +// no default values defined in spec. +func NewPostDataWaveserverInterfacesPhysicalInterfaceNameIDParams() PostDataWaveserverInterfacesPhysicalInterfaceNameIDParams { + + return PostDataWaveserverInterfacesPhysicalInterfaceNameIDParams{} +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNameIDParams contains all the bound params for the post data waveserver interfaces physical interface name ID operation +// typically these are obtained from a http.Request +// +// swagger:parameters PostDataWaveserverInterfacesPhysicalInterfaceNameID +type PostDataWaveserverInterfacesPhysicalInterfaceNameIDParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id to be added to list + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIDBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIDWrapper + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPostDataWaveserverInterfacesPhysicalInterfaceNameIDParams() beforehand. +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIDWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIdBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIDBodyParam = &body + } + } + } + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameIDParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_id_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_id_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..ab9f7f87a7f36e59d84cffafb0e6fcf05c068de9 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_id_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PostDataWaveserverInterfacesPhysicalInterfaceNameIDCreatedCode is the HTTP code returned for type PostDataWaveserverInterfacesPhysicalInterfaceNameIDCreated +const PostDataWaveserverInterfacesPhysicalInterfaceNameIDCreatedCode int = 201 + +/*PostDataWaveserverInterfacesPhysicalInterfaceNameIDCreated Object created + +swagger:response postDataWaveserverInterfacesPhysicalInterfaceNameIdCreated +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNameIDCreated struct { +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNameIDCreated creates PostDataWaveserverInterfacesPhysicalInterfaceNameIDCreated with default headers values +func NewPostDataWaveserverInterfacesPhysicalInterfaceNameIDCreated() *PostDataWaveserverInterfacesPhysicalInterfaceNameIDCreated { + + return &PostDataWaveserverInterfacesPhysicalInterfaceNameIDCreated{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameIDCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequestCode is the HTTP code returned for type PostDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest +const PostDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequestCode int = 400 + +/*PostDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest Internal error + +swagger:response postDataWaveserverInterfacesPhysicalInterfaceNameIdBadRequest +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest struct { +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest creates PostDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest with default headers values +func NewPostDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest() *PostDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest { + + return &PostDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNameIDConflictCode is the HTTP code returned for type PostDataWaveserverInterfacesPhysicalInterfaceNameIDConflict +const PostDataWaveserverInterfacesPhysicalInterfaceNameIDConflictCode int = 409 + +/*PostDataWaveserverInterfacesPhysicalInterfaceNameIDConflict Object already exists + +swagger:response postDataWaveserverInterfacesPhysicalInterfaceNameIdConflict +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNameIDConflict struct { +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNameIDConflict creates PostDataWaveserverInterfacesPhysicalInterfaceNameIDConflict with default headers values +func NewPostDataWaveserverInterfacesPhysicalInterfaceNameIDConflict() *PostDataWaveserverInterfacesPhysicalInterfaceNameIDConflict { + + return &PostDataWaveserverInterfacesPhysicalInterfaceNameIDConflict{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameIDConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_id_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_id_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..8d8e93a0aa23f24283ea83cc7b4311e13084260b --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_id_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// PostDataWaveserverInterfacesPhysicalInterfaceNameIDURL generates an URL for the post data waveserver interfaces physical interface name ID operation +type PostDataWaveserverInterfacesPhysicalInterfaceNameIDURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameIDURL) WithBasePath(bp string) *PostDataWaveserverInterfacesPhysicalInterfaceNameIDURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameIDURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameIDURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/id/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on PostDataWaveserverInterfacesPhysicalInterfaceNameIDURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameIDURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameIDURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameIDURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PostDataWaveserverInterfacesPhysicalInterfaceNameIDURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PostDataWaveserverInterfacesPhysicalInterfaceNameIDURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameIDURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties.go new file mode 100644 index 0000000000000000000000000000000000000000..4cf60f503ecff895b25ce44babf9b32aa7d57176 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc turns a function with the right signature into a post data waveserver interfaces physical interface name properties handler +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc func(PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc) Handle(params PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder { + return fn(params) +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler interface for that can handle valid post data waveserver interfaces physical interface name properties params +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler interface { + Handle(PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNameProperties creates a new http.Handler for the post data waveserver interfaces physical interface name properties operation +func NewPostDataWaveserverInterfacesPhysicalInterfaceNameProperties(ctx *middleware.Context, handler PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler) *PostDataWaveserverInterfacesPhysicalInterfaceNameProperties { + return &PostDataWaveserverInterfacesPhysicalInterfaceNameProperties{Context: ctx, Handler: handler} +} + +/*PostDataWaveserverInterfacesPhysicalInterfaceNameProperties swagger:route POST /data/waveserver-interfaces/physical-interface={name}/properties/ ciena-waveserver-interfaces postDataWaveserverInterfacesPhysicalInterfaceNameProperties + +creates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties + +All the configuration data of the physical management interface. + +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNameProperties struct { + Context *middleware.Context + Handler PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler +} + +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameProperties) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_ethernet.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_ethernet.go new file mode 100644 index 0000000000000000000000000000000000000000..e39eeda9da02ea6d191a58349dab346dfc0b575f --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_ethernet.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc turns a function with the right signature into a post data waveserver interfaces physical interface name properties ethernet handler +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc func(PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc) Handle(params PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder { + return fn(params) +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler interface for that can handle valid post data waveserver interfaces physical interface name properties ethernet params +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler interface { + Handle(PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet creates a new http.Handler for the post data waveserver interfaces physical interface name properties ethernet operation +func NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet(ctx *middleware.Context, handler PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler) *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet { + return &PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet{Context: ctx, Handler: handler} +} + +/*PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet swagger:route POST /data/waveserver-interfaces/physical-interface={name}/properties/ethernet/ ciena-waveserver-interfaces postDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet + +creates ciena.waveserver.interfaces.EthernetIfPropertiesGroup + +Ethernet interface attributes. + +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet struct { + Context *middleware.Context + Handler PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler +} + +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_ethernet_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_ethernet_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..46d66f7e948b77f3295a3d235169ea579125fd28 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_ethernet_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams creates a new PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams object +// no default values defined in spec. +func NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams() PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams { + + return PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams{} +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams contains all the bound params for the post data waveserver interfaces physical interface name properties ethernet operation +// typically these are obtained from a http.Request +// +// swagger:parameters PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.EthernetIfPropertiesGroup to be added to list + In: body + */ + CienaWaveserverInterfacesEthernetIfPropertiesGroupBodyParam *models.CienaWaveserverInterfacesEthernetIfPropertiesGroupWrapper + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams() beforehand. +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesEthernetIfPropertiesGroupWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesEthernetIfPropertiesGroupBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesEthernetIfPropertiesGroupBodyParam = &body + } + } + } + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_ethernet_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_ethernet_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a82eac0e6c7d405eef07e1ac83a26ca9e4c8c8b8 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_ethernet_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreatedCode is the HTTP code returned for type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated +const PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreatedCode int = 201 + +/*PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated Object created + +swagger:response postDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated struct { +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated creates PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated with default headers values +func NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated() *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated { + + return &PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequestCode is the HTTP code returned for type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest +const PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequestCode int = 400 + +/*PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest Internal error + +swagger:response postDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest struct { +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest creates PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest with default headers values +func NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest() *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest { + + return &PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetConflictCode is the HTTP code returned for type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetConflict +const PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetConflictCode int = 409 + +/*PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetConflict Object already exists + +swagger:response postDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetConflict +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetConflict struct { +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetConflict creates PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetConflict with default headers values +func NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetConflict() *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetConflict { + + return &PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetConflict{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_ethernet_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_ethernet_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..612eabe24defba3db59da14ce7f91df2d5ff3fbc --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_ethernet_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL generates an URL for the post data waveserver interfaces physical interface name properties ethernet operation +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) WithBasePath(bp string) *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/properties/ethernet/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_management.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_management.go new file mode 100644 index 0000000000000000000000000000000000000000..b60feaed337d381be8859824f6c83bdec5c027c3 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_management.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc turns a function with the right signature into a post data waveserver interfaces physical interface name properties management handler +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc func(PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc) Handle(params PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder { + return fn(params) +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler interface for that can handle valid post data waveserver interfaces physical interface name properties management params +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler interface { + Handle(PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement creates a new http.Handler for the post data waveserver interfaces physical interface name properties management operation +func NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement(ctx *middleware.Context, handler PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler) *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement { + return &PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement{Context: ctx, Handler: handler} +} + +/*PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement swagger:route POST /data/waveserver-interfaces/physical-interface={name}/properties/management/ ciena-waveserver-interfaces postDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement + +creates ciena.waveserver.interfaces.ManagementIfPropertiesGroup + +Management interface attributes. + +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement struct { + Context *middleware.Context + Handler PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler +} + +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_management_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_management_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6370fc79ebe97d2749178632219a110ee9c4af6b --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_management_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams creates a new PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams object +// no default values defined in spec. +func NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams() PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams { + + return PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams{} +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams contains all the bound params for the post data waveserver interfaces physical interface name properties management operation +// typically these are obtained from a http.Request +// +// swagger:parameters PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.ManagementIfPropertiesGroup to be added to list + In: body + */ + CienaWaveserverInterfacesManagementIfPropertiesGroupBodyParam *models.CienaWaveserverInterfacesManagementIfPropertiesGroupWrapper + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams() beforehand. +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesManagementIfPropertiesGroupWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesManagementIfPropertiesGroupBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesManagementIfPropertiesGroupBodyParam = &body + } + } + } + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_management_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_management_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..ef509d67b129baef905024e88d958b310eaa457a --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_management_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreatedCode is the HTTP code returned for type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated +const PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreatedCode int = 201 + +/*PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated Object created + +swagger:response postDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated struct { +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated creates PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated with default headers values +func NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated() *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated { + + return &PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequestCode is the HTTP code returned for type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest +const PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequestCode int = 400 + +/*PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest Internal error + +swagger:response postDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest struct { +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest creates PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest with default headers values +func NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest() *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest { + + return &PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementConflictCode is the HTTP code returned for type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementConflict +const PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementConflictCode int = 409 + +/*PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementConflict Object already exists + +swagger:response postDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementConflict +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementConflict struct { +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementConflict creates PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementConflict with default headers values +func NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementConflict() *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementConflict { + + return &PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementConflict{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_management_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_management_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..83d01fba860b3fd6c41f2f04a8c4521ad1df3e56 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_management_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL generates an URL for the post data waveserver interfaces physical interface name properties management operation +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) WithBasePath(bp string) *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/properties/management/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8bc6eb441489a8abb60435e111e18e344e7bb7d5 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams creates a new PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams object +// no default values defined in spec. +func NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams() PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams { + + return PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams{} +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams contains all the bound params for the post data waveserver interfaces physical interface name properties operation +// typically these are obtained from a http.Request +// +// swagger:parameters PostDataWaveserverInterfacesPhysicalInterfaceNameProperties +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties to be added to list + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesWrapper + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams() beforehand. +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesBodyParam = &body + } + } + } + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..d1983fcf028e72292efc0425045510c61fa660c1 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreatedCode is the HTTP code returned for type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated +const PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreatedCode int = 201 + +/*PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated Object created + +swagger:response postDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated struct { +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated creates PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated with default headers values +func NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated() *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated { + + return &PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequestCode is the HTTP code returned for type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest +const PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequestCode int = 400 + +/*PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest Internal error + +swagger:response postDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest struct { +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest creates PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest with default headers values +func NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest() *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest { + + return &PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesConflictCode is the HTTP code returned for type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesConflict +const PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesConflictCode int = 409 + +/*PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesConflict Object already exists + +swagger:response postDataWaveserverInterfacesPhysicalInterfaceNamePropertiesConflict +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesConflict struct { +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesConflict creates PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesConflict with default headers values +func NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesConflict() *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesConflict { + + return &PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesConflict{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..5a5e002a8cd453698d5da7f4f00d10bce59b77de --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_properties_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL generates an URL for the post data waveserver interfaces physical interface name properties operation +type PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) WithBasePath(bp string) *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/properties/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_state.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_state.go new file mode 100644 index 0000000000000000000000000000000000000000..385203268f5335d9292203817d53b6554428fb49 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_state.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PostDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc turns a function with the right signature into a post data waveserver interfaces physical interface name state handler +type PostDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc func(PostDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PostDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc) Handle(params PostDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder { + return fn(params) +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNameStateHandler interface for that can handle valid post data waveserver interfaces physical interface name state params +type PostDataWaveserverInterfacesPhysicalInterfaceNameStateHandler interface { + Handle(PostDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNameState creates a new http.Handler for the post data waveserver interfaces physical interface name state operation +func NewPostDataWaveserverInterfacesPhysicalInterfaceNameState(ctx *middleware.Context, handler PostDataWaveserverInterfacesPhysicalInterfaceNameStateHandler) *PostDataWaveserverInterfacesPhysicalInterfaceNameState { + return &PostDataWaveserverInterfacesPhysicalInterfaceNameState{Context: ctx, Handler: handler} +} + +/*PostDataWaveserverInterfacesPhysicalInterfaceNameState swagger:route POST /data/waveserver-interfaces/physical-interface={name}/state/ ciena-waveserver-interfaces postDataWaveserverInterfacesPhysicalInterfaceNameState + +creates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State + +Physical management interface state information. + +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNameState struct { + Context *middleware.Context + Handler PostDataWaveserverInterfacesPhysicalInterfaceNameStateHandler +} + +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameState) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPostDataWaveserverInterfacesPhysicalInterfaceNameStateParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_state_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_state_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b04f2ef2e7658332a1c6cd05b37a44f67a51847f --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_state_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNameStateParams creates a new PostDataWaveserverInterfacesPhysicalInterfaceNameStateParams object +// no default values defined in spec. +func NewPostDataWaveserverInterfacesPhysicalInterfaceNameStateParams() PostDataWaveserverInterfacesPhysicalInterfaceNameStateParams { + + return PostDataWaveserverInterfacesPhysicalInterfaceNameStateParams{} +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNameStateParams contains all the bound params for the post data waveserver interfaces physical interface name state operation +// typically these are obtained from a http.Request +// +// swagger:parameters PostDataWaveserverInterfacesPhysicalInterfaceNameState +type PostDataWaveserverInterfacesPhysicalInterfaceNameStateParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State to be added to list + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateWrapper + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPostDataWaveserverInterfacesPhysicalInterfaceNameStateParams() beforehand. +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameStateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateBodyParam = &body + } + } + } + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameStateParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_state_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_state_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..55356d146781f86a62fdf133cfd55be937149388 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_state_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PostDataWaveserverInterfacesPhysicalInterfaceNameStateCreatedCode is the HTTP code returned for type PostDataWaveserverInterfacesPhysicalInterfaceNameStateCreated +const PostDataWaveserverInterfacesPhysicalInterfaceNameStateCreatedCode int = 201 + +/*PostDataWaveserverInterfacesPhysicalInterfaceNameStateCreated Object created + +swagger:response postDataWaveserverInterfacesPhysicalInterfaceNameStateCreated +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNameStateCreated struct { +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNameStateCreated creates PostDataWaveserverInterfacesPhysicalInterfaceNameStateCreated with default headers values +func NewPostDataWaveserverInterfacesPhysicalInterfaceNameStateCreated() *PostDataWaveserverInterfacesPhysicalInterfaceNameStateCreated { + + return &PostDataWaveserverInterfacesPhysicalInterfaceNameStateCreated{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameStateCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequestCode is the HTTP code returned for type PostDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest +const PostDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequestCode int = 400 + +/*PostDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest Internal error + +swagger:response postDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest struct { +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest creates PostDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest with default headers values +func NewPostDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest() *PostDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest { + + return &PostDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// PostDataWaveserverInterfacesPhysicalInterfaceNameStateConflictCode is the HTTP code returned for type PostDataWaveserverInterfacesPhysicalInterfaceNameStateConflict +const PostDataWaveserverInterfacesPhysicalInterfaceNameStateConflictCode int = 409 + +/*PostDataWaveserverInterfacesPhysicalInterfaceNameStateConflict Object already exists + +swagger:response postDataWaveserverInterfacesPhysicalInterfaceNameStateConflict +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceNameStateConflict struct { +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceNameStateConflict creates PostDataWaveserverInterfacesPhysicalInterfaceNameStateConflict with default headers values +func NewPostDataWaveserverInterfacesPhysicalInterfaceNameStateConflict() *PostDataWaveserverInterfacesPhysicalInterfaceNameStateConflict { + + return &PostDataWaveserverInterfacesPhysicalInterfaceNameStateConflict{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameStateConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_state_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_state_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..f6fddc2e9b41ae90f4c850caae6c0133455ffaaa --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_name_state_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// PostDataWaveserverInterfacesPhysicalInterfaceNameStateURL generates an URL for the post data waveserver interfaces physical interface name state operation +type PostDataWaveserverInterfacesPhysicalInterfaceNameStateURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameStateURL) WithBasePath(bp string) *PostDataWaveserverInterfacesPhysicalInterfaceNameStateURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameStateURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameStateURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/state/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on PostDataWaveserverInterfacesPhysicalInterfaceNameStateURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameStateURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameStateURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameStateURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PostDataWaveserverInterfacesPhysicalInterfaceNameStateURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PostDataWaveserverInterfacesPhysicalInterfaceNameStateURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PostDataWaveserverInterfacesPhysicalInterfaceNameStateURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..9a44f1d0a90b52203dc14d10e883945337a834e9 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_parameters.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPostDataWaveserverInterfacesPhysicalInterfaceParams creates a new PostDataWaveserverInterfacesPhysicalInterfaceParams object +// no default values defined in spec. +func NewPostDataWaveserverInterfacesPhysicalInterfaceParams() PostDataWaveserverInterfacesPhysicalInterfaceParams { + + return PostDataWaveserverInterfacesPhysicalInterfaceParams{} +} + +// PostDataWaveserverInterfacesPhysicalInterfaceParams contains all the bound params for the post data waveserver interfaces physical interface operation +// typically these are obtained from a http.Request +// +// swagger:parameters PostDataWaveserverInterfacesPhysicalInterface +type PostDataWaveserverInterfacesPhysicalInterfaceParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface to be added to list + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceWrapper +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPostDataWaveserverInterfacesPhysicalInterfaceParams() beforehand. +func (o *PostDataWaveserverInterfacesPhysicalInterfaceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceBodyParam = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..fa731415238cd13b98257b3fa530e19b907f4348 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PostDataWaveserverInterfacesPhysicalInterfaceCreatedCode is the HTTP code returned for type PostDataWaveserverInterfacesPhysicalInterfaceCreated +const PostDataWaveserverInterfacesPhysicalInterfaceCreatedCode int = 201 + +/*PostDataWaveserverInterfacesPhysicalInterfaceCreated Object created + +swagger:response postDataWaveserverInterfacesPhysicalInterfaceCreated +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceCreated struct { +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceCreated creates PostDataWaveserverInterfacesPhysicalInterfaceCreated with default headers values +func NewPostDataWaveserverInterfacesPhysicalInterfaceCreated() *PostDataWaveserverInterfacesPhysicalInterfaceCreated { + + return &PostDataWaveserverInterfacesPhysicalInterfaceCreated{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesPhysicalInterfaceCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PostDataWaveserverInterfacesPhysicalInterfaceBadRequestCode is the HTTP code returned for type PostDataWaveserverInterfacesPhysicalInterfaceBadRequest +const PostDataWaveserverInterfacesPhysicalInterfaceBadRequestCode int = 400 + +/*PostDataWaveserverInterfacesPhysicalInterfaceBadRequest Internal error + +swagger:response postDataWaveserverInterfacesPhysicalInterfaceBadRequest +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceBadRequest struct { +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceBadRequest creates PostDataWaveserverInterfacesPhysicalInterfaceBadRequest with default headers values +func NewPostDataWaveserverInterfacesPhysicalInterfaceBadRequest() *PostDataWaveserverInterfacesPhysicalInterfaceBadRequest { + + return &PostDataWaveserverInterfacesPhysicalInterfaceBadRequest{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesPhysicalInterfaceBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// PostDataWaveserverInterfacesPhysicalInterfaceConflictCode is the HTTP code returned for type PostDataWaveserverInterfacesPhysicalInterfaceConflict +const PostDataWaveserverInterfacesPhysicalInterfaceConflictCode int = 409 + +/*PostDataWaveserverInterfacesPhysicalInterfaceConflict Object already exists + +swagger:response postDataWaveserverInterfacesPhysicalInterfaceConflict +*/ +type PostDataWaveserverInterfacesPhysicalInterfaceConflict struct { +} + +// NewPostDataWaveserverInterfacesPhysicalInterfaceConflict creates PostDataWaveserverInterfacesPhysicalInterfaceConflict with default headers values +func NewPostDataWaveserverInterfacesPhysicalInterfaceConflict() *PostDataWaveserverInterfacesPhysicalInterfaceConflict { + + return &PostDataWaveserverInterfacesPhysicalInterfaceConflict{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesPhysicalInterfaceConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..0708e5481e92ab6a69a60e998b038642f5f9e276 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_physical_interface_urlbuilder.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// PostDataWaveserverInterfacesPhysicalInterfaceURL generates an URL for the post data waveserver interfaces physical interface operation +type PostDataWaveserverInterfacesPhysicalInterfaceURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceURL) WithBasePath(bp string) *PostDataWaveserverInterfacesPhysicalInterfaceURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface/" + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PostDataWaveserverInterfacesPhysicalInterfaceURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PostDataWaveserverInterfacesPhysicalInterfaceURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PostDataWaveserverInterfacesPhysicalInterfaceURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PostDataWaveserverInterfacesPhysicalInterfaceURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PostDataWaveserverInterfacesPhysicalInterfaceURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..64298aa3221fa29183d39554f43d2225d41e5270 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PostDataWaveserverInterfacesCreatedCode is the HTTP code returned for type PostDataWaveserverInterfacesCreated +const PostDataWaveserverInterfacesCreatedCode int = 201 + +/*PostDataWaveserverInterfacesCreated Object created + +swagger:response postDataWaveserverInterfacesCreated +*/ +type PostDataWaveserverInterfacesCreated struct { +} + +// NewPostDataWaveserverInterfacesCreated creates PostDataWaveserverInterfacesCreated with default headers values +func NewPostDataWaveserverInterfacesCreated() *PostDataWaveserverInterfacesCreated { + + return &PostDataWaveserverInterfacesCreated{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PostDataWaveserverInterfacesBadRequestCode is the HTTP code returned for type PostDataWaveserverInterfacesBadRequest +const PostDataWaveserverInterfacesBadRequestCode int = 400 + +/*PostDataWaveserverInterfacesBadRequest Internal error + +swagger:response postDataWaveserverInterfacesBadRequest +*/ +type PostDataWaveserverInterfacesBadRequest struct { +} + +// NewPostDataWaveserverInterfacesBadRequest creates PostDataWaveserverInterfacesBadRequest with default headers values +func NewPostDataWaveserverInterfacesBadRequest() *PostDataWaveserverInterfacesBadRequest { + + return &PostDataWaveserverInterfacesBadRequest{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// PostDataWaveserverInterfacesConflictCode is the HTTP code returned for type PostDataWaveserverInterfacesConflict +const PostDataWaveserverInterfacesConflictCode int = 409 + +/*PostDataWaveserverInterfacesConflict Object already exists + +swagger:response postDataWaveserverInterfacesConflict +*/ +type PostDataWaveserverInterfacesConflict struct { +} + +// NewPostDataWaveserverInterfacesConflict creates PostDataWaveserverInterfacesConflict with default headers values +func NewPostDataWaveserverInterfacesConflict() *PostDataWaveserverInterfacesConflict { + + return &PostDataWaveserverInterfacesConflict{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes.go new file mode 100644 index 0000000000000000000000000000000000000000..1a9f606ac030704add85a79d0afe4eb93dc4ba23 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PostDataWaveserverInterfacesRoutesHandlerFunc turns a function with the right signature into a post data waveserver interfaces routes handler +type PostDataWaveserverInterfacesRoutesHandlerFunc func(PostDataWaveserverInterfacesRoutesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PostDataWaveserverInterfacesRoutesHandlerFunc) Handle(params PostDataWaveserverInterfacesRoutesParams) middleware.Responder { + return fn(params) +} + +// PostDataWaveserverInterfacesRoutesHandler interface for that can handle valid post data waveserver interfaces routes params +type PostDataWaveserverInterfacesRoutesHandler interface { + Handle(PostDataWaveserverInterfacesRoutesParams) middleware.Responder +} + +// NewPostDataWaveserverInterfacesRoutes creates a new http.Handler for the post data waveserver interfaces routes operation +func NewPostDataWaveserverInterfacesRoutes(ctx *middleware.Context, handler PostDataWaveserverInterfacesRoutesHandler) *PostDataWaveserverInterfacesRoutes { + return &PostDataWaveserverInterfacesRoutes{Context: ctx, Handler: handler} +} + +/*PostDataWaveserverInterfacesRoutes swagger:route POST /data/waveserver-interfaces/routes/ ciena-waveserver-interfaces postDataWaveserverInterfacesRoutes + +creates ciena.waveserver.interfaces.waveserverinterfaces.Routes + +Top-level container for IP route configuration and operational data. + +*/ +type PostDataWaveserverInterfacesRoutes struct { + Context *middleware.Context + Handler PostDataWaveserverInterfacesRoutesHandler +} + +func (o *PostDataWaveserverInterfacesRoutes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPostDataWaveserverInterfacesRoutesParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route.go new file mode 100644 index 0000000000000000000000000000000000000000..b3a546d54cf0921127c2f057992eade0ab0da951 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PostDataWaveserverInterfacesRoutesIPV4StaticRouteHandlerFunc turns a function with the right signature into a post data waveserver interfaces routes IP v4 static route handler +type PostDataWaveserverInterfacesRoutesIPV4StaticRouteHandlerFunc func(PostDataWaveserverInterfacesRoutesIPV4StaticRouteParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PostDataWaveserverInterfacesRoutesIPV4StaticRouteHandlerFunc) Handle(params PostDataWaveserverInterfacesRoutesIPV4StaticRouteParams) middleware.Responder { + return fn(params) +} + +// PostDataWaveserverInterfacesRoutesIPV4StaticRouteHandler interface for that can handle valid post data waveserver interfaces routes IP v4 static route params +type PostDataWaveserverInterfacesRoutesIPV4StaticRouteHandler interface { + Handle(PostDataWaveserverInterfacesRoutesIPV4StaticRouteParams) middleware.Responder +} + +// NewPostDataWaveserverInterfacesRoutesIPV4StaticRoute creates a new http.Handler for the post data waveserver interfaces routes IP v4 static route operation +func NewPostDataWaveserverInterfacesRoutesIPV4StaticRoute(ctx *middleware.Context, handler PostDataWaveserverInterfacesRoutesIPV4StaticRouteHandler) *PostDataWaveserverInterfacesRoutesIPV4StaticRoute { + return &PostDataWaveserverInterfacesRoutesIPV4StaticRoute{Context: ctx, Handler: handler} +} + +/*PostDataWaveserverInterfacesRoutesIPV4StaticRoute swagger:route POST /data/waveserver-interfaces/routes/ipv4-static-route/ ciena-waveserver-interfaces postDataWaveserverInterfacesRoutesIpV4StaticRoute + +creates ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute + +List of IPv4 static routing entries. + +*/ +type PostDataWaveserverInterfacesRoutesIPV4StaticRoute struct { + Context *middleware.Context + Handler PostDataWaveserverInterfacesRoutesIPV4StaticRouteHandler +} + +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRoute) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop.go new file mode 100644 index 0000000000000000000000000000000000000000..23ff39837a892b77a10255d14ce7a2831c2f70b4 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopHandlerFunc turns a function with the right signature into a post data waveserver interfaces routes IP v4 static route destination next hop handler +type PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopHandlerFunc func(PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopHandlerFunc) Handle(params PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopParams) middleware.Responder { + return fn(params) +} + +// PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopHandler interface for that can handle valid post data waveserver interfaces routes IP v4 static route destination next hop params +type PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopHandler interface { + Handle(PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopParams) middleware.Responder +} + +// NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHop creates a new http.Handler for the post data waveserver interfaces routes IP v4 static route destination next hop operation +func NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHop(ctx *middleware.Context, handler PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopHandler) *PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHop { + return &PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHop{Context: ctx, Handler: handler} +} + +/*PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHop swagger:route POST /data/waveserver-interfaces/routes/ipv4-static-route={destination}/next-hop/ ciena-waveserver-interfaces postDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationNextHop + +creates ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop + +A list of next-hop entries associated with the static route. + +*/ +type PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHop struct { + Context *middleware.Context + Handler PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopHandler +} + +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHop) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..ce50eaa3aa3ace272753af24a909f515ee692c03 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopParams creates a new PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopParams object +// no default values defined in spec. +func NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopParams() PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopParams { + + return PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopParams{} +} + +// PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopParams contains all the bound params for the post data waveserver interfaces routes IP v4 static route destination next hop operation +// typically these are obtained from a http.Request +// +// swagger:parameters PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHop +type PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop to be added to list + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopWrapper + /*Id of ipv4-static-route + Required: true + In: path + */ + Destination string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopParams() beforehand. +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopBodyParam = &body + } + } + } + rDestination, rhkDestination, _ := route.Params.GetOK("destination") + if err := o.bindDestination(rDestination, rhkDestination, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindDestination binds and validates parameter Destination from path. +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopParams) bindDestination(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Destination = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..94d5059bacffcb2cc4a982ba64b1cc1501cac3c7 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopCreatedCode is the HTTP code returned for type PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopCreated +const PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopCreatedCode int = 201 + +/*PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopCreated Object created + +swagger:response postDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationNextHopCreated +*/ +type PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopCreated struct { +} + +// NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopCreated creates PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopCreated with default headers values +func NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopCreated() *PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopCreated { + + return &PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopCreated{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopBadRequestCode is the HTTP code returned for type PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopBadRequest +const PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopBadRequestCode int = 400 + +/*PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopBadRequest Internal error + +swagger:response postDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationNextHopBadRequest +*/ +type PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopBadRequest struct { +} + +// NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopBadRequest creates PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopBadRequest with default headers values +func NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopBadRequest() *PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopBadRequest { + + return &PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopBadRequest{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopConflictCode is the HTTP code returned for type PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopConflict +const PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopConflictCode int = 409 + +/*PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopConflict Object already exists + +swagger:response postDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationNextHopConflict +*/ +type PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopConflict struct { +} + +// NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopConflict creates PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopConflict with default headers values +func NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopConflict() *PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopConflict { + + return &PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopConflict{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..9194a0d873f4a58f169df7718c5ebe44f6f1ec54 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopURL generates an URL for the post data waveserver interfaces routes IP v4 static route destination next hop operation +type PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopURL struct { + Destination string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopURL) WithBasePath(bp string) *PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/routes/ipv4-static-route={destination}/next-hop/" + + destination := o.Destination + if destination != "" { + _path = strings.Replace(_path, "{destination}", destination, -1) + } else { + return nil, errors.New("destination is required on PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8f46301d1658e8b7a8ba091a302db401b22de2c3 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_parameters.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteParams creates a new PostDataWaveserverInterfacesRoutesIPV4StaticRouteParams object +// no default values defined in spec. +func NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteParams() PostDataWaveserverInterfacesRoutesIPV4StaticRouteParams { + + return PostDataWaveserverInterfacesRoutesIPV4StaticRouteParams{} +} + +// PostDataWaveserverInterfacesRoutesIPV4StaticRouteParams contains all the bound params for the post data waveserver interfaces routes IP v4 static route operation +// typically these are obtained from a http.Request +// +// swagger:parameters PostDataWaveserverInterfacesRoutesIPV4StaticRoute +type PostDataWaveserverInterfacesRoutesIPV4StaticRouteParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute to be added to list + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRouteBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRouteWrapper +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteParams() beforehand. +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRouteWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4StaticRouteBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRouteBodyParam = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..83c081a7b6fc9c261819e506affdd2fb732cdf21 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PostDataWaveserverInterfacesRoutesIPV4StaticRouteCreatedCode is the HTTP code returned for type PostDataWaveserverInterfacesRoutesIPV4StaticRouteCreated +const PostDataWaveserverInterfacesRoutesIPV4StaticRouteCreatedCode int = 201 + +/*PostDataWaveserverInterfacesRoutesIPV4StaticRouteCreated Object created + +swagger:response postDataWaveserverInterfacesRoutesIpV4StaticRouteCreated +*/ +type PostDataWaveserverInterfacesRoutesIPV4StaticRouteCreated struct { +} + +// NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteCreated creates PostDataWaveserverInterfacesRoutesIPV4StaticRouteCreated with default headers values +func NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteCreated() *PostDataWaveserverInterfacesRoutesIPV4StaticRouteCreated { + + return &PostDataWaveserverInterfacesRoutesIPV4StaticRouteCreated{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PostDataWaveserverInterfacesRoutesIPV4StaticRouteBadRequestCode is the HTTP code returned for type PostDataWaveserverInterfacesRoutesIPV4StaticRouteBadRequest +const PostDataWaveserverInterfacesRoutesIPV4StaticRouteBadRequestCode int = 400 + +/*PostDataWaveserverInterfacesRoutesIPV4StaticRouteBadRequest Internal error + +swagger:response postDataWaveserverInterfacesRoutesIpV4StaticRouteBadRequest +*/ +type PostDataWaveserverInterfacesRoutesIPV4StaticRouteBadRequest struct { +} + +// NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteBadRequest creates PostDataWaveserverInterfacesRoutesIPV4StaticRouteBadRequest with default headers values +func NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteBadRequest() *PostDataWaveserverInterfacesRoutesIPV4StaticRouteBadRequest { + + return &PostDataWaveserverInterfacesRoutesIPV4StaticRouteBadRequest{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// PostDataWaveserverInterfacesRoutesIPV4StaticRouteConflictCode is the HTTP code returned for type PostDataWaveserverInterfacesRoutesIPV4StaticRouteConflict +const PostDataWaveserverInterfacesRoutesIPV4StaticRouteConflictCode int = 409 + +/*PostDataWaveserverInterfacesRoutesIPV4StaticRouteConflict Object already exists + +swagger:response postDataWaveserverInterfacesRoutesIpV4StaticRouteConflict +*/ +type PostDataWaveserverInterfacesRoutesIPV4StaticRouteConflict struct { +} + +// NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteConflict creates PostDataWaveserverInterfacesRoutesIPV4StaticRouteConflict with default headers values +func NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteConflict() *PostDataWaveserverInterfacesRoutesIPV4StaticRouteConflict { + + return &PostDataWaveserverInterfacesRoutesIPV4StaticRouteConflict{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..023312c6b23699aaf55f165025098eb2148c7a3f --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_ip_v4_static_route_urlbuilder.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// PostDataWaveserverInterfacesRoutesIPV4StaticRouteURL generates an URL for the post data waveserver interfaces routes IP v4 static route operation +type PostDataWaveserverInterfacesRoutesIPV4StaticRouteURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteURL) WithBasePath(bp string) *PostDataWaveserverInterfacesRoutesIPV4StaticRouteURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/routes/ipv4-static-route/" + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PostDataWaveserverInterfacesRoutesIPV4StaticRouteURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PostDataWaveserverInterfacesRoutesIPV4StaticRouteURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PostDataWaveserverInterfacesRoutesIPV4StaticRouteURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..5009c779fd15cbcf56ddd3efd8788c50058169c8 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_parameters.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPostDataWaveserverInterfacesRoutesParams creates a new PostDataWaveserverInterfacesRoutesParams object +// no default values defined in spec. +func NewPostDataWaveserverInterfacesRoutesParams() PostDataWaveserverInterfacesRoutesParams { + + return PostDataWaveserverInterfacesRoutesParams{} +} + +// PostDataWaveserverInterfacesRoutesParams contains all the bound params for the post data waveserver interfaces routes operation +// typically these are obtained from a http.Request +// +// swagger:parameters PostDataWaveserverInterfacesRoutes +type PostDataWaveserverInterfacesRoutesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.Routes to be added to list + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesRoutesBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesRoutesWrapper +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPostDataWaveserverInterfacesRoutesParams() beforehand. +func (o *PostDataWaveserverInterfacesRoutesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesRoutesWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesRoutesBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesRoutesBodyParam = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f19da9ededf48514a8febb7e2c9ba3b8bae8302e --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PostDataWaveserverInterfacesRoutesCreatedCode is the HTTP code returned for type PostDataWaveserverInterfacesRoutesCreated +const PostDataWaveserverInterfacesRoutesCreatedCode int = 201 + +/*PostDataWaveserverInterfacesRoutesCreated Object created + +swagger:response postDataWaveserverInterfacesRoutesCreated +*/ +type PostDataWaveserverInterfacesRoutesCreated struct { +} + +// NewPostDataWaveserverInterfacesRoutesCreated creates PostDataWaveserverInterfacesRoutesCreated with default headers values +func NewPostDataWaveserverInterfacesRoutesCreated() *PostDataWaveserverInterfacesRoutesCreated { + + return &PostDataWaveserverInterfacesRoutesCreated{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesRoutesCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PostDataWaveserverInterfacesRoutesBadRequestCode is the HTTP code returned for type PostDataWaveserverInterfacesRoutesBadRequest +const PostDataWaveserverInterfacesRoutesBadRequestCode int = 400 + +/*PostDataWaveserverInterfacesRoutesBadRequest Internal error + +swagger:response postDataWaveserverInterfacesRoutesBadRequest +*/ +type PostDataWaveserverInterfacesRoutesBadRequest struct { +} + +// NewPostDataWaveserverInterfacesRoutesBadRequest creates PostDataWaveserverInterfacesRoutesBadRequest with default headers values +func NewPostDataWaveserverInterfacesRoutesBadRequest() *PostDataWaveserverInterfacesRoutesBadRequest { + + return &PostDataWaveserverInterfacesRoutesBadRequest{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesRoutesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// PostDataWaveserverInterfacesRoutesConflictCode is the HTTP code returned for type PostDataWaveserverInterfacesRoutesConflict +const PostDataWaveserverInterfacesRoutesConflictCode int = 409 + +/*PostDataWaveserverInterfacesRoutesConflict Object already exists + +swagger:response postDataWaveserverInterfacesRoutesConflict +*/ +type PostDataWaveserverInterfacesRoutesConflict struct { +} + +// NewPostDataWaveserverInterfacesRoutesConflict creates PostDataWaveserverInterfacesRoutesConflict with default headers values +func NewPostDataWaveserverInterfacesRoutesConflict() *PostDataWaveserverInterfacesRoutesConflict { + + return &PostDataWaveserverInterfacesRoutesConflict{} +} + +// WriteResponse to the client +func (o *PostDataWaveserverInterfacesRoutesConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(409) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..5dc985130f5c2dbe54469661eea25b25d7ec901f --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_routes_urlbuilder.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// PostDataWaveserverInterfacesRoutesURL generates an URL for the post data waveserver interfaces routes operation +type PostDataWaveserverInterfacesRoutesURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesRoutesURL) WithBasePath(bp string) *PostDataWaveserverInterfacesRoutesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesRoutesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PostDataWaveserverInterfacesRoutesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/routes/" + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PostDataWaveserverInterfacesRoutesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PostDataWaveserverInterfacesRoutesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PostDataWaveserverInterfacesRoutesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PostDataWaveserverInterfacesRoutesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PostDataWaveserverInterfacesRoutesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PostDataWaveserverInterfacesRoutesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..18a50ba019a85e66940e186cc246685972ef3db8 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/post_data_waveserver_interfaces_urlbuilder.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// PostDataWaveserverInterfacesURL generates an URL for the post data waveserver interfaces operation +type PostDataWaveserverInterfacesURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesURL) WithBasePath(bp string) *PostDataWaveserverInterfacesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PostDataWaveserverInterfacesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PostDataWaveserverInterfacesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/" + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PostDataWaveserverInterfacesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PostDataWaveserverInterfacesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PostDataWaveserverInterfacesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PostDataWaveserverInterfacesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PostDataWaveserverInterfacesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PostDataWaveserverInterfacesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces.go new file mode 100644 index 0000000000000000000000000000000000000000..1f56973be28c087863d9cc09406d24368ad6f476 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PutDataWaveserverInterfacesHandlerFunc turns a function with the right signature into a put data waveserver interfaces handler +type PutDataWaveserverInterfacesHandlerFunc func(PutDataWaveserverInterfacesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PutDataWaveserverInterfacesHandlerFunc) Handle(params PutDataWaveserverInterfacesParams) middleware.Responder { + return fn(params) +} + +// PutDataWaveserverInterfacesHandler interface for that can handle valid put data waveserver interfaces params +type PutDataWaveserverInterfacesHandler interface { + Handle(PutDataWaveserverInterfacesParams) middleware.Responder +} + +// NewPutDataWaveserverInterfaces creates a new http.Handler for the put data waveserver interfaces operation +func NewPutDataWaveserverInterfaces(ctx *middleware.Context, handler PutDataWaveserverInterfacesHandler) *PutDataWaveserverInterfaces { + return &PutDataWaveserverInterfaces{Context: ctx, Handler: handler} +} + +/*PutDataWaveserverInterfaces swagger:route PUT /data/waveserver-interfaces/ ciena-waveserver-interfaces putDataWaveserverInterfaces + +creates or updates ciena.waveserver.interfaces.WaveserverInterfaces + +Top level container for configuration and operational data for physical + and logical network interfaces. + +*/ +type PutDataWaveserverInterfaces struct { + Context *middleware.Context + Handler PutDataWaveserverInterfacesHandler +} + +func (o *PutDataWaveserverInterfaces) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPutDataWaveserverInterfacesParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index.go new file mode 100644 index 0000000000000000000000000000000000000000..69802fbc3d2f3975f7693f0b30d39b0e4ade162e --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PutDataWaveserverInterfacesLogicalInterfaceIndexHandlerFunc turns a function with the right signature into a put data waveserver interfaces logical interface index handler +type PutDataWaveserverInterfacesLogicalInterfaceIndexHandlerFunc func(PutDataWaveserverInterfacesLogicalInterfaceIndexParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PutDataWaveserverInterfacesLogicalInterfaceIndexHandlerFunc) Handle(params PutDataWaveserverInterfacesLogicalInterfaceIndexParams) middleware.Responder { + return fn(params) +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexHandler interface for that can handle valid put data waveserver interfaces logical interface index params +type PutDataWaveserverInterfacesLogicalInterfaceIndexHandler interface { + Handle(PutDataWaveserverInterfacesLogicalInterfaceIndexParams) middleware.Responder +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndex creates a new http.Handler for the put data waveserver interfaces logical interface index operation +func NewPutDataWaveserverInterfacesLogicalInterfaceIndex(ctx *middleware.Context, handler PutDataWaveserverInterfacesLogicalInterfaceIndexHandler) *PutDataWaveserverInterfacesLogicalInterfaceIndex { + return &PutDataWaveserverInterfacesLogicalInterfaceIndex{Context: ctx, Handler: handler} +} + +/*PutDataWaveserverInterfacesLogicalInterfaceIndex swagger:route PUT /data/waveserver-interfaces/logical-interface={index}/ ciena-waveserver-interfaces putDataWaveserverInterfacesLogicalInterfaceIndex + +creates or updates ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface + +List of logical IP management interfaces (e.g. 'local'). + +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndex struct { + Context *middleware.Context + Handler PutDataWaveserverInterfacesLogicalInterfaceIndexHandler +} + +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndex) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPutDataWaveserverInterfacesLogicalInterfaceIndexParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_id.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_id.go new file mode 100644 index 0000000000000000000000000000000000000000..b98bd64fabf8e49c2c3e2d05c28806f4c798853f --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_id.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PutDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc turns a function with the right signature into a put data waveserver interfaces logical interface index ID handler +type PutDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc func(PutDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PutDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc) Handle(params PutDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder { + return fn(params) +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexIDHandler interface for that can handle valid put data waveserver interfaces logical interface index ID params +type PutDataWaveserverInterfacesLogicalInterfaceIndexIDHandler interface { + Handle(PutDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexID creates a new http.Handler for the put data waveserver interfaces logical interface index ID operation +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexID(ctx *middleware.Context, handler PutDataWaveserverInterfacesLogicalInterfaceIndexIDHandler) *PutDataWaveserverInterfacesLogicalInterfaceIndexID { + return &PutDataWaveserverInterfacesLogicalInterfaceIndexID{Context: ctx, Handler: handler} +} + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexID swagger:route PUT /data/waveserver-interfaces/logical-interface={index}/id/ ciena-waveserver-interfaces putDataWaveserverInterfacesLogicalInterfaceIndexId + +creates or updates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id + +Identification information of this logical management interface. + +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexID struct { + Context *middleware.Context + Handler PutDataWaveserverInterfacesLogicalInterfaceIndexIDHandler +} + +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPutDataWaveserverInterfacesLogicalInterfaceIndexIDParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_id_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_id_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..e12216c1014eda78d249d15adcc2b9f3e306592d --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_id_parameters.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexIDParams creates a new PutDataWaveserverInterfacesLogicalInterfaceIndexIDParams object +// no default values defined in spec. +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexIDParams() PutDataWaveserverInterfacesLogicalInterfaceIndexIDParams { + + return PutDataWaveserverInterfacesLogicalInterfaceIndexIDParams{} +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexIDParams contains all the bound params for the put data waveserver interfaces logical interface index ID operation +// typically these are obtained from a http.Request +// +// swagger:parameters PutDataWaveserverInterfacesLogicalInterfaceIndexID +type PutDataWaveserverInterfacesLogicalInterfaceIndexIDParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id to be added or updated + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIDBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIDWrapper + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPutDataWaveserverInterfacesLogicalInterfaceIndexIDParams() beforehand. +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIDWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIdBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceIDBodyParam = &body + } + } + } + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexIDParams) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_id_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_id_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..0c969c52ed2ecd64f54863db3070cc2dd92442b9 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_id_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PutDataWaveserverInterfacesLogicalInterfaceIndexIDCreatedCode is the HTTP code returned for type PutDataWaveserverInterfacesLogicalInterfaceIndexIDCreated +const PutDataWaveserverInterfacesLogicalInterfaceIndexIDCreatedCode int = 201 + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexIDCreated Object created + +swagger:response putDataWaveserverInterfacesLogicalInterfaceIndexIdCreated +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexIDCreated struct { +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexIDCreated creates PutDataWaveserverInterfacesLogicalInterfaceIndexIDCreated with default headers values +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexIDCreated() *PutDataWaveserverInterfacesLogicalInterfaceIndexIDCreated { + + return &PutDataWaveserverInterfacesLogicalInterfaceIndexIDCreated{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexIDCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexIDNoContentCode is the HTTP code returned for type PutDataWaveserverInterfacesLogicalInterfaceIndexIDNoContent +const PutDataWaveserverInterfacesLogicalInterfaceIndexIDNoContentCode int = 204 + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexIDNoContent Object modified + +swagger:response putDataWaveserverInterfacesLogicalInterfaceIndexIdNoContent +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexIDNoContent struct { +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexIDNoContent creates PutDataWaveserverInterfacesLogicalInterfaceIndexIDNoContent with default headers values +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexIDNoContent() *PutDataWaveserverInterfacesLogicalInterfaceIndexIDNoContent { + + return &PutDataWaveserverInterfacesLogicalInterfaceIndexIDNoContent{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexIDNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequestCode is the HTTP code returned for type PutDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest +const PutDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequestCode int = 400 + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest Internal error + +swagger:response putDataWaveserverInterfacesLogicalInterfaceIndexIdBadRequest +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest struct { +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest creates PutDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest with default headers values +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest() *PutDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest { + + return &PutDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_id_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_id_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..4dbb6b0ecd188404318d325559741181ca1a6ea3 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_id_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// PutDataWaveserverInterfacesLogicalInterfaceIndexIDURL generates an URL for the put data waveserver interfaces logical interface index ID operation +type PutDataWaveserverInterfacesLogicalInterfaceIndexIDURL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexIDURL) WithBasePath(bp string) *PutDataWaveserverInterfacesLogicalInterfaceIndexIDURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexIDURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexIDURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/id/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on PutDataWaveserverInterfacesLogicalInterfaceIndexIDURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexIDURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexIDURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexIDURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PutDataWaveserverInterfacesLogicalInterfaceIndexIDURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PutDataWaveserverInterfacesLogicalInterfaceIndexIDURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexIDURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..384ec95e3d4f69b8db6c681dd535ca56640c1bba --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_parameters.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexParams creates a new PutDataWaveserverInterfacesLogicalInterfaceIndexParams object +// no default values defined in spec. +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexParams() PutDataWaveserverInterfacesLogicalInterfaceIndexParams { + + return PutDataWaveserverInterfacesLogicalInterfaceIndexParams{} +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexParams contains all the bound params for the put data waveserver interfaces logical interface index operation +// typically these are obtained from a http.Request +// +// swagger:parameters PutDataWaveserverInterfacesLogicalInterfaceIndex +type PutDataWaveserverInterfacesLogicalInterfaceIndexParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface to be added or updated + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceWrapper + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPutDataWaveserverInterfacesLogicalInterfaceIndexParams() beforehand. +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesLogicalInterfaceBodyParam = &body + } + } + } + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexParams) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties.go new file mode 100644 index 0000000000000000000000000000000000000000..9255b80f22d2dc7d721d2c11bcd648506920c5d2 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc turns a function with the right signature into a put data waveserver interfaces logical interface index properties handler +type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc func(PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc) Handle(params PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder { + return fn(params) +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler interface for that can handle valid put data waveserver interfaces logical interface index properties params +type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler interface { + Handle(PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexProperties creates a new http.Handler for the put data waveserver interfaces logical interface index properties operation +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexProperties(ctx *middleware.Context, handler PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler) *PutDataWaveserverInterfacesLogicalInterfaceIndexProperties { + return &PutDataWaveserverInterfacesLogicalInterfaceIndexProperties{Context: ctx, Handler: handler} +} + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexProperties swagger:route PUT /data/waveserver-interfaces/logical-interface={index}/properties/ ciena-waveserver-interfaces putDataWaveserverInterfacesLogicalInterfaceIndexProperties + +creates or updates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties + +All the configuration data of the logical management interface. + +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexProperties struct { + Context *middleware.Context + Handler PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler +} + +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexProperties) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_ip_v4.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_ip_v4.go new file mode 100644 index 0000000000000000000000000000000000000000..90ccab244ddbfb4835f2d448a18466d5ddc053a1 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_ip_v4.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc turns a function with the right signature into a put data waveserver interfaces logical interface index properties IP v4 handler +type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc func(PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder + +// Handle executing the request and returning a response +func (fn PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc) Handle(params PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder { + return fn(params) +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler interface for that can handle valid put data waveserver interfaces logical interface index properties IP v4 params +type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler interface { + Handle(PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 creates a new http.Handler for the put data waveserver interfaces logical interface index properties IP v4 operation +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4(ctx *middleware.Context, handler PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler) *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 { + return &PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4{Context: ctx, Handler: handler} +} + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 swagger:route PUT /data/waveserver-interfaces/logical-interface={index}/properties/ipv4/ ciena-waveserver-interfaces putDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIpV4 + +creates or updates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4 + +IPv4 configuration and operational data. + +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 struct { + Context *middleware.Context + Handler PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler +} + +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0d8894e8583105a787eaf4f264cd367c76b68dd3 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_parameters.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params creates a new PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params object +// no default values defined in spec. +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params() PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params { + + return PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params{} +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params contains all the bound params for the put data waveserver interfaces logical interface index properties IP v4 operation +// typically these are obtained from a http.Request +// +// swagger:parameters PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 +type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4 to be added or updated + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4BodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4Wrapper + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params() beforehand. +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4Wrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIpv4BodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesIPV4BodyParam = &body + } + } + } + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..110248d29c44b7db106e0d0c1ef723e6f394aa22 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4CreatedCode is the HTTP code returned for type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Created +const PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4CreatedCode int = 201 + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Created Object created + +swagger:response putDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIpV4Created +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Created struct { +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Created creates PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Created with default headers values +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Created() *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Created { + + return &PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Created{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Created) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContentCode is the HTTP code returned for type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContent +const PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContentCode int = 204 + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContent Object modified + +swagger:response putDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIpV4NoContent +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContent struct { +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContent creates PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContent with default headers values +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContent() *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContent { + + return &PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContent{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4NoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequestCode is the HTTP code returned for type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest +const PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequestCode int = 400 + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest Internal error + +swagger:response putDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIpV4BadRequest +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest struct { +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest creates PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest with default headers values +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest() *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest { + + return &PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4BadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..6fc9a5c900fb0bd52a0154150cdb75614d45bc24 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_ip_v4_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL generates an URL for the put data waveserver interfaces logical interface index properties IP v4 operation +type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) WithBasePath(bp string) *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/properties/ipv4/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4URL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..85a0eed4fda0f8fdaea6285ca54dfe1432db0ad7 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_parameters.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams creates a new PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams object +// no default values defined in spec. +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams() PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams { + + return PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams{} +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams contains all the bound params for the put data waveserver interfaces logical interface index properties operation +// typically these are obtained from a http.Request +// +// swagger:parameters PutDataWaveserverInterfacesLogicalInterfaceIndexProperties +type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties to be added or updated + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesWrapper + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams() beforehand. +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfacePropertiesBodyParam = &body + } + } + } + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..d95953554900c8f13410b118063e1ed68280fcd8 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreatedCode is the HTTP code returned for type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated +const PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreatedCode int = 201 + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated Object created + +swagger:response putDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated struct { +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated creates PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated with default headers values +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated() *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated { + + return &PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContentCode is the HTTP code returned for type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent +const PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContentCode int = 204 + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent Object modified + +swagger:response putDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent struct { +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent creates PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent with default headers values +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent() *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent { + + return &PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequestCode is the HTTP code returned for type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest +const PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequestCode int = 400 + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest Internal error + +swagger:response putDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest struct { +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest creates PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest with default headers values +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest() *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest { + + return &PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..7297b5e89faec0429124ff49744ff40bd5184b97 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_properties_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL generates an URL for the put data waveserver interfaces logical interface index properties operation +type PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) WithBasePath(bp string) *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/properties/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e1292fca1f3be5c4cc4675a719e43fe6eb291fb0 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PutDataWaveserverInterfacesLogicalInterfaceIndexCreatedCode is the HTTP code returned for type PutDataWaveserverInterfacesLogicalInterfaceIndexCreated +const PutDataWaveserverInterfacesLogicalInterfaceIndexCreatedCode int = 201 + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexCreated Object created + +swagger:response putDataWaveserverInterfacesLogicalInterfaceIndexCreated +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexCreated struct { +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexCreated creates PutDataWaveserverInterfacesLogicalInterfaceIndexCreated with default headers values +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexCreated() *PutDataWaveserverInterfacesLogicalInterfaceIndexCreated { + + return &PutDataWaveserverInterfacesLogicalInterfaceIndexCreated{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexNoContentCode is the HTTP code returned for type PutDataWaveserverInterfacesLogicalInterfaceIndexNoContent +const PutDataWaveserverInterfacesLogicalInterfaceIndexNoContentCode int = 204 + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexNoContent Object modified + +swagger:response putDataWaveserverInterfacesLogicalInterfaceIndexNoContent +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexNoContent struct { +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexNoContent creates PutDataWaveserverInterfacesLogicalInterfaceIndexNoContent with default headers values +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexNoContent() *PutDataWaveserverInterfacesLogicalInterfaceIndexNoContent { + + return &PutDataWaveserverInterfacesLogicalInterfaceIndexNoContent{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexBadRequestCode is the HTTP code returned for type PutDataWaveserverInterfacesLogicalInterfaceIndexBadRequest +const PutDataWaveserverInterfacesLogicalInterfaceIndexBadRequestCode int = 400 + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexBadRequest Internal error + +swagger:response putDataWaveserverInterfacesLogicalInterfaceIndexBadRequest +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexBadRequest struct { +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexBadRequest creates PutDataWaveserverInterfacesLogicalInterfaceIndexBadRequest with default headers values +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexBadRequest() *PutDataWaveserverInterfacesLogicalInterfaceIndexBadRequest { + + return &PutDataWaveserverInterfacesLogicalInterfaceIndexBadRequest{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_state.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_state.go new file mode 100644 index 0000000000000000000000000000000000000000..a93c43457fe628ebc387bbc511ad1c5c97cea260 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_state.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PutDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc turns a function with the right signature into a put data waveserver interfaces logical interface index state handler +type PutDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc func(PutDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PutDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc) Handle(params PutDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder { + return fn(params) +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexStateHandler interface for that can handle valid put data waveserver interfaces logical interface index state params +type PutDataWaveserverInterfacesLogicalInterfaceIndexStateHandler interface { + Handle(PutDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexState creates a new http.Handler for the put data waveserver interfaces logical interface index state operation +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexState(ctx *middleware.Context, handler PutDataWaveserverInterfacesLogicalInterfaceIndexStateHandler) *PutDataWaveserverInterfacesLogicalInterfaceIndexState { + return &PutDataWaveserverInterfacesLogicalInterfaceIndexState{Context: ctx, Handler: handler} +} + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexState swagger:route PUT /data/waveserver-interfaces/logical-interface={index}/state/ ciena-waveserver-interfaces putDataWaveserverInterfacesLogicalInterfaceIndexState + +creates or updates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State + +Logical interface state information. + +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexState struct { + Context *middleware.Context + Handler PutDataWaveserverInterfacesLogicalInterfaceIndexStateHandler +} + +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexState) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPutDataWaveserverInterfacesLogicalInterfaceIndexStateParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_state_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_state_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..cb65d5af6dc9a7ab77003cc59465a9bbcaf974c3 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_state_parameters.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexStateParams creates a new PutDataWaveserverInterfacesLogicalInterfaceIndexStateParams object +// no default values defined in spec. +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexStateParams() PutDataWaveserverInterfacesLogicalInterfaceIndexStateParams { + + return PutDataWaveserverInterfacesLogicalInterfaceIndexStateParams{} +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexStateParams contains all the bound params for the put data waveserver interfaces logical interface index state operation +// typically these are obtained from a http.Request +// +// swagger:parameters PutDataWaveserverInterfacesLogicalInterfaceIndexState +type PutDataWaveserverInterfacesLogicalInterfaceIndexStateParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State to be added or updated + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateWrapper + /*Id of logical-interface + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPutDataWaveserverInterfacesLogicalInterfaceIndexStateParams() beforehand. +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexStateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesLogicalinterfaceStateBodyParam = &body + } + } + } + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexStateParams) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_state_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_state_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b6afaa3b5720662c5e26b341b5a6aed12d02769a --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_state_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PutDataWaveserverInterfacesLogicalInterfaceIndexStateCreatedCode is the HTTP code returned for type PutDataWaveserverInterfacesLogicalInterfaceIndexStateCreated +const PutDataWaveserverInterfacesLogicalInterfaceIndexStateCreatedCode int = 201 + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexStateCreated Object created + +swagger:response putDataWaveserverInterfacesLogicalInterfaceIndexStateCreated +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexStateCreated struct { +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexStateCreated creates PutDataWaveserverInterfacesLogicalInterfaceIndexStateCreated with default headers values +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexStateCreated() *PutDataWaveserverInterfacesLogicalInterfaceIndexStateCreated { + + return &PutDataWaveserverInterfacesLogicalInterfaceIndexStateCreated{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexStateCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexStateNoContentCode is the HTTP code returned for type PutDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent +const PutDataWaveserverInterfacesLogicalInterfaceIndexStateNoContentCode int = 204 + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent Object modified + +swagger:response putDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent struct { +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent creates PutDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent with default headers values +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent() *PutDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent { + + return &PutDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexStateNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// PutDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequestCode is the HTTP code returned for type PutDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest +const PutDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequestCode int = 400 + +/*PutDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest Internal error + +swagger:response putDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest +*/ +type PutDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest struct { +} + +// NewPutDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest creates PutDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest with default headers values +func NewPutDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest() *PutDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest { + + return &PutDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexStateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_state_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_state_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..deccad35eda99273f21d40adb1b2f91b08f5f072 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_state_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// PutDataWaveserverInterfacesLogicalInterfaceIndexStateURL generates an URL for the put data waveserver interfaces logical interface index state operation +type PutDataWaveserverInterfacesLogicalInterfaceIndexStateURL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexStateURL) WithBasePath(bp string) *PutDataWaveserverInterfacesLogicalInterfaceIndexStateURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexStateURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexStateURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/state/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on PutDataWaveserverInterfacesLogicalInterfaceIndexStateURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexStateURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexStateURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexStateURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PutDataWaveserverInterfacesLogicalInterfaceIndexStateURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PutDataWaveserverInterfacesLogicalInterfaceIndexStateURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexStateURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..840540e9f4d28a82927d0afd06fd20fcbe00cece --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_logical_interface_index_urlbuilder.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// PutDataWaveserverInterfacesLogicalInterfaceIndexURL generates an URL for the put data waveserver interfaces logical interface index operation +type PutDataWaveserverInterfacesLogicalInterfaceIndexURL struct { + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexURL) WithBasePath(bp string) *PutDataWaveserverInterfacesLogicalInterfaceIndexURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/logical-interface={index}/" + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on PutDataWaveserverInterfacesLogicalInterfaceIndexURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PutDataWaveserverInterfacesLogicalInterfaceIndexURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PutDataWaveserverInterfacesLogicalInterfaceIndexURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PutDataWaveserverInterfacesLogicalInterfaceIndexURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..15d2a8fe668989ac476d74a2825d7de0c4a31710 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_parameters.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPutDataWaveserverInterfacesParams creates a new PutDataWaveserverInterfacesParams object +// no default values defined in spec. +func NewPutDataWaveserverInterfacesParams() PutDataWaveserverInterfacesParams { + + return PutDataWaveserverInterfacesParams{} +} + +// PutDataWaveserverInterfacesParams contains all the bound params for the put data waveserver interfaces operation +// typically these are obtained from a http.Request +// +// swagger:parameters PutDataWaveserverInterfaces +type PutDataWaveserverInterfacesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.WaveserverInterfaces to be added or updated + In: body + */ + CienaWaveserverInterfacesWaveserverInterfacesBodyParam *models.CienaWaveserverInterfacesWaveserverInterfacesWrapper +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPutDataWaveserverInterfacesParams() beforehand. +func (o *PutDataWaveserverInterfacesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverInterfacesWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverInterfacesBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverInterfacesBodyParam = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name.go new file mode 100644 index 0000000000000000000000000000000000000000..4db5d058eec65a009aa7fa5defa52bed93136382 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PutDataWaveserverInterfacesPhysicalInterfaceNameHandlerFunc turns a function with the right signature into a put data waveserver interfaces physical interface name handler +type PutDataWaveserverInterfacesPhysicalInterfaceNameHandlerFunc func(PutDataWaveserverInterfacesPhysicalInterfaceNameParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PutDataWaveserverInterfacesPhysicalInterfaceNameHandlerFunc) Handle(params PutDataWaveserverInterfacesPhysicalInterfaceNameParams) middleware.Responder { + return fn(params) +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNameHandler interface for that can handle valid put data waveserver interfaces physical interface name params +type PutDataWaveserverInterfacesPhysicalInterfaceNameHandler interface { + Handle(PutDataWaveserverInterfacesPhysicalInterfaceNameParams) middleware.Responder +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceName creates a new http.Handler for the put data waveserver interfaces physical interface name operation +func NewPutDataWaveserverInterfacesPhysicalInterfaceName(ctx *middleware.Context, handler PutDataWaveserverInterfacesPhysicalInterfaceNameHandler) *PutDataWaveserverInterfacesPhysicalInterfaceName { + return &PutDataWaveserverInterfacesPhysicalInterfaceName{Context: ctx, Handler: handler} +} + +/*PutDataWaveserverInterfacesPhysicalInterfaceName swagger:route PUT /data/waveserver-interfaces/physical-interface={name}/ ciena-waveserver-interfaces putDataWaveserverInterfacesPhysicalInterfaceName + +creates or updates ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface + +List of physical Ethernet management interfaces. + +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceName struct { + Context *middleware.Context + Handler PutDataWaveserverInterfacesPhysicalInterfaceNameHandler +} + +func (o *PutDataWaveserverInterfacesPhysicalInterfaceName) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPutDataWaveserverInterfacesPhysicalInterfaceNameParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_id.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_id.go new file mode 100644 index 0000000000000000000000000000000000000000..d57be0563cd7b42defc3ed72f94d4b28869aeb04 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_id.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PutDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc turns a function with the right signature into a put data waveserver interfaces physical interface name ID handler +type PutDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc func(PutDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PutDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc) Handle(params PutDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder { + return fn(params) +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNameIDHandler interface for that can handle valid put data waveserver interfaces physical interface name ID params +type PutDataWaveserverInterfacesPhysicalInterfaceNameIDHandler interface { + Handle(PutDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNameID creates a new http.Handler for the put data waveserver interfaces physical interface name ID operation +func NewPutDataWaveserverInterfacesPhysicalInterfaceNameID(ctx *middleware.Context, handler PutDataWaveserverInterfacesPhysicalInterfaceNameIDHandler) *PutDataWaveserverInterfacesPhysicalInterfaceNameID { + return &PutDataWaveserverInterfacesPhysicalInterfaceNameID{Context: ctx, Handler: handler} +} + +/*PutDataWaveserverInterfacesPhysicalInterfaceNameID swagger:route PUT /data/waveserver-interfaces/physical-interface={name}/id/ ciena-waveserver-interfaces putDataWaveserverInterfacesPhysicalInterfaceNameId + +creates or updates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id + +Identification information of this management interface. + +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNameID struct { + Context *middleware.Context + Handler PutDataWaveserverInterfacesPhysicalInterfaceNameIDHandler +} + +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPutDataWaveserverInterfacesPhysicalInterfaceNameIDParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_id_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_id_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..467442075d8c15a868feba1e6849dd8d5b59997c --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_id_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNameIDParams creates a new PutDataWaveserverInterfacesPhysicalInterfaceNameIDParams object +// no default values defined in spec. +func NewPutDataWaveserverInterfacesPhysicalInterfaceNameIDParams() PutDataWaveserverInterfacesPhysicalInterfaceNameIDParams { + + return PutDataWaveserverInterfacesPhysicalInterfaceNameIDParams{} +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNameIDParams contains all the bound params for the put data waveserver interfaces physical interface name ID operation +// typically these are obtained from a http.Request +// +// swagger:parameters PutDataWaveserverInterfacesPhysicalInterfaceNameID +type PutDataWaveserverInterfacesPhysicalInterfaceNameIDParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id to be added or updated + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIDBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIDWrapper + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPutDataWaveserverInterfacesPhysicalInterfaceNameIDParams() beforehand. +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIDWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIdBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceIDBodyParam = &body + } + } + } + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameIDParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_id_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_id_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b995d3310990e415f5f41a325ecd1cbe604eae2b --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_id_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PutDataWaveserverInterfacesPhysicalInterfaceNameIDCreatedCode is the HTTP code returned for type PutDataWaveserverInterfacesPhysicalInterfaceNameIDCreated +const PutDataWaveserverInterfacesPhysicalInterfaceNameIDCreatedCode int = 201 + +/*PutDataWaveserverInterfacesPhysicalInterfaceNameIDCreated Object created + +swagger:response putDataWaveserverInterfacesPhysicalInterfaceNameIdCreated +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNameIDCreated struct { +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNameIDCreated creates PutDataWaveserverInterfacesPhysicalInterfaceNameIDCreated with default headers values +func NewPutDataWaveserverInterfacesPhysicalInterfaceNameIDCreated() *PutDataWaveserverInterfacesPhysicalInterfaceNameIDCreated { + + return &PutDataWaveserverInterfacesPhysicalInterfaceNameIDCreated{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameIDCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNameIDNoContentCode is the HTTP code returned for type PutDataWaveserverInterfacesPhysicalInterfaceNameIDNoContent +const PutDataWaveserverInterfacesPhysicalInterfaceNameIDNoContentCode int = 204 + +/*PutDataWaveserverInterfacesPhysicalInterfaceNameIDNoContent Object modified + +swagger:response putDataWaveserverInterfacesPhysicalInterfaceNameIdNoContent +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNameIDNoContent struct { +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNameIDNoContent creates PutDataWaveserverInterfacesPhysicalInterfaceNameIDNoContent with default headers values +func NewPutDataWaveserverInterfacesPhysicalInterfaceNameIDNoContent() *PutDataWaveserverInterfacesPhysicalInterfaceNameIDNoContent { + + return &PutDataWaveserverInterfacesPhysicalInterfaceNameIDNoContent{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameIDNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequestCode is the HTTP code returned for type PutDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest +const PutDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequestCode int = 400 + +/*PutDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest Internal error + +swagger:response putDataWaveserverInterfacesPhysicalInterfaceNameIdBadRequest +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest struct { +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest creates PutDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest with default headers values +func NewPutDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest() *PutDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest { + + return &PutDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_id_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_id_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..71e6c552a22d6b7ee9326e4ba04fe1a531a799f7 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_id_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// PutDataWaveserverInterfacesPhysicalInterfaceNameIDURL generates an URL for the put data waveserver interfaces physical interface name ID operation +type PutDataWaveserverInterfacesPhysicalInterfaceNameIDURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameIDURL) WithBasePath(bp string) *PutDataWaveserverInterfacesPhysicalInterfaceNameIDURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameIDURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameIDURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/id/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on PutDataWaveserverInterfacesPhysicalInterfaceNameIDURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameIDURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameIDURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameIDURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PutDataWaveserverInterfacesPhysicalInterfaceNameIDURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PutDataWaveserverInterfacesPhysicalInterfaceNameIDURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameIDURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..84912aafd597e43d088f4caf7063a38d90296907 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNameParams creates a new PutDataWaveserverInterfacesPhysicalInterfaceNameParams object +// no default values defined in spec. +func NewPutDataWaveserverInterfacesPhysicalInterfaceNameParams() PutDataWaveserverInterfacesPhysicalInterfaceNameParams { + + return PutDataWaveserverInterfacesPhysicalInterfaceNameParams{} +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNameParams contains all the bound params for the put data waveserver interfaces physical interface name operation +// typically these are obtained from a http.Request +// +// swagger:parameters PutDataWaveserverInterfacesPhysicalInterfaceName +type PutDataWaveserverInterfacesPhysicalInterfaceNameParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface to be added or updated + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceWrapper + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPutDataWaveserverInterfacesPhysicalInterfaceNameParams() beforehand. +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesPhysicalInterfaceBodyParam = &body + } + } + } + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties.go new file mode 100644 index 0000000000000000000000000000000000000000..45bcca7608552f11b36a1d1d3e7ada8eefe470c7 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc turns a function with the right signature into a put data waveserver interfaces physical interface name properties handler +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc func(PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc) Handle(params PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder { + return fn(params) +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler interface for that can handle valid put data waveserver interfaces physical interface name properties params +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler interface { + Handle(PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNameProperties creates a new http.Handler for the put data waveserver interfaces physical interface name properties operation +func NewPutDataWaveserverInterfacesPhysicalInterfaceNameProperties(ctx *middleware.Context, handler PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler) *PutDataWaveserverInterfacesPhysicalInterfaceNameProperties { + return &PutDataWaveserverInterfacesPhysicalInterfaceNameProperties{Context: ctx, Handler: handler} +} + +/*PutDataWaveserverInterfacesPhysicalInterfaceNameProperties swagger:route PUT /data/waveserver-interfaces/physical-interface={name}/properties/ ciena-waveserver-interfaces putDataWaveserverInterfacesPhysicalInterfaceNameProperties + +creates or updates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties + +All the configuration data of the physical management interface. + +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNameProperties struct { + Context *middleware.Context + Handler PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler +} + +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameProperties) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_ethernet.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_ethernet.go new file mode 100644 index 0000000000000000000000000000000000000000..d6655b363374771da2067588ec71c43928491d63 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_ethernet.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc turns a function with the right signature into a put data waveserver interfaces physical interface name properties ethernet handler +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc func(PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc) Handle(params PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder { + return fn(params) +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler interface for that can handle valid put data waveserver interfaces physical interface name properties ethernet params +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler interface { + Handle(PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet creates a new http.Handler for the put data waveserver interfaces physical interface name properties ethernet operation +func NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet(ctx *middleware.Context, handler PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler) *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet { + return &PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet{Context: ctx, Handler: handler} +} + +/*PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet swagger:route PUT /data/waveserver-interfaces/physical-interface={name}/properties/ethernet/ ciena-waveserver-interfaces putDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet + +creates or updates ciena.waveserver.interfaces.EthernetIfPropertiesGroup + +Ethernet interface attributes. + +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet struct { + Context *middleware.Context + Handler PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler +} + +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_ethernet_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_ethernet_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d0c82932cc0452d62c887a4a05f7c759fc3e16a3 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_ethernet_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams creates a new PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams object +// no default values defined in spec. +func NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams() PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams { + + return PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams{} +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams contains all the bound params for the put data waveserver interfaces physical interface name properties ethernet operation +// typically these are obtained from a http.Request +// +// swagger:parameters PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.EthernetIfPropertiesGroup to be added or updated + In: body + */ + CienaWaveserverInterfacesEthernetIfPropertiesGroupBodyParam *models.CienaWaveserverInterfacesEthernetIfPropertiesGroupWrapper + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams() beforehand. +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesEthernetIfPropertiesGroupWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesEthernetIfPropertiesGroupBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesEthernetIfPropertiesGroupBodyParam = &body + } + } + } + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_ethernet_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_ethernet_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..6c227af1ce722afb013c9abf42de88c080babf2f --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_ethernet_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreatedCode is the HTTP code returned for type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated +const PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreatedCode int = 201 + +/*PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated Object created + +swagger:response putDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated struct { +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated creates PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated with default headers values +func NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated() *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated { + + return &PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContentCode is the HTTP code returned for type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent +const PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContentCode int = 204 + +/*PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent Object modified + +swagger:response putDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent struct { +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent creates PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent with default headers values +func NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent() *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent { + + return &PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequestCode is the HTTP code returned for type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest +const PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequestCode int = 400 + +/*PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest Internal error + +swagger:response putDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest struct { +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest creates PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest with default headers values +func NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest() *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest { + + return &PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_ethernet_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_ethernet_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..0e060d443a8c48c545c08781b3c20ff2bd4ae9a0 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_ethernet_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL generates an URL for the put data waveserver interfaces physical interface name properties ethernet operation +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) WithBasePath(bp string) *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/properties/ethernet/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_management.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_management.go new file mode 100644 index 0000000000000000000000000000000000000000..130e739d9d0b28f1f3633e83b328b2ba873963ff --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_management.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc turns a function with the right signature into a put data waveserver interfaces physical interface name properties management handler +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc func(PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc) Handle(params PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder { + return fn(params) +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler interface for that can handle valid put data waveserver interfaces physical interface name properties management params +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler interface { + Handle(PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement creates a new http.Handler for the put data waveserver interfaces physical interface name properties management operation +func NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement(ctx *middleware.Context, handler PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler) *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement { + return &PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement{Context: ctx, Handler: handler} +} + +/*PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement swagger:route PUT /data/waveserver-interfaces/physical-interface={name}/properties/management/ ciena-waveserver-interfaces putDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement + +creates or updates ciena.waveserver.interfaces.ManagementIfPropertiesGroup + +Management interface attributes. + +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement struct { + Context *middleware.Context + Handler PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler +} + +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_management_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_management_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c96d91f78172c1e9d1bbd742df7ea6851f577e88 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_management_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams creates a new PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams object +// no default values defined in spec. +func NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams() PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams { + + return PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams{} +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams contains all the bound params for the put data waveserver interfaces physical interface name properties management operation +// typically these are obtained from a http.Request +// +// swagger:parameters PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.ManagementIfPropertiesGroup to be added or updated + In: body + */ + CienaWaveserverInterfacesManagementIfPropertiesGroupBodyParam *models.CienaWaveserverInterfacesManagementIfPropertiesGroupWrapper + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams() beforehand. +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesManagementIfPropertiesGroupWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesManagementIfPropertiesGroupBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesManagementIfPropertiesGroupBodyParam = &body + } + } + } + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_management_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_management_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..623c38fdc4dcc28bd37712abbf17ab3a6b560307 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_management_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreatedCode is the HTTP code returned for type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated +const PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreatedCode int = 201 + +/*PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated Object created + +swagger:response putDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated struct { +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated creates PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated with default headers values +func NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated() *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated { + + return &PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContentCode is the HTTP code returned for type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent +const PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContentCode int = 204 + +/*PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent Object modified + +swagger:response putDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent struct { +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent creates PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent with default headers values +func NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent() *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent { + + return &PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequestCode is the HTTP code returned for type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest +const PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequestCode int = 400 + +/*PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest Internal error + +swagger:response putDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest struct { +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest creates PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest with default headers values +func NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest() *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest { + + return &PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_management_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_management_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..69d3b4e5c4ffa19d475182b5c24a008d02a51a62 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_management_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL generates an URL for the put data waveserver interfaces physical interface name properties management operation +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) WithBasePath(bp string) *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/properties/management/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..f33a4c289c8a8736ffef84f58604013c016400e9 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams creates a new PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams object +// no default values defined in spec. +func NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams() PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams { + + return PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams{} +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams contains all the bound params for the put data waveserver interfaces physical interface name properties operation +// typically these are obtained from a http.Request +// +// swagger:parameters PutDataWaveserverInterfacesPhysicalInterfaceNameProperties +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties to be added or updated + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesWrapper + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams() beforehand. +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfacePropertiesBodyParam = &body + } + } + } + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..fdac91c86fade627fc38907e3e39d60bf9ec1413 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreatedCode is the HTTP code returned for type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated +const PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreatedCode int = 201 + +/*PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated Object created + +swagger:response putDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated struct { +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated creates PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated with default headers values +func NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated() *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated { + + return &PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContentCode is the HTTP code returned for type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent +const PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContentCode int = 204 + +/*PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent Object modified + +swagger:response putDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent struct { +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent creates PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent with default headers values +func NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent() *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent { + + return &PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequestCode is the HTTP code returned for type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest +const PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequestCode int = 400 + +/*PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest Internal error + +swagger:response putDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest struct { +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest creates PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest with default headers values +func NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest() *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest { + + return &PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..6544b1b13d1a418774fae58d5b67967dd5c9035b --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_properties_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL generates an URL for the put data waveserver interfaces physical interface name properties operation +type PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) WithBasePath(bp string) *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/properties/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..0947a60a4cc4f24cfdff2ba34fabaff8f40d68fd --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PutDataWaveserverInterfacesPhysicalInterfaceNameCreatedCode is the HTTP code returned for type PutDataWaveserverInterfacesPhysicalInterfaceNameCreated +const PutDataWaveserverInterfacesPhysicalInterfaceNameCreatedCode int = 201 + +/*PutDataWaveserverInterfacesPhysicalInterfaceNameCreated Object created + +swagger:response putDataWaveserverInterfacesPhysicalInterfaceNameCreated +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNameCreated struct { +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNameCreated creates PutDataWaveserverInterfacesPhysicalInterfaceNameCreated with default headers values +func NewPutDataWaveserverInterfacesPhysicalInterfaceNameCreated() *PutDataWaveserverInterfacesPhysicalInterfaceNameCreated { + + return &PutDataWaveserverInterfacesPhysicalInterfaceNameCreated{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNameNoContentCode is the HTTP code returned for type PutDataWaveserverInterfacesPhysicalInterfaceNameNoContent +const PutDataWaveserverInterfacesPhysicalInterfaceNameNoContentCode int = 204 + +/*PutDataWaveserverInterfacesPhysicalInterfaceNameNoContent Object modified + +swagger:response putDataWaveserverInterfacesPhysicalInterfaceNameNoContent +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNameNoContent struct { +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNameNoContent creates PutDataWaveserverInterfacesPhysicalInterfaceNameNoContent with default headers values +func NewPutDataWaveserverInterfacesPhysicalInterfaceNameNoContent() *PutDataWaveserverInterfacesPhysicalInterfaceNameNoContent { + + return &PutDataWaveserverInterfacesPhysicalInterfaceNameNoContent{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNameBadRequestCode is the HTTP code returned for type PutDataWaveserverInterfacesPhysicalInterfaceNameBadRequest +const PutDataWaveserverInterfacesPhysicalInterfaceNameBadRequestCode int = 400 + +/*PutDataWaveserverInterfacesPhysicalInterfaceNameBadRequest Internal error + +swagger:response putDataWaveserverInterfacesPhysicalInterfaceNameBadRequest +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNameBadRequest struct { +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNameBadRequest creates PutDataWaveserverInterfacesPhysicalInterfaceNameBadRequest with default headers values +func NewPutDataWaveserverInterfacesPhysicalInterfaceNameBadRequest() *PutDataWaveserverInterfacesPhysicalInterfaceNameBadRequest { + + return &PutDataWaveserverInterfacesPhysicalInterfaceNameBadRequest{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_state.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_state.go new file mode 100644 index 0000000000000000000000000000000000000000..11f14e5cc7c5e0aa62154a678b2afa907849cbb6 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_state.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PutDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc turns a function with the right signature into a put data waveserver interfaces physical interface name state handler +type PutDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc func(PutDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PutDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc) Handle(params PutDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder { + return fn(params) +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNameStateHandler interface for that can handle valid put data waveserver interfaces physical interface name state params +type PutDataWaveserverInterfacesPhysicalInterfaceNameStateHandler interface { + Handle(PutDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNameState creates a new http.Handler for the put data waveserver interfaces physical interface name state operation +func NewPutDataWaveserverInterfacesPhysicalInterfaceNameState(ctx *middleware.Context, handler PutDataWaveserverInterfacesPhysicalInterfaceNameStateHandler) *PutDataWaveserverInterfacesPhysicalInterfaceNameState { + return &PutDataWaveserverInterfacesPhysicalInterfaceNameState{Context: ctx, Handler: handler} +} + +/*PutDataWaveserverInterfacesPhysicalInterfaceNameState swagger:route PUT /data/waveserver-interfaces/physical-interface={name}/state/ ciena-waveserver-interfaces putDataWaveserverInterfacesPhysicalInterfaceNameState + +creates or updates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State + +Physical management interface state information. + +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNameState struct { + Context *middleware.Context + Handler PutDataWaveserverInterfacesPhysicalInterfaceNameStateHandler +} + +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameState) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPutDataWaveserverInterfacesPhysicalInterfaceNameStateParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_state_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_state_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..f711592b45cfc03004998cba95d597ef752b8dc0 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_state_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNameStateParams creates a new PutDataWaveserverInterfacesPhysicalInterfaceNameStateParams object +// no default values defined in spec. +func NewPutDataWaveserverInterfacesPhysicalInterfaceNameStateParams() PutDataWaveserverInterfacesPhysicalInterfaceNameStateParams { + + return PutDataWaveserverInterfacesPhysicalInterfaceNameStateParams{} +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNameStateParams contains all the bound params for the put data waveserver interfaces physical interface name state operation +// typically these are obtained from a http.Request +// +// swagger:parameters PutDataWaveserverInterfacesPhysicalInterfaceNameState +type PutDataWaveserverInterfacesPhysicalInterfaceNameStateParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State to be added or updated + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateWrapper + /*Id of physical-interface + Required: true + In: path + */ + Name string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPutDataWaveserverInterfacesPhysicalInterfaceNameStateParams() beforehand. +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameStateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesPhysicalinterfaceStateBodyParam = &body + } + } + } + rName, rhkName, _ := route.Params.GetOK("name") + if err := o.bindName(rName, rhkName, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindName binds and validates parameter Name from path. +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameStateParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Name = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_state_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_state_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..436f0f5e2564283de080e93775235f004dfd9bbb --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_state_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PutDataWaveserverInterfacesPhysicalInterfaceNameStateCreatedCode is the HTTP code returned for type PutDataWaveserverInterfacesPhysicalInterfaceNameStateCreated +const PutDataWaveserverInterfacesPhysicalInterfaceNameStateCreatedCode int = 201 + +/*PutDataWaveserverInterfacesPhysicalInterfaceNameStateCreated Object created + +swagger:response putDataWaveserverInterfacesPhysicalInterfaceNameStateCreated +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNameStateCreated struct { +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNameStateCreated creates PutDataWaveserverInterfacesPhysicalInterfaceNameStateCreated with default headers values +func NewPutDataWaveserverInterfacesPhysicalInterfaceNameStateCreated() *PutDataWaveserverInterfacesPhysicalInterfaceNameStateCreated { + + return &PutDataWaveserverInterfacesPhysicalInterfaceNameStateCreated{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameStateCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNameStateNoContentCode is the HTTP code returned for type PutDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent +const PutDataWaveserverInterfacesPhysicalInterfaceNameStateNoContentCode int = 204 + +/*PutDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent Object modified + +swagger:response putDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent struct { +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent creates PutDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent with default headers values +func NewPutDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent() *PutDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent { + + return &PutDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameStateNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// PutDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequestCode is the HTTP code returned for type PutDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest +const PutDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequestCode int = 400 + +/*PutDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest Internal error + +swagger:response putDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest +*/ +type PutDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest struct { +} + +// NewPutDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest creates PutDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest with default headers values +func NewPutDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest() *PutDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest { + + return &PutDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameStateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_state_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_state_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..7bf2888c67cc60e88b751b4299f4a3ba8970278b --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_state_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// PutDataWaveserverInterfacesPhysicalInterfaceNameStateURL generates an URL for the put data waveserver interfaces physical interface name state operation +type PutDataWaveserverInterfacesPhysicalInterfaceNameStateURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameStateURL) WithBasePath(bp string) *PutDataWaveserverInterfacesPhysicalInterfaceNameStateURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameStateURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameStateURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/state/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on PutDataWaveserverInterfacesPhysicalInterfaceNameStateURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameStateURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameStateURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameStateURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PutDataWaveserverInterfacesPhysicalInterfaceNameStateURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PutDataWaveserverInterfacesPhysicalInterfaceNameStateURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameStateURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..d1aeefe19ef50e46016154c631eeff6973dbca8c --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_physical_interface_name_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// PutDataWaveserverInterfacesPhysicalInterfaceNameURL generates an URL for the put data waveserver interfaces physical interface name operation +type PutDataWaveserverInterfacesPhysicalInterfaceNameURL struct { + Name string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameURL) WithBasePath(bp string) *PutDataWaveserverInterfacesPhysicalInterfaceNameURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/physical-interface={name}/" + + name := o.Name + if name != "" { + _path = strings.Replace(_path, "{name}", name, -1) + } else { + return nil, errors.New("name is required on PutDataWaveserverInterfacesPhysicalInterfaceNameURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PutDataWaveserverInterfacesPhysicalInterfaceNameURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PutDataWaveserverInterfacesPhysicalInterfaceNameURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PutDataWaveserverInterfacesPhysicalInterfaceNameURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..3d4c5e044fbfb709a3b4216b00307b4a79b178f3 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PutDataWaveserverInterfacesCreatedCode is the HTTP code returned for type PutDataWaveserverInterfacesCreated +const PutDataWaveserverInterfacesCreatedCode int = 201 + +/*PutDataWaveserverInterfacesCreated Object created + +swagger:response putDataWaveserverInterfacesCreated +*/ +type PutDataWaveserverInterfacesCreated struct { +} + +// NewPutDataWaveserverInterfacesCreated creates PutDataWaveserverInterfacesCreated with default headers values +func NewPutDataWaveserverInterfacesCreated() *PutDataWaveserverInterfacesCreated { + + return &PutDataWaveserverInterfacesCreated{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PutDataWaveserverInterfacesNoContentCode is the HTTP code returned for type PutDataWaveserverInterfacesNoContent +const PutDataWaveserverInterfacesNoContentCode int = 204 + +/*PutDataWaveserverInterfacesNoContent Object modified + +swagger:response putDataWaveserverInterfacesNoContent +*/ +type PutDataWaveserverInterfacesNoContent struct { +} + +// NewPutDataWaveserverInterfacesNoContent creates PutDataWaveserverInterfacesNoContent with default headers values +func NewPutDataWaveserverInterfacesNoContent() *PutDataWaveserverInterfacesNoContent { + + return &PutDataWaveserverInterfacesNoContent{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// PutDataWaveserverInterfacesBadRequestCode is the HTTP code returned for type PutDataWaveserverInterfacesBadRequest +const PutDataWaveserverInterfacesBadRequestCode int = 400 + +/*PutDataWaveserverInterfacesBadRequest Internal error + +swagger:response putDataWaveserverInterfacesBadRequest +*/ +type PutDataWaveserverInterfacesBadRequest struct { +} + +// NewPutDataWaveserverInterfacesBadRequest creates PutDataWaveserverInterfacesBadRequest with default headers values +func NewPutDataWaveserverInterfacesBadRequest() *PutDataWaveserverInterfacesBadRequest { + + return &PutDataWaveserverInterfacesBadRequest{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes.go new file mode 100644 index 0000000000000000000000000000000000000000..e4badfb919a92bf64a87af247f8891a76026718e --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PutDataWaveserverInterfacesRoutesHandlerFunc turns a function with the right signature into a put data waveserver interfaces routes handler +type PutDataWaveserverInterfacesRoutesHandlerFunc func(PutDataWaveserverInterfacesRoutesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PutDataWaveserverInterfacesRoutesHandlerFunc) Handle(params PutDataWaveserverInterfacesRoutesParams) middleware.Responder { + return fn(params) +} + +// PutDataWaveserverInterfacesRoutesHandler interface for that can handle valid put data waveserver interfaces routes params +type PutDataWaveserverInterfacesRoutesHandler interface { + Handle(PutDataWaveserverInterfacesRoutesParams) middleware.Responder +} + +// NewPutDataWaveserverInterfacesRoutes creates a new http.Handler for the put data waveserver interfaces routes operation +func NewPutDataWaveserverInterfacesRoutes(ctx *middleware.Context, handler PutDataWaveserverInterfacesRoutesHandler) *PutDataWaveserverInterfacesRoutes { + return &PutDataWaveserverInterfacesRoutes{Context: ctx, Handler: handler} +} + +/*PutDataWaveserverInterfacesRoutes swagger:route PUT /data/waveserver-interfaces/routes/ ciena-waveserver-interfaces putDataWaveserverInterfacesRoutes + +creates or updates ciena.waveserver.interfaces.waveserverinterfaces.Routes + +Top-level container for IP route configuration and operational data. + +*/ +type PutDataWaveserverInterfacesRoutes struct { + Context *middleware.Context + Handler PutDataWaveserverInterfacesRoutesHandler +} + +func (o *PutDataWaveserverInterfacesRoutes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPutDataWaveserverInterfacesRoutesParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination.go new file mode 100644 index 0000000000000000000000000000000000000000..4b1e7b536601c556adf941b8ad36ee28696e9bb3 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandlerFunc turns a function with the right signature into a put data waveserver interfaces routes IP v4 static route destination handler +type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandlerFunc func(PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandlerFunc) Handle(params PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) middleware.Responder { + return fn(params) +} + +// PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler interface for that can handle valid put data waveserver interfaces routes IP v4 static route destination params +type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler interface { + Handle(PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) middleware.Responder +} + +// NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestination creates a new http.Handler for the put data waveserver interfaces routes IP v4 static route destination operation +func NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestination(ctx *middleware.Context, handler PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler) *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestination { + return &PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestination{Context: ctx, Handler: handler} +} + +/*PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestination swagger:route PUT /data/waveserver-interfaces/routes/ipv4-static-route={destination}/ ciena-waveserver-interfaces putDataWaveserverInterfacesRoutesIpV4StaticRouteDestination + +creates or updates ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute + +List of IPv4 static routing entries. + +*/ +type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestination struct { + Context *middleware.Context + Handler PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler +} + +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestination) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index.go new file mode 100644 index 0000000000000000000000000000000000000000..679567940070a97942d54d459ea25bd98adb7fab --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandlerFunc turns a function with the right signature into a put data waveserver interfaces routes IP v4 static route destination next hop index handler +type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandlerFunc func(PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandlerFunc) Handle(params PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) middleware.Responder { + return fn(params) +} + +// PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler interface for that can handle valid put data waveserver interfaces routes IP v4 static route destination next hop index params +type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler interface { + Handle(PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) middleware.Responder +} + +// NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex creates a new http.Handler for the put data waveserver interfaces routes IP v4 static route destination next hop index operation +func NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex(ctx *middleware.Context, handler PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler) *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex { + return &PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex{Context: ctx, Handler: handler} +} + +/*PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex swagger:route PUT /data/waveserver-interfaces/routes/ipv4-static-route={destination}/next-hop={index}/ ciena-waveserver-interfaces putDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationNextHopIndex + +creates or updates ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop + +A list of next-hop entries associated with the static route. + +*/ +type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex struct { + Context *middleware.Context + Handler PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler +} + +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + r = rCtx + } + var Params = NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams() + + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b29bff0e4bddb50fc180ee2ec94b2cfdf4b3eb83 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_parameters.go @@ -0,0 +1,125 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams creates a new PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams object +// no default values defined in spec. +func NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams() PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams { + + return PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams{} +} + +// PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams contains all the bound params for the put data waveserver interfaces routes IP v4 static route destination next hop index operation +// typically these are obtained from a http.Request +// +// swagger:parameters PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex +type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop to be added or updated + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopWrapper + /*Id of ipv4-static-route + Required: true + In: path + */ + Destination string + /*Id of next-hop + Required: true + In: path + */ + Index int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams() beforehand. +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4staticrouteNextHopBodyParam = &body + } + } + } + rDestination, rhkDestination, _ := route.Params.GetOK("destination") + if err := o.bindDestination(rDestination, rhkDestination, route.Formats); err != nil { + res = append(res, err) + } + + rIndex, rhkIndex, _ := route.Params.GetOK("index") + if err := o.bindIndex(rIndex, rhkIndex, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindDestination binds and validates parameter Destination from path. +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) bindDestination(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Destination = raw + + return nil +} + +// bindIndex binds and validates parameter Index from path. +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) bindIndex(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("index", "path", "int64", raw) + } + o.Index = value + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b77436acb44b223d6bbdf3403c930c29a5ec07af --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexCreatedCode is the HTTP code returned for type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexCreated +const PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexCreatedCode int = 201 + +/*PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexCreated Object created + +swagger:response putDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationNextHopIndexCreated +*/ +type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexCreated struct { +} + +// NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexCreated creates PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexCreated with default headers values +func NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexCreated() *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexCreated { + + return &PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexCreated{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContentCode is the HTTP code returned for type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContent +const PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContentCode int = 204 + +/*PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContent Object modified + +swagger:response putDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationNextHopIndexNoContent +*/ +type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContent struct { +} + +// NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContent creates PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContent with default headers values +func NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContent() *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContent { + + return &PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContent{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequestCode is the HTTP code returned for type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest +const PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequestCode int = 400 + +/*PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest Internal error + +swagger:response putDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationNextHopIndexBadRequest +*/ +type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest struct { +} + +// NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest creates PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest with default headers values +func NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest() *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest { + + return &PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..8c01974a0b6680f4b64dedda2cf95e590500b955 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_next_hop_index_urlbuilder.go @@ -0,0 +1,106 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL generates an URL for the put data waveserver interfaces routes IP v4 static route destination next hop index operation +type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL struct { + Destination string + Index int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) WithBasePath(bp string) *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/routes/ipv4-static-route={destination}/next-hop={index}/" + + destination := o.Destination + if destination != "" { + _path = strings.Replace(_path, "{destination}", destination, -1) + } else { + return nil, errors.New("destination is required on PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL") + } + + index := swag.FormatInt64(o.Index) + if index != "" { + _path = strings.Replace(_path, "{index}", index, -1) + } else { + return nil, errors.New("index is required on PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8a5e938fe92fd640018a74e25af2a8f71ae34668 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams creates a new PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams object +// no default values defined in spec. +func NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams() PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams { + + return PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams{} +} + +// PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams contains all the bound params for the put data waveserver interfaces routes IP v4 static route destination operation +// typically these are obtained from a http.Request +// +// swagger:parameters PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestination +type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute to be added or updated + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRouteBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRouteWrapper + /*Id of ipv4-static-route + Required: true + In: path + */ + Destination string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams() beforehand. +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRouteWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesRoutesIpv4StaticRouteBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesRoutesIPV4StaticRouteBodyParam = &body + } + } + } + rDestination, rhkDestination, _ := route.Params.GetOK("destination") + if err := o.bindDestination(rDestination, rhkDestination, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindDestination binds and validates parameter Destination from path. +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) bindDestination(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + o.Destination = raw + + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..642dbe9c2a566516537578feb8af3667f234e6b3 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationCreatedCode is the HTTP code returned for type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationCreated +const PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationCreatedCode int = 201 + +/*PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationCreated Object created + +swagger:response putDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationCreated +*/ +type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationCreated struct { +} + +// NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationCreated creates PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationCreated with default headers values +func NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationCreated() *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationCreated { + + return &PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationCreated{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContentCode is the HTTP code returned for type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContent +const PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContentCode int = 204 + +/*PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContent Object modified + +swagger:response putDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationNoContent +*/ +type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContent struct { +} + +// NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContent creates PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContent with default headers values +func NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContent() *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContent { + + return &PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContent{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequestCode is the HTTP code returned for type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest +const PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequestCode int = 400 + +/*PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest Internal error + +swagger:response putDataWaveserverInterfacesRoutesIpV4StaticRouteDestinationBadRequest +*/ +type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest struct { +} + +// NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest creates PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest with default headers values +func NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest() *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest { + + return &PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..baf381bfc43f5ad7a5ba1e6709fe2021a82f56b1 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_ip_v4_static_route_destination_urlbuilder.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL generates an URL for the put data waveserver interfaces routes IP v4 static route destination operation +type PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL struct { + Destination string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) WithBasePath(bp string) *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/routes/ipv4-static-route={destination}/" + + destination := o.Destination + if destination != "" { + _path = strings.Replace(_path, "{destination}", destination, -1) + } else { + return nil, errors.New("destination is required on PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL") + } + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_parameters.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..3ef2c3734d1397e8851265b4f6c73a3048f372a8 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_parameters.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/models" +) + +// NewPutDataWaveserverInterfacesRoutesParams creates a new PutDataWaveserverInterfacesRoutesParams object +// no default values defined in spec. +func NewPutDataWaveserverInterfacesRoutesParams() PutDataWaveserverInterfacesRoutesParams { + + return PutDataWaveserverInterfacesRoutesParams{} +} + +// PutDataWaveserverInterfacesRoutesParams contains all the bound params for the put data waveserver interfaces routes operation +// typically these are obtained from a http.Request +// +// swagger:parameters PutDataWaveserverInterfacesRoutes +type PutDataWaveserverInterfacesRoutesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ciena.waveserver.interfaces.waveserverinterfaces.Routes to be added or updated + In: body + */ + CienaWaveserverInterfacesWaveserverinterfacesRoutesBodyParam *models.CienaWaveserverInterfacesWaveserverinterfacesRoutesWrapper +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPutDataWaveserverInterfacesRoutesParams() beforehand. +func (o *PutDataWaveserverInterfacesRoutesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body models.CienaWaveserverInterfacesWaveserverinterfacesRoutesWrapper + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("cienaWaveserverInterfacesWaveserverinterfacesRoutesBodyParam", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CienaWaveserverInterfacesWaveserverinterfacesRoutesBodyParam = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_responses.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..25fa967aeb5996cd3d31b4c689c19ff241fd6388 --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_responses.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// PutDataWaveserverInterfacesRoutesCreatedCode is the HTTP code returned for type PutDataWaveserverInterfacesRoutesCreated +const PutDataWaveserverInterfacesRoutesCreatedCode int = 201 + +/*PutDataWaveserverInterfacesRoutesCreated Object created + +swagger:response putDataWaveserverInterfacesRoutesCreated +*/ +type PutDataWaveserverInterfacesRoutesCreated struct { +} + +// NewPutDataWaveserverInterfacesRoutesCreated creates PutDataWaveserverInterfacesRoutesCreated with default headers values +func NewPutDataWaveserverInterfacesRoutesCreated() *PutDataWaveserverInterfacesRoutesCreated { + + return &PutDataWaveserverInterfacesRoutesCreated{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesRoutesCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(201) +} + +// PutDataWaveserverInterfacesRoutesNoContentCode is the HTTP code returned for type PutDataWaveserverInterfacesRoutesNoContent +const PutDataWaveserverInterfacesRoutesNoContentCode int = 204 + +/*PutDataWaveserverInterfacesRoutesNoContent Object modified + +swagger:response putDataWaveserverInterfacesRoutesNoContent +*/ +type PutDataWaveserverInterfacesRoutesNoContent struct { +} + +// NewPutDataWaveserverInterfacesRoutesNoContent creates PutDataWaveserverInterfacesRoutesNoContent with default headers values +func NewPutDataWaveserverInterfacesRoutesNoContent() *PutDataWaveserverInterfacesRoutesNoContent { + + return &PutDataWaveserverInterfacesRoutesNoContent{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesRoutesNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// PutDataWaveserverInterfacesRoutesBadRequestCode is the HTTP code returned for type PutDataWaveserverInterfacesRoutesBadRequest +const PutDataWaveserverInterfacesRoutesBadRequestCode int = 400 + +/*PutDataWaveserverInterfacesRoutesBadRequest Internal error + +swagger:response putDataWaveserverInterfacesRoutesBadRequest +*/ +type PutDataWaveserverInterfacesRoutesBadRequest struct { +} + +// NewPutDataWaveserverInterfacesRoutesBadRequest creates PutDataWaveserverInterfacesRoutesBadRequest with default headers values +func NewPutDataWaveserverInterfacesRoutesBadRequest() *PutDataWaveserverInterfacesRoutesBadRequest { + + return &PutDataWaveserverInterfacesRoutesBadRequest{} +} + +// WriteResponse to the client +func (o *PutDataWaveserverInterfacesRoutesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..4674bee4407a753e0596cda32a37e8258989cbba --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_routes_urlbuilder.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// PutDataWaveserverInterfacesRoutesURL generates an URL for the put data waveserver interfaces routes operation +type PutDataWaveserverInterfacesRoutesURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesRoutesURL) WithBasePath(bp string) *PutDataWaveserverInterfacesRoutesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesRoutesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PutDataWaveserverInterfacesRoutesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/routes/" + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PutDataWaveserverInterfacesRoutesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PutDataWaveserverInterfacesRoutesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PutDataWaveserverInterfacesRoutesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PutDataWaveserverInterfacesRoutesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PutDataWaveserverInterfacesRoutesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PutDataWaveserverInterfacesRoutesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_urlbuilder.go b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_urlbuilder.go new file mode 100644 index 0000000000000000000000000000000000000000..ee871760ca1b11bc6111c71484cd8175526905fd --- /dev/null +++ b/waveserver/restapi/operations/ciena_waveserver_interfaces/put_data_waveserver_interfaces_urlbuilder.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ciena_waveserver_interfaces + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// PutDataWaveserverInterfacesURL generates an URL for the put data waveserver interfaces operation +type PutDataWaveserverInterfacesURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesURL) WithBasePath(bp string) *PutDataWaveserverInterfacesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PutDataWaveserverInterfacesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PutDataWaveserverInterfacesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/data/waveserver-interfaces/" + + _basePath := o._basePath + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PutDataWaveserverInterfacesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PutDataWaveserverInterfacesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PutDataWaveserverInterfacesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PutDataWaveserverInterfacesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PutDataWaveserverInterfacesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PutDataWaveserverInterfacesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/waveserver/restapi/operations/cocsn_api.go b/waveserver/restapi/operations/cocsn_api.go new file mode 100644 index 0000000000000000000000000000000000000000..5956c5aac7af9132f801593024318b538277d4ff --- /dev/null +++ b/waveserver/restapi/operations/cocsn_api.go @@ -0,0 +1,1009 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "net/http" + "strings" + + "github.com/go-openapi/errors" + "github.com/go-openapi/loads" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/runtime/security" + "github.com/go-openapi/spec" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/restapi/operations/ciena_waveserver_interfaces" +) + +// NewCocsnAPI creates a new Cocsn instance +func NewCocsnAPI(spec *loads.Document) *CocsnAPI { + return &CocsnAPI{ + handlers: make(map[string]map[string]http.Handler), + formats: strfmt.Default, + defaultConsumes: "application/json", + defaultProduces: "application/json", + customConsumers: make(map[string]runtime.Consumer), + customProducers: make(map[string]runtime.Producer), + PreServerShutdown: func() {}, + ServerShutdown: func() {}, + spec: spec, + useSwaggerUI: false, + ServeError: errors.ServeError, + BasicAuthenticator: security.BasicAuth, + APIKeyAuthenticator: security.APIKeyAuth, + BearerAuthenticator: security.BearerAuth, + + JSONConsumer: runtime.JSONConsumer(), + + JSONProducer: runtime.JSONProducer(), + + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesHandler: ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfaces has not yet been implemented") + }), + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexHandler: ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndex has not yet been implemented") + }), + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexIDHandler: ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexID has not yet been implemented") + }), + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler: ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexProperties has not yet been implemented") + }), + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler: ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 has not yet been implemented") + }), + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexStateHandler: ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexState has not yet been implemented") + }), + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameHandler: ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceName has not yet been implemented") + }), + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameIDHandler: ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameID has not yet been implemented") + }), + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler: ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameProperties has not yet been implemented") + }), + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler: ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet has not yet been implemented") + }), + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler: ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement has not yet been implemented") + }), + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameStateHandler: ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameState has not yet been implemented") + }), + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesHandler: ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutes has not yet been implemented") + }), + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler: ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestination has not yet been implemented") + }), + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler: ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandlerFunc(func(params ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex has not yet been implemented") + }), + CienaWaveserverInterfacesGetDataWaveserverInterfacesHandler: ciena_waveserver_interfaces.GetDataWaveserverInterfacesHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfaces has not yet been implemented") + }), + CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexHandler: ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndex has not yet been implemented") + }), + CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexIDHandler: ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexID has not yet been implemented") + }), + CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler: ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexProperties has not yet been implemented") + }), + CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler: ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 has not yet been implemented") + }), + CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexStateHandler: ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexState has not yet been implemented") + }), + CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameHandler: ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceName has not yet been implemented") + }), + CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameIDHandler: ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameID has not yet been implemented") + }), + CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler: ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameProperties has not yet been implemented") + }), + CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler: ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet has not yet been implemented") + }), + CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler: ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement has not yet been implemented") + }), + CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameStateHandler: ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameState has not yet been implemented") + }), + CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesHandler: ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutes has not yet been implemented") + }), + CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler: ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestination has not yet been implemented") + }), + CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler: ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandlerFunc(func(params ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex has not yet been implemented") + }), + CienaWaveserverInterfacesPostDataWaveserverInterfacesHandler: ciena_waveserver_interfaces.PostDataWaveserverInterfacesHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfaces has not yet been implemented") + }), + CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceHandler: ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterface has not yet been implemented") + }), + CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexIDHandler: ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexID has not yet been implemented") + }), + CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler: ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexProperties has not yet been implemented") + }), + CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler: ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 has not yet been implemented") + }), + CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexStateHandler: ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexState has not yet been implemented") + }), + CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceHandler: ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterface has not yet been implemented") + }), + CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNameIDHandler: ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNameID has not yet been implemented") + }), + CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler: ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNameProperties has not yet been implemented") + }), + CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler: ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet has not yet been implemented") + }), + CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler: ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement has not yet been implemented") + }), + CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNameStateHandler: ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNameState has not yet been implemented") + }), + CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesHandler: ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutes has not yet been implemented") + }), + CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesIPV4StaticRouteHandler: ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesIPV4StaticRouteHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesIPV4StaticRouteParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesIPV4StaticRoute has not yet been implemented") + }), + CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopHandler: ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopHandlerFunc(func(params ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHop has not yet been implemented") + }), + CienaWaveserverInterfacesPutDataWaveserverInterfacesHandler: ciena_waveserver_interfaces.PutDataWaveserverInterfacesHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfaces has not yet been implemented") + }), + CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexHandler: ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndex has not yet been implemented") + }), + CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexIDHandler: ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexIDHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexIDParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexID has not yet been implemented") + }), + CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler: ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexProperties has not yet been implemented") + }), + CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler: ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4HandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Params) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4 has not yet been implemented") + }), + CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexStateHandler: ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexStateHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexStateParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexState has not yet been implemented") + }), + CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameHandler: ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceName has not yet been implemented") + }), + CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameIDHandler: ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameIDHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameIDParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameID has not yet been implemented") + }), + CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler: ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameProperties has not yet been implemented") + }), + CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler: ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet has not yet been implemented") + }), + CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler: ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement has not yet been implemented") + }), + CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameStateHandler: ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameStateHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameStateParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameState has not yet been implemented") + }), + CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesHandler: ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutes has not yet been implemented") + }), + CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler: ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestination has not yet been implemented") + }), + CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler: ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandlerFunc(func(params ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexParams) middleware.Responder { + return middleware.NotImplemented("operation ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex has not yet been implemented") + }), + } +} + +/*CocsnAPI This module defines Ethernet and IP management interfaces support for + Ciena's Waveserver Platform. */ +type CocsnAPI struct { + spec *loads.Document + context *middleware.Context + handlers map[string]map[string]http.Handler + formats strfmt.Registry + customConsumers map[string]runtime.Consumer + customProducers map[string]runtime.Producer + defaultConsumes string + defaultProduces string + Middleware func(middleware.Builder) http.Handler + useSwaggerUI bool + + // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator + // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator + // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator + + // JSONConsumer registers a consumer for the following mime types: + // - application/yang-data+json + JSONConsumer runtime.Consumer + + // JSONProducer registers a producer for the following mime types: + // - application/yang-data+json + JSONProducer runtime.Producer + + // CienaWaveserverInterfacesDeleteDataWaveserverInterfacesHandler sets the operation handler for the delete data waveserver interfaces operation + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesHandler ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesHandler + // CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexHandler sets the operation handler for the delete data waveserver interfaces logical interface index operation + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexHandler ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexHandler + // CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexIDHandler sets the operation handler for the delete data waveserver interfaces logical interface index ID operation + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexIDHandler ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDHandler + // CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler sets the operation handler for the delete data waveserver interfaces logical interface index properties operation + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler + // CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler sets the operation handler for the delete data waveserver interfaces logical interface index properties IP v4 operation + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler + // CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexStateHandler sets the operation handler for the delete data waveserver interfaces logical interface index state operation + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexStateHandler ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateHandler + // CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameHandler sets the operation handler for the delete data waveserver interfaces physical interface name operation + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameHandler ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameHandler + // CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameIDHandler sets the operation handler for the delete data waveserver interfaces physical interface name ID operation + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameIDHandler ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDHandler + // CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler sets the operation handler for the delete data waveserver interfaces physical interface name properties operation + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler + // CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler sets the operation handler for the delete data waveserver interfaces physical interface name properties ethernet operation + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler + // CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler sets the operation handler for the delete data waveserver interfaces physical interface name properties management operation + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler + // CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameStateHandler sets the operation handler for the delete data waveserver interfaces physical interface name state operation + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameStateHandler ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateHandler + // CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesHandler sets the operation handler for the delete data waveserver interfaces routes operation + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesHandler ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesHandler + // CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler sets the operation handler for the delete data waveserver interfaces routes IP v4 static route destination operation + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler + // CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler sets the operation handler for the delete data waveserver interfaces routes IP v4 static route destination next hop index operation + CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler + // CienaWaveserverInterfacesGetDataWaveserverInterfacesHandler sets the operation handler for the get data waveserver interfaces operation + CienaWaveserverInterfacesGetDataWaveserverInterfacesHandler ciena_waveserver_interfaces.GetDataWaveserverInterfacesHandler + // CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexHandler sets the operation handler for the get data waveserver interfaces logical interface index operation + CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexHandler ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexHandler + // CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexIDHandler sets the operation handler for the get data waveserver interfaces logical interface index ID operation + CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexIDHandler ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexIDHandler + // CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler sets the operation handler for the get data waveserver interfaces logical interface index properties operation + CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler + // CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler sets the operation handler for the get data waveserver interfaces logical interface index properties IP v4 operation + CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler + // CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexStateHandler sets the operation handler for the get data waveserver interfaces logical interface index state operation + CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexStateHandler ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexStateHandler + // CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameHandler sets the operation handler for the get data waveserver interfaces physical interface name operation + CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameHandler ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameHandler + // CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameIDHandler sets the operation handler for the get data waveserver interfaces physical interface name ID operation + CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameIDHandler ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameIDHandler + // CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler sets the operation handler for the get data waveserver interfaces physical interface name properties operation + CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler + // CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler sets the operation handler for the get data waveserver interfaces physical interface name properties ethernet operation + CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler + // CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler sets the operation handler for the get data waveserver interfaces physical interface name properties management operation + CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler + // CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameStateHandler sets the operation handler for the get data waveserver interfaces physical interface name state operation + CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameStateHandler ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameStateHandler + // CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesHandler sets the operation handler for the get data waveserver interfaces routes operation + CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesHandler ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesHandler + // CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler sets the operation handler for the get data waveserver interfaces routes IP v4 static route destination operation + CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler + // CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler sets the operation handler for the get data waveserver interfaces routes IP v4 static route destination next hop index operation + CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler + // CienaWaveserverInterfacesPostDataWaveserverInterfacesHandler sets the operation handler for the post data waveserver interfaces operation + CienaWaveserverInterfacesPostDataWaveserverInterfacesHandler ciena_waveserver_interfaces.PostDataWaveserverInterfacesHandler + // CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceHandler sets the operation handler for the post data waveserver interfaces logical interface operation + CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceHandler ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceHandler + // CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexIDHandler sets the operation handler for the post data waveserver interfaces logical interface index ID operation + CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexIDHandler ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexIDHandler + // CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler sets the operation handler for the post data waveserver interfaces logical interface index properties operation + CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler + // CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler sets the operation handler for the post data waveserver interfaces logical interface index properties IP v4 operation + CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler + // CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexStateHandler sets the operation handler for the post data waveserver interfaces logical interface index state operation + CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexStateHandler ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexStateHandler + // CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceHandler sets the operation handler for the post data waveserver interfaces physical interface operation + CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceHandler ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceHandler + // CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNameIDHandler sets the operation handler for the post data waveserver interfaces physical interface name ID operation + CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNameIDHandler ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNameIDHandler + // CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler sets the operation handler for the post data waveserver interfaces physical interface name properties operation + CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler + // CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler sets the operation handler for the post data waveserver interfaces physical interface name properties ethernet operation + CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler + // CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler sets the operation handler for the post data waveserver interfaces physical interface name properties management operation + CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler + // CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNameStateHandler sets the operation handler for the post data waveserver interfaces physical interface name state operation + CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNameStateHandler ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNameStateHandler + // CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesHandler sets the operation handler for the post data waveserver interfaces routes operation + CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesHandler ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesHandler + // CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesIPV4StaticRouteHandler sets the operation handler for the post data waveserver interfaces routes IP v4 static route operation + CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesIPV4StaticRouteHandler ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesIPV4StaticRouteHandler + // CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopHandler sets the operation handler for the post data waveserver interfaces routes IP v4 static route destination next hop operation + CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopHandler ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopHandler + // CienaWaveserverInterfacesPutDataWaveserverInterfacesHandler sets the operation handler for the put data waveserver interfaces operation + CienaWaveserverInterfacesPutDataWaveserverInterfacesHandler ciena_waveserver_interfaces.PutDataWaveserverInterfacesHandler + // CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexHandler sets the operation handler for the put data waveserver interfaces logical interface index operation + CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexHandler ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexHandler + // CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexIDHandler sets the operation handler for the put data waveserver interfaces logical interface index ID operation + CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexIDHandler ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexIDHandler + // CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler sets the operation handler for the put data waveserver interfaces logical interface index properties operation + CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler + // CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler sets the operation handler for the put data waveserver interfaces logical interface index properties IP v4 operation + CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler + // CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexStateHandler sets the operation handler for the put data waveserver interfaces logical interface index state operation + CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexStateHandler ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexStateHandler + // CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameHandler sets the operation handler for the put data waveserver interfaces physical interface name operation + CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameHandler ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameHandler + // CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameIDHandler sets the operation handler for the put data waveserver interfaces physical interface name ID operation + CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameIDHandler ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameIDHandler + // CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler sets the operation handler for the put data waveserver interfaces physical interface name properties operation + CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler + // CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler sets the operation handler for the put data waveserver interfaces physical interface name properties ethernet operation + CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler + // CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler sets the operation handler for the put data waveserver interfaces physical interface name properties management operation + CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler + // CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameStateHandler sets the operation handler for the put data waveserver interfaces physical interface name state operation + CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameStateHandler ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameStateHandler + // CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesHandler sets the operation handler for the put data waveserver interfaces routes operation + CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesHandler ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesHandler + // CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler sets the operation handler for the put data waveserver interfaces routes IP v4 static route destination operation + CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler + // CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler sets the operation handler for the put data waveserver interfaces routes IP v4 static route destination next hop index operation + CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler + // ServeError is called when an error is received, there is a default handler + // but you can set your own with this + ServeError func(http.ResponseWriter, *http.Request, error) + + // PreServerShutdown is called before the HTTP(S) server is shutdown + // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic + PreServerShutdown func() + + // ServerShutdown is called when the HTTP(S) server is shut down and done + // handling all active connections and does not accept connections any more + ServerShutdown func() + + // Custom command line argument groups with their descriptions + CommandLineOptionsGroups []swag.CommandLineOptionsGroup + + // User defined logger function. + Logger func(string, ...interface{}) +} + +// UseRedoc for documentation at /docs +func (o *CocsnAPI) UseRedoc() { + o.useSwaggerUI = false +} + +// UseSwaggerUI for documentation at /docs +func (o *CocsnAPI) UseSwaggerUI() { + o.useSwaggerUI = true +} + +// SetDefaultProduces sets the default produces media type +func (o *CocsnAPI) SetDefaultProduces(mediaType string) { + o.defaultProduces = mediaType +} + +// SetDefaultConsumes returns the default consumes media type +func (o *CocsnAPI) SetDefaultConsumes(mediaType string) { + o.defaultConsumes = mediaType +} + +// SetSpec sets a spec that will be served for the clients. +func (o *CocsnAPI) SetSpec(spec *loads.Document) { + o.spec = spec +} + +// DefaultProduces returns the default produces media type +func (o *CocsnAPI) DefaultProduces() string { + return o.defaultProduces +} + +// DefaultConsumes returns the default consumes media type +func (o *CocsnAPI) DefaultConsumes() string { + return o.defaultConsumes +} + +// Formats returns the registered string formats +func (o *CocsnAPI) Formats() strfmt.Registry { + return o.formats +} + +// RegisterFormat registers a custom format validator +func (o *CocsnAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { + o.formats.Add(name, format, validator) +} + +// Validate validates the registrations in the CocsnAPI +func (o *CocsnAPI) Validate() error { + var unregistered []string + + if o.JSONConsumer == nil { + unregistered = append(unregistered, "JSONConsumer") + } + + if o.JSONProducer == nil { + unregistered = append(unregistered, "JSONProducer") + } + + if o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesHandler") + } + if o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexHandler") + } + if o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexIDHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexIDHandler") + } + if o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler") + } + if o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler") + } + if o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexStateHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesLogicalInterfaceIndexStateHandler") + } + if o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameHandler") + } + if o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameIDHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameIDHandler") + } + if o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler") + } + if o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler") + } + if o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler") + } + if o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameStateHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesPhysicalInterfaceNameStateHandler") + } + if o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesHandler") + } + if o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler") + } + if o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.DeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler") + } + if o.CienaWaveserverInterfacesGetDataWaveserverInterfacesHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.GetDataWaveserverInterfacesHandler") + } + if o.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexHandler") + } + if o.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexIDHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexIDHandler") + } + if o.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler") + } + if o.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler") + } + if o.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexStateHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.GetDataWaveserverInterfacesLogicalInterfaceIndexStateHandler") + } + if o.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameHandler") + } + if o.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameIDHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameIDHandler") + } + if o.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler") + } + if o.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler") + } + if o.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler") + } + if o.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameStateHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.GetDataWaveserverInterfacesPhysicalInterfaceNameStateHandler") + } + if o.CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesHandler") + } + if o.CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler") + } + if o.CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.GetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler") + } + if o.CienaWaveserverInterfacesPostDataWaveserverInterfacesHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PostDataWaveserverInterfacesHandler") + } + if o.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceHandler") + } + if o.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexIDHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexIDHandler") + } + if o.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler") + } + if o.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler") + } + if o.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexStateHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PostDataWaveserverInterfacesLogicalInterfaceIndexStateHandler") + } + if o.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceHandler") + } + if o.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNameIDHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNameIDHandler") + } + if o.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler") + } + if o.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler") + } + if o.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler") + } + if o.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNameStateHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PostDataWaveserverInterfacesPhysicalInterfaceNameStateHandler") + } + if o.CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesHandler") + } + if o.CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesIPV4StaticRouteHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesIPV4StaticRouteHandler") + } + if o.CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopHandler") + } + if o.CienaWaveserverInterfacesPutDataWaveserverInterfacesHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PutDataWaveserverInterfacesHandler") + } + if o.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexHandler") + } + if o.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexIDHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexIDHandler") + } + if o.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler") + } + if o.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler") + } + if o.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexStateHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PutDataWaveserverInterfacesLogicalInterfaceIndexStateHandler") + } + if o.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameHandler") + } + if o.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameIDHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameIDHandler") + } + if o.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler") + } + if o.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler") + } + if o.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler") + } + if o.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameStateHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PutDataWaveserverInterfacesPhysicalInterfaceNameStateHandler") + } + if o.CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesHandler") + } + if o.CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler") + } + if o.CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler == nil { + unregistered = append(unregistered, "ciena_waveserver_interfaces.PutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler") + } + + if len(unregistered) > 0 { + return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) + } + + return nil +} + +// ServeErrorFor gets a error handler for a given operation id +func (o *CocsnAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { + return o.ServeError +} + +// AuthenticatorsFor gets the authenticators for the specified security schemes +func (o *CocsnAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { + return nil +} + +// Authorizer returns the registered authorizer +func (o *CocsnAPI) Authorizer() runtime.Authorizer { + return nil +} + +// ConsumersFor gets the consumers for the specified media types. +// MIME type parameters are ignored here. +func (o *CocsnAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { + result := make(map[string]runtime.Consumer, len(mediaTypes)) + for _, mt := range mediaTypes { + switch mt { + case "application/yang-data+json": + result["application/yang-data+json"] = o.JSONConsumer + } + + if c, ok := o.customConsumers[mt]; ok { + result[mt] = c + } + } + return result +} + +// ProducersFor gets the producers for the specified media types. +// MIME type parameters are ignored here. +func (o *CocsnAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { + result := make(map[string]runtime.Producer, len(mediaTypes)) + for _, mt := range mediaTypes { + switch mt { + case "application/yang-data+json": + result["application/yang-data+json"] = o.JSONProducer + } + + if p, ok := o.customProducers[mt]; ok { + result[mt] = p + } + } + return result +} + +// HandlerFor gets a http.Handler for the provided operation method and path +func (o *CocsnAPI) HandlerFor(method, path string) (http.Handler, bool) { + if o.handlers == nil { + return nil, false + } + um := strings.ToUpper(method) + if _, ok := o.handlers[um]; !ok { + return nil, false + } + if path == "/" { + path = "" + } + h, ok := o.handlers[um][path] + return h, ok +} + +// Context returns the middleware context for the cocsn API +func (o *CocsnAPI) Context() *middleware.Context { + if o.context == nil { + o.context = middleware.NewRoutableContext(o.spec, o, nil) + } + + return o.context +} + +func (o *CocsnAPI) initHandlerCache() { + o.Context() // don't care about the result, just that the initialization happened + if o.handlers == nil { + o.handlers = make(map[string]map[string]http.Handler) + } + + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/data/waveserver-interfaces"] = ciena_waveserver_interfaces.NewDeleteDataWaveserverInterfaces(o.context, o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/data/waveserver-interfaces/logical-interface={index}"] = ciena_waveserver_interfaces.NewDeleteDataWaveserverInterfacesLogicalInterfaceIndex(o.context, o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/data/waveserver-interfaces/logical-interface={index}/id"] = ciena_waveserver_interfaces.NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexID(o.context, o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexIDHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/data/waveserver-interfaces/logical-interface={index}/properties"] = ciena_waveserver_interfaces.NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexProperties(o.context, o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/data/waveserver-interfaces/logical-interface={index}/properties/ipv4"] = ciena_waveserver_interfaces.NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4(o.context, o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/data/waveserver-interfaces/logical-interface={index}/state"] = ciena_waveserver_interfaces.NewDeleteDataWaveserverInterfacesLogicalInterfaceIndexState(o.context, o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesLogicalInterfaceIndexStateHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/data/waveserver-interfaces/physical-interface={name}"] = ciena_waveserver_interfaces.NewDeleteDataWaveserverInterfacesPhysicalInterfaceName(o.context, o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/data/waveserver-interfaces/physical-interface={name}/id"] = ciena_waveserver_interfaces.NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameID(o.context, o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameIDHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/data/waveserver-interfaces/physical-interface={name}/properties"] = ciena_waveserver_interfaces.NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameProperties(o.context, o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/data/waveserver-interfaces/physical-interface={name}/properties/ethernet"] = ciena_waveserver_interfaces.NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet(o.context, o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/data/waveserver-interfaces/physical-interface={name}/properties/management"] = ciena_waveserver_interfaces.NewDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement(o.context, o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/data/waveserver-interfaces/physical-interface={name}/state"] = ciena_waveserver_interfaces.NewDeleteDataWaveserverInterfacesPhysicalInterfaceNameState(o.context, o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesPhysicalInterfaceNameStateHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/data/waveserver-interfaces/routes"] = ciena_waveserver_interfaces.NewDeleteDataWaveserverInterfacesRoutes(o.context, o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/data/waveserver-interfaces/routes/ipv4-static-route={destination}"] = ciena_waveserver_interfaces.NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestination(o.context, o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/data/waveserver-interfaces/routes/ipv4-static-route={destination}/next-hop={index}"] = ciena_waveserver_interfaces.NewDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex(o.context, o.CienaWaveserverInterfacesDeleteDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/waveserver-interfaces"] = ciena_waveserver_interfaces.NewGetDataWaveserverInterfaces(o.context, o.CienaWaveserverInterfacesGetDataWaveserverInterfacesHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/waveserver-interfaces/logical-interface={index}"] = ciena_waveserver_interfaces.NewGetDataWaveserverInterfacesLogicalInterfaceIndex(o.context, o.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/waveserver-interfaces/logical-interface={index}/id"] = ciena_waveserver_interfaces.NewGetDataWaveserverInterfacesLogicalInterfaceIndexID(o.context, o.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexIDHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/waveserver-interfaces/logical-interface={index}/properties"] = ciena_waveserver_interfaces.NewGetDataWaveserverInterfacesLogicalInterfaceIndexProperties(o.context, o.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/waveserver-interfaces/logical-interface={index}/properties/ipv4"] = ciena_waveserver_interfaces.NewGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4(o.context, o.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/waveserver-interfaces/logical-interface={index}/state"] = ciena_waveserver_interfaces.NewGetDataWaveserverInterfacesLogicalInterfaceIndexState(o.context, o.CienaWaveserverInterfacesGetDataWaveserverInterfacesLogicalInterfaceIndexStateHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/waveserver-interfaces/physical-interface={name}"] = ciena_waveserver_interfaces.NewGetDataWaveserverInterfacesPhysicalInterfaceName(o.context, o.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/waveserver-interfaces/physical-interface={name}/id"] = ciena_waveserver_interfaces.NewGetDataWaveserverInterfacesPhysicalInterfaceNameID(o.context, o.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameIDHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/waveserver-interfaces/physical-interface={name}/properties"] = ciena_waveserver_interfaces.NewGetDataWaveserverInterfacesPhysicalInterfaceNameProperties(o.context, o.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/waveserver-interfaces/physical-interface={name}/properties/ethernet"] = ciena_waveserver_interfaces.NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet(o.context, o.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/waveserver-interfaces/physical-interface={name}/properties/management"] = ciena_waveserver_interfaces.NewGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement(o.context, o.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/waveserver-interfaces/physical-interface={name}/state"] = ciena_waveserver_interfaces.NewGetDataWaveserverInterfacesPhysicalInterfaceNameState(o.context, o.CienaWaveserverInterfacesGetDataWaveserverInterfacesPhysicalInterfaceNameStateHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/waveserver-interfaces/routes"] = ciena_waveserver_interfaces.NewGetDataWaveserverInterfacesRoutes(o.context, o.CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/waveserver-interfaces/routes/ipv4-static-route={destination}"] = ciena_waveserver_interfaces.NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestination(o.context, o.CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/data/waveserver-interfaces/routes/ipv4-static-route={destination}/next-hop={index}"] = ciena_waveserver_interfaces.NewGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex(o.context, o.CienaWaveserverInterfacesGetDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data/waveserver-interfaces"] = ciena_waveserver_interfaces.NewPostDataWaveserverInterfaces(o.context, o.CienaWaveserverInterfacesPostDataWaveserverInterfacesHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data/waveserver-interfaces/logical-interface"] = ciena_waveserver_interfaces.NewPostDataWaveserverInterfacesLogicalInterface(o.context, o.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data/waveserver-interfaces/logical-interface={index}/id"] = ciena_waveserver_interfaces.NewPostDataWaveserverInterfacesLogicalInterfaceIndexID(o.context, o.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexIDHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data/waveserver-interfaces/logical-interface={index}/properties"] = ciena_waveserver_interfaces.NewPostDataWaveserverInterfacesLogicalInterfaceIndexProperties(o.context, o.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data/waveserver-interfaces/logical-interface={index}/properties/ipv4"] = ciena_waveserver_interfaces.NewPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4(o.context, o.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data/waveserver-interfaces/logical-interface={index}/state"] = ciena_waveserver_interfaces.NewPostDataWaveserverInterfacesLogicalInterfaceIndexState(o.context, o.CienaWaveserverInterfacesPostDataWaveserverInterfacesLogicalInterfaceIndexStateHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data/waveserver-interfaces/physical-interface"] = ciena_waveserver_interfaces.NewPostDataWaveserverInterfacesPhysicalInterface(o.context, o.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data/waveserver-interfaces/physical-interface={name}/id"] = ciena_waveserver_interfaces.NewPostDataWaveserverInterfacesPhysicalInterfaceNameID(o.context, o.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNameIDHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data/waveserver-interfaces/physical-interface={name}/properties"] = ciena_waveserver_interfaces.NewPostDataWaveserverInterfacesPhysicalInterfaceNameProperties(o.context, o.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data/waveserver-interfaces/physical-interface={name}/properties/ethernet"] = ciena_waveserver_interfaces.NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet(o.context, o.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data/waveserver-interfaces/physical-interface={name}/properties/management"] = ciena_waveserver_interfaces.NewPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement(o.context, o.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data/waveserver-interfaces/physical-interface={name}/state"] = ciena_waveserver_interfaces.NewPostDataWaveserverInterfacesPhysicalInterfaceNameState(o.context, o.CienaWaveserverInterfacesPostDataWaveserverInterfacesPhysicalInterfaceNameStateHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data/waveserver-interfaces/routes"] = ciena_waveserver_interfaces.NewPostDataWaveserverInterfacesRoutes(o.context, o.CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data/waveserver-interfaces/routes/ipv4-static-route"] = ciena_waveserver_interfaces.NewPostDataWaveserverInterfacesRoutesIPV4StaticRoute(o.context, o.CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesIPV4StaticRouteHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/data/waveserver-interfaces/routes/ipv4-static-route={destination}/next-hop"] = ciena_waveserver_interfaces.NewPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHop(o.context, o.CienaWaveserverInterfacesPostDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data/waveserver-interfaces"] = ciena_waveserver_interfaces.NewPutDataWaveserverInterfaces(o.context, o.CienaWaveserverInterfacesPutDataWaveserverInterfacesHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data/waveserver-interfaces/logical-interface={index}"] = ciena_waveserver_interfaces.NewPutDataWaveserverInterfacesLogicalInterfaceIndex(o.context, o.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data/waveserver-interfaces/logical-interface={index}/id"] = ciena_waveserver_interfaces.NewPutDataWaveserverInterfacesLogicalInterfaceIndexID(o.context, o.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexIDHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data/waveserver-interfaces/logical-interface={index}/properties"] = ciena_waveserver_interfaces.NewPutDataWaveserverInterfacesLogicalInterfaceIndexProperties(o.context, o.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data/waveserver-interfaces/logical-interface={index}/properties/ipv4"] = ciena_waveserver_interfaces.NewPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4(o.context, o.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexPropertiesIPV4Handler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data/waveserver-interfaces/logical-interface={index}/state"] = ciena_waveserver_interfaces.NewPutDataWaveserverInterfacesLogicalInterfaceIndexState(o.context, o.CienaWaveserverInterfacesPutDataWaveserverInterfacesLogicalInterfaceIndexStateHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data/waveserver-interfaces/physical-interface={name}"] = ciena_waveserver_interfaces.NewPutDataWaveserverInterfacesPhysicalInterfaceName(o.context, o.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data/waveserver-interfaces/physical-interface={name}/id"] = ciena_waveserver_interfaces.NewPutDataWaveserverInterfacesPhysicalInterfaceNameID(o.context, o.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameIDHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data/waveserver-interfaces/physical-interface={name}/properties"] = ciena_waveserver_interfaces.NewPutDataWaveserverInterfacesPhysicalInterfaceNameProperties(o.context, o.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data/waveserver-interfaces/physical-interface={name}/properties/ethernet"] = ciena_waveserver_interfaces.NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernet(o.context, o.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesEthernetHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data/waveserver-interfaces/physical-interface={name}/properties/management"] = ciena_waveserver_interfaces.NewPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagement(o.context, o.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNamePropertiesManagementHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data/waveserver-interfaces/physical-interface={name}/state"] = ciena_waveserver_interfaces.NewPutDataWaveserverInterfacesPhysicalInterfaceNameState(o.context, o.CienaWaveserverInterfacesPutDataWaveserverInterfacesPhysicalInterfaceNameStateHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data/waveserver-interfaces/routes"] = ciena_waveserver_interfaces.NewPutDataWaveserverInterfacesRoutes(o.context, o.CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data/waveserver-interfaces/routes/ipv4-static-route={destination}"] = ciena_waveserver_interfaces.NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestination(o.context, o.CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/data/waveserver-interfaces/routes/ipv4-static-route={destination}/next-hop={index}"] = ciena_waveserver_interfaces.NewPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndex(o.context, o.CienaWaveserverInterfacesPutDataWaveserverInterfacesRoutesIPV4StaticRouteDestinationNextHopIndexHandler) +} + +// Serve creates a http handler to serve the API over HTTP +// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) +func (o *CocsnAPI) Serve(builder middleware.Builder) http.Handler { + o.Init() + + if o.Middleware != nil { + return o.Middleware(builder) + } + if o.useSwaggerUI { + return o.context.APIHandlerSwaggerUI(builder) + } + return o.context.APIHandler(builder) +} + +// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit +func (o *CocsnAPI) Init() { + if len(o.handlers) == 0 { + o.initHandlerCache() + } +} + +// RegisterConsumer allows you to add (or override) a consumer for a media type. +func (o *CocsnAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { + o.customConsumers[mediaType] = consumer +} + +// RegisterProducer allows you to add (or override) a producer for a media type. +func (o *CocsnAPI) RegisterProducer(mediaType string, producer runtime.Producer) { + o.customProducers[mediaType] = producer +} + +// AddMiddlewareFor adds a http middleware to existing handler +func (o *CocsnAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { + um := strings.ToUpper(method) + if path == "/" { + path = "" + } + o.Init() + if h, ok := o.handlers[um][path]; ok { + o.handlers[method][path] = builder(h) + } +} diff --git a/waveserver/restapi/server.go b/waveserver/restapi/server.go new file mode 100644 index 0000000000000000000000000000000000000000..c64b8142360eb97780754857373a0b608dc3fab7 --- /dev/null +++ b/waveserver/restapi/server.go @@ -0,0 +1,511 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package restapi + +import ( + "context" + "crypto/tls" + "crypto/x509" + "errors" + "fmt" + "io/ioutil" + "log" + "net" + "net/http" + "os" + "os/signal" + "strconv" + "sync" + "sync/atomic" + "syscall" + "time" + + "github.com/go-openapi/runtime/flagext" + "github.com/go-openapi/swag" + flags "github.com/jessevdk/go-flags" + "golang.org/x/net/netutil" + + "code.fbi.h-da.de/cocsn/cocsn-api/waveserver/restapi/operations" +) + +const ( + schemeHTTP = "http" + schemeHTTPS = "https" + schemeUnix = "unix" +) + +var defaultSchemes []string + +func init() { + defaultSchemes = []string{ + schemeHTTP, + } +} + +// NewServer creates a new api cocsn server but does not configure it +func NewServer(api *operations.CocsnAPI) *Server { + s := new(Server) + + s.shutdown = make(chan struct{}) + s.api = api + s.interrupt = make(chan os.Signal, 1) + return s +} + +// ConfigureAPI configures the API and handlers. +func (s *Server) ConfigureAPI() { + if s.api != nil { + s.handler = configureAPI(s.api) + } +} + +// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse +func (s *Server) ConfigureFlags() { + if s.api != nil { + configureFlags(s.api) + } +} + +// Server for the cocsn API +type Server struct { + EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` + CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` + GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` + MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` + + SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/cocsn.sock"` + domainSocketL net.Listener + + Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` + Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` + ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` + KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` + ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` + WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` + httpServerL net.Listener + + TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` + TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` + TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` + TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` + TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` + TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` + TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` + TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` + TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` + httpsServerL net.Listener + + api *operations.CocsnAPI + handler http.Handler + hasListeners bool + shutdown chan struct{} + shuttingDown int32 + interrupted bool + interrupt chan os.Signal +} + +// Logf logs message either via defined user logger or via system one if no user logger is defined. +func (s *Server) Logf(f string, args ...interface{}) { + if s.api != nil && s.api.Logger != nil { + s.api.Logger(f, args...) + } else { + log.Printf(f, args...) + } +} + +// Fatalf logs message either via defined user logger or via system one if no user logger is defined. +// Exits with non-zero status after printing +func (s *Server) Fatalf(f string, args ...interface{}) { + if s.api != nil && s.api.Logger != nil { + s.api.Logger(f, args...) + os.Exit(1) + } else { + log.Fatalf(f, args...) + } +} + +// SetAPI configures the server with the specified API. Needs to be called before Serve +func (s *Server) SetAPI(api *operations.CocsnAPI) { + if api == nil { + s.api = nil + s.handler = nil + return + } + + s.api = api + s.handler = configureAPI(api) +} + +func (s *Server) hasScheme(scheme string) bool { + schemes := s.EnabledListeners + if len(schemes) == 0 { + schemes = defaultSchemes + } + + for _, v := range schemes { + if v == scheme { + return true + } + } + return false +} + +// Serve the api +func (s *Server) Serve() (err error) { + if !s.hasListeners { + if err = s.Listen(); err != nil { + return err + } + } + + // set default handler, if none is set + if s.handler == nil { + if s.api == nil { + return errors.New("can't create the default handler, as no api is set") + } + + s.SetHandler(s.api.Serve(nil)) + } + + wg := new(sync.WaitGroup) + once := new(sync.Once) + signalNotify(s.interrupt) + go handleInterrupt(once, s) + + servers := []*http.Server{} + + if s.hasScheme(schemeUnix) { + domainSocket := new(http.Server) + domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) + domainSocket.Handler = s.handler + if int64(s.CleanupTimeout) > 0 { + domainSocket.IdleTimeout = s.CleanupTimeout + } + + configureServer(domainSocket, "unix", string(s.SocketPath)) + + servers = append(servers, domainSocket) + wg.Add(1) + s.Logf("Serving cocsn at unix://%s", s.SocketPath) + go func(l net.Listener) { + defer wg.Done() + if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving cocsn at unix://%s", s.SocketPath) + }(s.domainSocketL) + } + + if s.hasScheme(schemeHTTP) { + httpServer := new(http.Server) + httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) + httpServer.ReadTimeout = s.ReadTimeout + httpServer.WriteTimeout = s.WriteTimeout + httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) + if s.ListenLimit > 0 { + s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) + } + + if int64(s.CleanupTimeout) > 0 { + httpServer.IdleTimeout = s.CleanupTimeout + } + + httpServer.Handler = s.handler + + configureServer(httpServer, "http", s.httpServerL.Addr().String()) + + servers = append(servers, httpServer) + wg.Add(1) + s.Logf("Serving cocsn at http://%s", s.httpServerL.Addr()) + go func(l net.Listener) { + defer wg.Done() + if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving cocsn at http://%s", l.Addr()) + }(s.httpServerL) + } + + if s.hasScheme(schemeHTTPS) { + httpsServer := new(http.Server) + httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) + httpsServer.ReadTimeout = s.TLSReadTimeout + httpsServer.WriteTimeout = s.TLSWriteTimeout + httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) + if s.TLSListenLimit > 0 { + s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) + } + if int64(s.CleanupTimeout) > 0 { + httpsServer.IdleTimeout = s.CleanupTimeout + } + httpsServer.Handler = s.handler + + // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go + httpsServer.TLSConfig = &tls.Config{ + // Causes servers to use Go's default ciphersuite preferences, + // which are tuned to avoid attacks. Does nothing on clients. + PreferServerCipherSuites: true, + // Only use curves which have assembly implementations + // https://github.com/golang/go/tree/master/src/crypto/elliptic + CurvePreferences: []tls.CurveID{tls.CurveP256}, + // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility + NextProtos: []string{"h2", "http/1.1"}, + // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols + MinVersion: tls.VersionTLS12, + // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy + CipherSuites: []uint16{ + tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, + tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, + }, + } + + // build standard config from server options + if s.TLSCertificate != "" && s.TLSCertificateKey != "" { + httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) + httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) + if err != nil { + return err + } + } + + if s.TLSCACertificate != "" { + // include specified CA certificate + caCert, caCertErr := ioutil.ReadFile(string(s.TLSCACertificate)) + if caCertErr != nil { + return caCertErr + } + caCertPool := x509.NewCertPool() + ok := caCertPool.AppendCertsFromPEM(caCert) + if !ok { + return fmt.Errorf("cannot parse CA certificate") + } + httpsServer.TLSConfig.ClientCAs = caCertPool + httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert + } + + // call custom TLS configurator + configureTLS(httpsServer.TLSConfig) + + if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { + // after standard and custom config are passed, this ends up with no certificate + if s.TLSCertificate == "" { + if s.TLSCertificateKey == "" { + s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") + } + s.Fatalf("the required flag `--tls-certificate` was not specified") + } + if s.TLSCertificateKey == "" { + s.Fatalf("the required flag `--tls-key` was not specified") + } + // this happens with a wrong custom TLS configurator + s.Fatalf("no certificate was configured for TLS") + } + + // must have at least one certificate or panics + httpsServer.TLSConfig.BuildNameToCertificate() + + configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) + + servers = append(servers, httpsServer) + wg.Add(1) + s.Logf("Serving cocsn at https://%s", s.httpsServerL.Addr()) + go func(l net.Listener) { + defer wg.Done() + if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving cocsn at https://%s", l.Addr()) + }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) + } + + wg.Add(1) + go s.handleShutdown(wg, &servers) + + wg.Wait() + return nil +} + +// Listen creates the listeners for the server +func (s *Server) Listen() error { + if s.hasListeners { // already done this + return nil + } + + if s.hasScheme(schemeHTTPS) { + // Use http host if https host wasn't defined + if s.TLSHost == "" { + s.TLSHost = s.Host + } + // Use http listen limit if https listen limit wasn't defined + if s.TLSListenLimit == 0 { + s.TLSListenLimit = s.ListenLimit + } + // Use http tcp keep alive if https tcp keep alive wasn't defined + if int64(s.TLSKeepAlive) == 0 { + s.TLSKeepAlive = s.KeepAlive + } + // Use http read timeout if https read timeout wasn't defined + if int64(s.TLSReadTimeout) == 0 { + s.TLSReadTimeout = s.ReadTimeout + } + // Use http write timeout if https write timeout wasn't defined + if int64(s.TLSWriteTimeout) == 0 { + s.TLSWriteTimeout = s.WriteTimeout + } + } + + if s.hasScheme(schemeUnix) { + domSockListener, err := net.Listen("unix", string(s.SocketPath)) + if err != nil { + return err + } + s.domainSocketL = domSockListener + } + + if s.hasScheme(schemeHTTP) { + listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) + if err != nil { + return err + } + + h, p, err := swag.SplitHostPort(listener.Addr().String()) + if err != nil { + return err + } + s.Host = h + s.Port = p + s.httpServerL = listener + } + + if s.hasScheme(schemeHTTPS) { + tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) + if err != nil { + return err + } + + sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) + if err != nil { + return err + } + s.TLSHost = sh + s.TLSPort = sp + s.httpsServerL = tlsListener + } + + s.hasListeners = true + return nil +} + +// Shutdown server and clean up resources +func (s *Server) Shutdown() error { + if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { + close(s.shutdown) + } + return nil +} + +func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { + // wg.Done must occur last, after s.api.ServerShutdown() + // (to preserve old behaviour) + defer wg.Done() + + <-s.shutdown + + servers := *serversPtr + + ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) + defer cancel() + + // first execute the pre-shutdown hook + s.api.PreServerShutdown() + + shutdownChan := make(chan bool) + for i := range servers { + server := servers[i] + go func() { + var success bool + defer func() { + shutdownChan <- success + }() + if err := server.Shutdown(ctx); err != nil { + // Error from closing listeners, or context timeout: + s.Logf("HTTP server Shutdown: %v", err) + } else { + success = true + } + }() + } + + // Wait until all listeners have successfully shut down before calling ServerShutdown + success := true + for range servers { + success = success && <-shutdownChan + } + if success { + s.api.ServerShutdown() + } +} + +// GetHandler returns a handler useful for testing +func (s *Server) GetHandler() http.Handler { + return s.handler +} + +// SetHandler allows for setting a http handler on this server +func (s *Server) SetHandler(handler http.Handler) { + s.handler = handler +} + +// UnixListener returns the domain socket listener +func (s *Server) UnixListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.domainSocketL, nil +} + +// HTTPListener returns the http listener +func (s *Server) HTTPListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.httpServerL, nil +} + +// TLSListener returns the https listener +func (s *Server) TLSListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.httpsServerL, nil +} + +func handleInterrupt(once *sync.Once, s *Server) { + once.Do(func() { + for range s.interrupt { + if s.interrupted { + s.Logf("Server already shutting down") + continue + } + s.interrupted = true + s.Logf("Shutting down... ") + if err := s.Shutdown(); err != nil { + s.Logf("HTTP server Shutdown: %v", err) + } + } + }) +} + +func signalNotify(interrupt chan<- os.Signal) { + signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) +} diff --git a/waveserver/ws-if.yml b/waveserver/ws-if.yml new file mode 100644 index 0000000000000000000000000000000000000000..a2ca593104ad80ea718212280289fba12e0c5703 --- /dev/null +++ b/waveserver/ws-if.yml @@ -0,0 +1,1629 @@ +--- +swagger: "2.0" +info: + description: "This module defines Ethernet and IP management interfaces support\ + \ for\n Ciena's Waveserver Platform." + version: "1.0" + title: "ciena-waveserver-interfaces API" +host: "localhost:1234" +consumes: +- "application/yang-data+json" +produces: +- "application/yang-data+json" +paths: + /data/waveserver-interfaces/: + get: + tags: + - "ciena-waveserver-interfaces" + summary: "returns ciena.waveserver.interfaces.WaveserverInterfaces" + description: "Top level container for configuration and operational data for\ + \ physical\n and logical network interfaces." + parameters: [] + responses: + 200: + description: "ciena.waveserver.interfaces.WaveserverInterfaces" + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.WaveserverInterfacesWrapper" + 400: + description: "Internal error" + post: + tags: + - "ciena-waveserver-interfaces" + summary: "creates ciena.waveserver.interfaces.WaveserverInterfaces" + description: "Top level container for configuration and operational data for\ + \ physical\n and logical network interfaces." + parameters: + - in: "body" + name: "ciena.waveserver.interfaces.WaveserverInterfaces.body-param" + description: "ciena.waveserver.interfaces.WaveserverInterfaces to be added\ + \ to list" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.WaveserverInterfacesWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "ciena-waveserver-interfaces" + summary: "creates or updates ciena.waveserver.interfaces.WaveserverInterfaces" + description: "Top level container for configuration and operational data for\ + \ physical\n and logical network interfaces." + parameters: + - in: "body" + name: "ciena.waveserver.interfaces.WaveserverInterfaces.body-param" + description: "ciena.waveserver.interfaces.WaveserverInterfaces to be added\ + \ or updated" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.WaveserverInterfacesWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "ciena-waveserver-interfaces" + summary: "removes ciena.waveserver.interfaces.WaveserverInterfaces" + description: "Top level container for configuration and operational data for\ + \ physical\n and logical network interfaces." + parameters: [] + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/waveserver-interfaces/logical-interface/: + post: + tags: + - "ciena-waveserver-interfaces" + summary: "creates ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface" + description: "List of logical IP management interfaces (e.g. 'local')." + parameters: + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface\ + \ to be added to list" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterfaceWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/waveserver-interfaces/logical-interface={index}/: + get: + tags: + - "ciena-waveserver-interfaces" + summary: "returns ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface" + description: "List of logical IP management interfaces (e.g. 'local')." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + responses: + 200: + description: "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface" + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterfaceWrapper" + 400: + description: "Internal error" + put: + tags: + - "ciena-waveserver-interfaces" + summary: "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface" + description: "List of logical IP management interfaces (e.g. 'local')." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface\ + \ to be added or updated" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterfaceWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "ciena-waveserver-interfaces" + summary: "removes ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface" + description: "List of logical IP management interfaces (e.g. 'local')." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/waveserver-interfaces/logical-interface={index}/id/: + get: + tags: + - "ciena-waveserver-interfaces" + summary: "returns ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id" + description: "Identification information of this logical management interface." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + responses: + 200: + description: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id" + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.IdWrapper" + 400: + description: "Internal error" + post: + tags: + - "ciena-waveserver-interfaces" + summary: "creates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id" + description: "Identification information of this logical management interface." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id\ + \ to be added to list" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.IdWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "ciena-waveserver-interfaces" + summary: "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id" + description: "Identification information of this logical management interface." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id\ + \ to be added or updated" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.IdWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "ciena-waveserver-interfaces" + summary: "removes ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id" + description: "Identification information of this logical management interface." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/waveserver-interfaces/logical-interface={index}/properties/: + get: + tags: + - "ciena-waveserver-interfaces" + summary: "returns ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties" + description: "All the configuration data of the logical management interface." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + responses: + 200: + description: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties" + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.PropertiesWrapper" + 400: + description: "Internal error" + post: + tags: + - "ciena-waveserver-interfaces" + summary: "creates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties" + description: "All the configuration data of the logical management interface." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties\ + \ to be added to list" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.PropertiesWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "ciena-waveserver-interfaces" + summary: "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties" + description: "All the configuration data of the logical management interface." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties\ + \ to be added or updated" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.PropertiesWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "ciena-waveserver-interfaces" + summary: "removes ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties" + description: "All the configuration data of the logical management interface." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/waveserver-interfaces/logical-interface={index}/properties/ipv4/: + get: + tags: + - "ciena-waveserver-interfaces" + summary: "returns ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4" + description: "IPv4 configuration and operational data." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + responses: + 200: + description: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4" + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4Wrapper" + 400: + description: "Internal error" + post: + tags: + - "ciena-waveserver-interfaces" + summary: "creates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4" + description: "IPv4 configuration and operational data." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4\ + \ to be added to list" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4Wrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "ciena-waveserver-interfaces" + summary: "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4" + description: "IPv4 configuration and operational data." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4\ + \ to be added or updated" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4Wrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "ciena-waveserver-interfaces" + summary: "removes ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4" + description: "IPv4 configuration and operational data." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/waveserver-interfaces/logical-interface={index}/state/: + get: + tags: + - "ciena-waveserver-interfaces" + summary: "returns ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State" + description: "Logical interface state information." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + responses: + 200: + description: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State" + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.StateWrapper" + 400: + description: "Internal error" + post: + tags: + - "ciena-waveserver-interfaces" + summary: "creates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State" + description: "Logical interface state information." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State\ + \ to be added to list" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.StateWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "ciena-waveserver-interfaces" + summary: "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State" + description: "Logical interface state information." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State\ + \ to be added or updated" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.StateWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "ciena-waveserver-interfaces" + summary: "removes ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State" + description: "Logical interface state information." + parameters: + - name: "index" + in: "path" + description: "Id of logical-interface" + required: true + type: "integer" + format: "int64" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/waveserver-interfaces/physical-interface/: + post: + tags: + - "ciena-waveserver-interfaces" + summary: "creates ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface" + description: "List of physical Ethernet management interfaces." + parameters: + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface\ + \ to be added to list" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterfaceWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/waveserver-interfaces/physical-interface={name}/: + get: + tags: + - "ciena-waveserver-interfaces" + summary: "returns ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface" + description: "List of physical Ethernet management interfaces." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + responses: + 200: + description: "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface" + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterfaceWrapper" + 400: + description: "Internal error" + put: + tags: + - "ciena-waveserver-interfaces" + summary: "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface" + description: "List of physical Ethernet management interfaces." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface\ + \ to be added or updated" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterfaceWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "ciena-waveserver-interfaces" + summary: "removes ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface" + description: "List of physical Ethernet management interfaces." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/waveserver-interfaces/physical-interface={name}/id/: + get: + tags: + - "ciena-waveserver-interfaces" + summary: "returns ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id" + description: "Identification information of this management interface." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + responses: + 200: + description: "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id" + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.IdWrapper" + 400: + description: "Internal error" + post: + tags: + - "ciena-waveserver-interfaces" + summary: "creates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id" + description: "Identification information of this management interface." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id\ + \ to be added to list" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.IdWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "ciena-waveserver-interfaces" + summary: "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id" + description: "Identification information of this management interface." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id\ + \ to be added or updated" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.IdWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "ciena-waveserver-interfaces" + summary: "removes ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id" + description: "Identification information of this management interface." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/waveserver-interfaces/physical-interface={name}/properties/: + get: + tags: + - "ciena-waveserver-interfaces" + summary: "returns ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties" + description: "All the configuration data of the physical management interface." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + responses: + 200: + description: "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties" + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.PropertiesWrapper" + 400: + description: "Internal error" + post: + tags: + - "ciena-waveserver-interfaces" + summary: "creates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties" + description: "All the configuration data of the physical management interface." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties\ + \ to be added to list" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.PropertiesWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "ciena-waveserver-interfaces" + summary: "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties" + description: "All the configuration data of the physical management interface." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties\ + \ to be added or updated" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.PropertiesWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "ciena-waveserver-interfaces" + summary: "removes ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties" + description: "All the configuration data of the physical management interface." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/waveserver-interfaces/physical-interface={name}/properties/ethernet/: + get: + tags: + - "ciena-waveserver-interfaces" + summary: "returns ciena.waveserver.interfaces.EthernetIfPropertiesGroup" + description: "Ethernet interface attributes." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + responses: + 200: + description: "ciena.waveserver.interfaces.EthernetIfPropertiesGroup" + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.EthernetIfPropertiesGroupWrapper" + 400: + description: "Internal error" + post: + tags: + - "ciena-waveserver-interfaces" + summary: "creates ciena.waveserver.interfaces.EthernetIfPropertiesGroup" + description: "Ethernet interface attributes." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + - in: "body" + name: "ciena.waveserver.interfaces.EthernetIfPropertiesGroup.body-param" + description: "ciena.waveserver.interfaces.EthernetIfPropertiesGroup to be\ + \ added to list" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.EthernetIfPropertiesGroupWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "ciena-waveserver-interfaces" + summary: "creates or updates ciena.waveserver.interfaces.EthernetIfPropertiesGroup" + description: "Ethernet interface attributes." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + - in: "body" + name: "ciena.waveserver.interfaces.EthernetIfPropertiesGroup.body-param" + description: "ciena.waveserver.interfaces.EthernetIfPropertiesGroup to be\ + \ added or updated" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.EthernetIfPropertiesGroupWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "ciena-waveserver-interfaces" + summary: "removes ciena.waveserver.interfaces.EthernetIfPropertiesGroup" + description: "Ethernet interface attributes." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/waveserver-interfaces/physical-interface={name}/properties/management/: + get: + tags: + - "ciena-waveserver-interfaces" + summary: "returns ciena.waveserver.interfaces.ManagementIfPropertiesGroup" + description: "Management interface attributes." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + responses: + 200: + description: "ciena.waveserver.interfaces.ManagementIfPropertiesGroup" + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.ManagementIfPropertiesGroupWrapper" + 400: + description: "Internal error" + post: + tags: + - "ciena-waveserver-interfaces" + summary: "creates ciena.waveserver.interfaces.ManagementIfPropertiesGroup" + description: "Management interface attributes." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + - in: "body" + name: "ciena.waveserver.interfaces.ManagementIfPropertiesGroup.body-param" + description: "ciena.waveserver.interfaces.ManagementIfPropertiesGroup to be\ + \ added to list" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.ManagementIfPropertiesGroupWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "ciena-waveserver-interfaces" + summary: "creates or updates ciena.waveserver.interfaces.ManagementIfPropertiesGroup" + description: "Management interface attributes." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + - in: "body" + name: "ciena.waveserver.interfaces.ManagementIfPropertiesGroup.body-param" + description: "ciena.waveserver.interfaces.ManagementIfPropertiesGroup to be\ + \ added or updated" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.ManagementIfPropertiesGroupWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "ciena-waveserver-interfaces" + summary: "removes ciena.waveserver.interfaces.ManagementIfPropertiesGroup" + description: "Management interface attributes." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/waveserver-interfaces/physical-interface={name}/state/: + get: + tags: + - "ciena-waveserver-interfaces" + summary: "returns ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State" + description: "Physical management interface state information." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + responses: + 200: + description: "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State" + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.StateWrapper" + 400: + description: "Internal error" + post: + tags: + - "ciena-waveserver-interfaces" + summary: "creates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State" + description: "Physical management interface state information." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State\ + \ to be added to list" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.StateWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "ciena-waveserver-interfaces" + summary: "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State" + description: "Physical management interface state information." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State\ + \ to be added or updated" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.StateWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "ciena-waveserver-interfaces" + summary: "removes ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State" + description: "Physical management interface state information." + parameters: + - name: "name" + in: "path" + description: "Id of physical-interface" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/waveserver-interfaces/routes/: + get: + tags: + - "ciena-waveserver-interfaces" + summary: "returns ciena.waveserver.interfaces.waveserverinterfaces.Routes" + description: "Top-level container for IP route configuration and operational\ + \ data." + parameters: [] + responses: + 200: + description: "ciena.waveserver.interfaces.waveserverinterfaces.Routes" + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.RoutesWrapper" + 400: + description: "Internal error" + post: + tags: + - "ciena-waveserver-interfaces" + summary: "creates ciena.waveserver.interfaces.waveserverinterfaces.Routes" + description: "Top-level container for IP route configuration and operational\ + \ data." + parameters: + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.Routes.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.Routes to be\ + \ added to list" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.RoutesWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "ciena-waveserver-interfaces" + summary: "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.Routes" + description: "Top-level container for IP route configuration and operational\ + \ data." + parameters: + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.Routes.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.Routes to be\ + \ added or updated" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.RoutesWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "ciena-waveserver-interfaces" + summary: "removes ciena.waveserver.interfaces.waveserverinterfaces.Routes" + description: "Top-level container for IP route configuration and operational\ + \ data." + parameters: [] + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/waveserver-interfaces/routes/ipv4-static-route/: + post: + tags: + - "ciena-waveserver-interfaces" + summary: "creates ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute" + description: "List of IPv4 static routing entries." + parameters: + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute\ + \ to be added to list" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRouteWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/waveserver-interfaces/routes/ipv4-static-route={destination}/: + get: + tags: + - "ciena-waveserver-interfaces" + summary: "returns ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute" + description: "List of IPv4 static routing entries." + parameters: + - name: "destination" + in: "path" + description: "Id of ipv4-static-route" + required: true + type: "string" + responses: + 200: + description: "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute" + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRouteWrapper" + 400: + description: "Internal error" + put: + tags: + - "ciena-waveserver-interfaces" + summary: "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute" + description: "List of IPv4 static routing entries." + parameters: + - name: "destination" + in: "path" + description: "Id of ipv4-static-route" + required: true + type: "string" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute\ + \ to be added or updated" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRouteWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "ciena-waveserver-interfaces" + summary: "removes ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute" + description: "List of IPv4 static routing entries." + parameters: + - name: "destination" + in: "path" + description: "Id of ipv4-static-route" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/waveserver-interfaces/routes/ipv4-static-route={destination}/next-hop/: + post: + tags: + - "ciena-waveserver-interfaces" + summary: "creates ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop" + description: "A list of next-hop entries associated with the static route." + parameters: + - name: "destination" + in: "path" + description: "Id of ipv4-static-route" + required: true + type: "string" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop\ + \ to be added to list" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHopWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/waveserver-interfaces/routes/ipv4-static-route={destination}/next-hop={index}/: + get: + tags: + - "ciena-waveserver-interfaces" + summary: "returns ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop" + description: "A list of next-hop entries associated with the static route." + parameters: + - name: "destination" + in: "path" + description: "Id of ipv4-static-route" + required: true + type: "string" + - name: "index" + in: "path" + description: "Id of next-hop" + required: true + type: "integer" + format: "int64" + responses: + 200: + description: "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop" + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHopWrapper" + 400: + description: "Internal error" + put: + tags: + - "ciena-waveserver-interfaces" + summary: "creates or updates ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop" + description: "A list of next-hop entries associated with the static route." + parameters: + - name: "destination" + in: "path" + description: "Id of ipv4-static-route" + required: true + type: "string" + - name: "index" + in: "path" + description: "Id of next-hop" + required: true + type: "integer" + format: "int64" + - in: "body" + name: "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop.body-param" + description: "ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop\ + \ to be added or updated" + required: false + schema: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHopWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "ciena-waveserver-interfaces" + summary: "removes ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop" + description: "A list of next-hop entries associated with the static route." + parameters: + - name: "destination" + in: "path" + description: "Id of ipv4-static-route" + required: true + type: "string" + - name: "index" + in: "path" + description: "Id of next-hop" + required: true + type: "integer" + format: "int64" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" +definitions: + ciena.waveserver.interfaces.DuplexEnumeration: + type: "string" + enum: + - "Unknown" + - "full" + - "half" + ciena.waveserver.interfaces.EthernetIfPropertiesGroup: + type: "object" + properties: + mac-address: + type: "string" + description: "The system-assigned MAC address of the Ethernet interface." + flow-control: + type: "boolean" + description: "Specifies whether this interface will participate in Ethernet\ + \ flow\n control, via pause frames." + default: false + duplex: + description: "Ethernet interface duplex mode. For ports with auto-negotiation\ + \ enabled,\n this represents the negotiated duplex mode." + $ref: "#/definitions/ciena.waveserver.interfaces.DuplexEnumeration" + speed: + description: "Ethernet port speed. For ports with auto-negotiation enabled,\ + \ this\n represents the negotiated port speed." + $ref: "#/definitions/ciena.waveserver.interfaces.SpeedEnumeration" + auto-negotiation: + type: "boolean" + description: "Specifies whether the interface should negotiate common transmission\n\ + \ parameters, such as speed, duplex, and flow control with its peer.\ + \ REF:IEEE 802.3-2012 auto-negotiation transmission parameters" + default: false + ciena.waveserver.interfaces.EthernetIfPropertiesGroupWrapper: + properties: + ethernet: + $ref: "#/definitions/ciena.waveserver.interfaces.EthernetIfPropertiesGroup" + ciena.waveserver.interfaces.ManagementIfPropertiesGroup: + type: "object" + properties: + mode: + description: "Management port mode. Specifies whether the port is configured\ + \ as a\n local management interface or wayside communications channel\ + \ (carry\n through)." + $ref: "#/definitions/ciena.waveserver.interfaces.ModeEnumeration" + ciena.waveserver.interfaces.ManagementIfPropertiesGroupWrapper: + properties: + management: + $ref: "#/definitions/ciena.waveserver.interfaces.ManagementIfPropertiesGroup" + ciena.waveserver.interfaces.ModeEnumeration: + type: "string" + enum: + - "management" + - "wayside-channel" + ciena.waveserver.interfaces.RouteNextHopGroup: + type: "object" + properties: + active: + type: "boolean" + description: "Specifies whether the route is active (present in the kernel\ + \ IP\n routing table)." + default: false + static: + type: "boolean" + description: "Specifies whether the route entry is user-created (static) or\n\ + \ dynamically created by a routing protocol." + default: false + associated-interface: + type: "string" + description: "Reference to the associated logical-interface name of the route\ + \ entry.\n Defaults to the 'local' interface for routes within the\ + \ subnet\n associated with the active IP address configured on the\ + \ local\n management interface." + metric: + type: "integer" + format: "int64" + description: "Routing metric cost." + default: 0 + ciena.waveserver.interfaces.SpeedEnumeration: + type: "string" + enum: + - "Unknown" + - "10M" + - "100M" + - "1G" + - "10G" + ciena.waveserver.interfaces.TypeEnumeration: + type: "string" + enum: + - "ethernet" + - "serial" + ciena.waveserver.interfaces.WaveserverInterfaces: + type: "object" + properties: + logical-interface: + type: "array" + description: "List of logical IP management interfaces (e.g. 'local')." + items: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface" + routes: + description: "Top-level container for IP route configuration and operational\ + \ data." + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.Routes" + physical-interface: + type: "array" + description: "List of physical Ethernet management interfaces." + items: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface" + ciena.waveserver.interfaces.WaveserverInterfacesWrapper: + properties: + waveserver-interfaces: + $ref: "#/definitions/ciena.waveserver.interfaces.WaveserverInterfaces" + ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface: + type: "object" + properties: + index: + type: "integer" + format: "int64" + description: "References the system-assigned index of the logical interface." + x-path: "../id/index" + state: + description: "Logical interface state information." + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State" + id: + description: "Identification information of this logical management interface." + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id" + properties: + description: "All the configuration data of the logical management interface." + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties" + ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterfaceWrapper: + properties: + logical-interface: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.LogicalInterface" + ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface: + type: "object" + properties: + name: + type: "string" + description: "References the system-assigned name of the interface." + x-path: "../id/name" + state: + description: "Physical management interface state information." + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State" + id: + description: "Identification information of this management interface." + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id" + properties: + description: "All the configuration data of the physical management interface." + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties" + ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterfaceWrapper: + properties: + physical-interface: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.PhysicalInterface" + ciena.waveserver.interfaces.waveserverinterfaces.Routes: + type: "object" + properties: + ipv4-static-route: + type: "array" + description: "List of IPv4 static routing entries." + items: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute" + ciena.waveserver.interfaces.waveserverinterfaces.RoutesWrapper: + properties: + routes: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.Routes" + ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id: + type: "object" + properties: + name: + type: "string" + description: "The name of the logical management interface, e.g. 'local'." + index: + type: "integer" + format: "int64" + description: "The index of the logical management interface. Waveserver supports\n\ + \ a single logical interface 'local' that is automatically created\ + \ by\n the system. The default index is 1 for the 'local' interface." + ifindex: + type: "integer" + format: "int64" + description: "The system-assigned interface index number, corresponding to\ + \ the\n ifIndex in SNMP IF-MIB. REF:RFC 2863 - The Interfaces\ + \ Group MIB" + ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.IdWrapper: + properties: + id: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Id" + ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties: + type: "object" + properties: + ipv4: + description: "IPv4 configuration and operational data." + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4" + ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.PropertiesWrapper: + properties: + properties: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.Properties" + ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State: + type: "object" + properties: + operational-state: + description: "Operational state of this management interface." + $ref: "#/definitions/ciena.waveserver.typedefs.UpDownEnum" + admin-state: + description: "Whether Admin State is enabled or disabled for this management\ + \ interface." + $ref: "#/definitions/ciena.waveserver.typedefs.EnabledDisabledEnum" + ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.StateWrapper: + properties: + state: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.State" + ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4: + type: "object" + properties: + oper-gateway: + type: "string" + description: "The operational IPv4 gateway on the interface." + oper-ip-address: + type: "string" + description: "The operational IPv4 address and prefix on the interface." + user-ip-address: + type: "string" + description: "The user-configured IPv4 address and prefix on the interface." + dhcp-ip-address: + type: "string" + description: "The DHCP-assigned IPv4 address and prefix on the interface." + dhcp-gateway: + type: "string" + description: "The DHCP-assigned IPv4 gateway on the interface." + admin-state: + description: "Whether IPv4 stack is enabled or disabled on this interface.\n\ + \ Always enabled for the local management interface." + $ref: "#/definitions/ciena.waveserver.typedefs.EnabledDisabledEnum" + user-gateway: + type: "string" + description: "The user-configured primary IPv4 gateway on the interface." + apipa-ip-address: + type: "string" + description: "The Automatic Private IP Addressing (APIPA) assigned IPv4 address\n\ + \ and prefix on the interface." + backup-gateway: + type: "string" + description: "The user-configured backup IPv4 gateway on the interface." + ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4Wrapper: + properties: + ipv4: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.logicalinterface.properties.Ipv4" + ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id: + type: "object" + properties: + name: + type: "string" + description: "The system-assigned name of the physical interface (e.g. DCN,\n\ + \ ILAN-1, ILAN-2). The names are predefined." + description: + type: "string" + description: "Physical interface description, e.g. 'Management'." + ifindex: + type: "integer" + format: "int64" + description: "The system-assigned interface index number, corresponding to\ + \ the\n ifIndex in SNMP IF-MIB. REF:RFC 2863 - The Interfaces\ + \ Group MIB" + type: + description: "Management port type. If the port is DCN, ILAN-1, or ILAN-2,\ + \ the\n port type will be 'ethernet'. If the port is Console,\ + \ the port\n type will be 'serial'. REF:RFC 2863 - The Interfaces\ + \ Group MIB" + $ref: "#/definitions/ciena.waveserver.interfaces.TypeEnumeration" + ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.IdWrapper: + properties: + id: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Id" + ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties: + type: "object" + properties: + ethernet: + description: "Ethernet interface attributes." + $ref: "#/definitions/ciena.waveserver.interfaces.EthernetIfPropertiesGroup" + management: + description: "Management interface attributes." + $ref: "#/definitions/ciena.waveserver.interfaces.ManagementIfPropertiesGroup" + ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.PropertiesWrapper: + properties: + properties: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.Properties" + ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State: + type: "object" + properties: + operational-state: + description: "Operational state of this management interface." + $ref: "#/definitions/ciena.waveserver.typedefs.UpDownEnum" + admin-state: + description: "Whether Admin State is enabled or disabled for this management\ + \ interface." + $ref: "#/definitions/ciena.waveserver.typedefs.EnabledDisabledEnum" + ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.StateWrapper: + properties: + state: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.physicalinterface.State" + ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute: + type: "object" + properties: + destination: + type: "string" + description: "IPv4 route destination prefix for the static route. Only one\ + \ static\n routing entry per unique destination ip/prefix can\ + \ be configured." + next-hop: + type: "array" + description: "A list of next-hop entries associated with the static route." + items: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop" + ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRouteWrapper: + properties: + ipv4-static-route: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.Ipv4StaticRoute" + ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop: + allOf: + - $ref: "#/definitions/ciena.waveserver.interfaces.RouteNextHopGroup" + - type: "object" + properties: + index: + type: "integer" + format: "int64" + description: "The index key of the entry in the next-hop list. Currently\ + \ only\n one static entry is supported per destination prefix,\ + \ so the\n index should always be 1." + ip-address: + type: "string" + description: "IPv4 route next-hop or gateway address associated with the\ + \ route. If\n not specified, the default gateway value for\ + \ the local management\n interface will be used." + description: "A list of next-hop entries associated with the static route." + ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHopWrapper: + properties: + next-hop: + $ref: "#/definitions/ciena.waveserver.interfaces.waveserverinterfaces.routes.ipv4staticroute.NextHop" + ciena.waveserver.typedefs.EnabledDisabledEnum: + type: "string" + enum: + - "disabled" + - "enabled" + ciena.waveserver.typedefs.UpDownEnum: + type: "string" + enum: + - "down" + - "up" diff --git a/ws-if.json b/ws-if.json new file mode 100644 index 0000000000000000000000000000000000000000..def8d1dbef1135dc7fe959308705b7375afbcf22 --- /dev/null +++ b/ws-if.json @@ -0,0 +1,12775 @@ +{ + "swagger": "2.0", + "info": { + "title": "ciena-waveserver-interfaces", + "description": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "version": "2018-04-27" + }, + "basePath": "/restconf", + "tags": [ + { + "name": "root", + "description": "root resources" + }, + { + "name": "operations", + "description": "operations resources" + }, + { + "name": "data", + "description": "data resources" + }, + { + "name": "get", + "description": "get resources" + }, + { + "name": "post", + "description": "post resources" + }, + { + "name": "patch", + "description": "patch resources" + }, + { + "name": "put", + "description": "put resources" + }, + { + "name": "delete", + "description": "delete resources" + } + ], + "schemes": [ + "http", + "https" + ], + "produces": [ + "application/yang-data+json" + ], + "consumes": [ + "application/yang-data+json" + ], + "paths": { + "/": { + "get": { + "tags": [ + "root", + "get" + ], + "summary": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "description": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "operationId": "root_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + ], + "responses": { + "200": { + "description": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "schema": { + "$ref": "#/definitions/root" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/operations": { + "get": { + "tags": [ + "operations", + "get" + ], + "summary": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "description": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "operationId": "operations_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + ], + "responses": { + "200": { + "description": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "schema": { + "$ref": "#/definitions/operations" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/yang-library-version": { + "get": { + "tags": [ + "yang-library-version", + "get" + ], + "summary": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "description": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "operationId": "yang_library_version_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + ], + "responses": { + "200": { + "description": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "schema": { + "$ref": "#/definitions/yang-library-version" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "description": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "operationId": "data_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + ], + "responses": { + "200": { + "description": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "schema": { + "$ref": "#/definitions/data" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "tags": [ + "data", + "post" + ], + "summary": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "description": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "operationId": "data_post", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data-post" + } + ], + "responses": { + "201": { + "description": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform." + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "description": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "operationId": "data_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data-put-patch" + } + ], + "responses": { + "201": { + "description": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform." + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "description": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "operationId": "data_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data-put-patch" + } + ], + "responses": { + "204": { + "description": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform." + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Top level container for configuration and operational data for physical\nand logical network interfaces.", + "description": "Top level container for configuration and operational data for physical\nand logical network interfaces.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Top level container for configuration and operational data for physical\nand logical network interfaces.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "tags": [ + "data", + "post" + ], + "summary": "Top level container for configuration and operational data for physical\nand logical network interfaces.", + "description": "Top level container for configuration and operational data for physical\nand logical network interfaces.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_post", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces-post" + } + ], + "responses": { + "201": { + "description": "container waveserver-interfaces created" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "Top level container for configuration and operational data for physical\nand logical network interfaces.", + "description": "Top level container for configuration and operational data for physical\nand logical network interfaces.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces" + } + ], + "responses": { + "201": { + "description": "container waveserver-interfaces created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "Top level container for configuration and operational data for physical\nand logical network interfaces.", + "description": "Top level container for configuration and operational data for physical\nand logical network interfaces.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces" + } + ], + "responses": { + "204": { + "description": "container waveserver-interfaces updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "Top level container for configuration and operational data for physical\nand logical network interfaces.", + "description": "Top level container for configuration and operational data for physical\nand logical network interfaces.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface": { + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "List of physical Ethernet management interfaces.", + "description": "List of physical Ethernet management interfaces.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "List of physical Ethernet management interfaces.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "List of physical Ethernet management interfaces.", + "description": "List of physical Ethernet management interfaces.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name" + }, + { + "$ref": "#/parameters/insert" + }, + { + "$ref": "#/parameters/point" + } + ], + "responses": { + "201": { + "description": "list physical-interface created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "List of physical Ethernet management interfaces.", + "description": "List of physical Ethernet management interfaces.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name" + } + ], + "responses": { + "204": { + "description": "list physical-interface updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "List of physical Ethernet management interfaces.", + "description": "List of physical Ethernet management interfaces.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}/name": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "References the system-assigned name of the interface.", + "description": "References the system-assigned name of the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_name_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "References the system-assigned name of the interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_name" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "References the system-assigned name of the interface.", + "description": "References the system-assigned name of the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_name_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_name" + } + ], + "responses": { + "201": { + "description": "leaf name created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "References the system-assigned name of the interface.", + "description": "References the system-assigned name of the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_name_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_name" + } + ], + "responses": { + "204": { + "description": "leaf name updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "References the system-assigned name of the interface.", + "description": "References the system-assigned name of the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_name_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}/id": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Identification information of this management interface.", + "description": "Identification information of this management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_id_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Identification information of this management interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "tags": [ + "data", + "post" + ], + "summary": "Identification information of this management interface.", + "description": "Identification information of this management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_id_post", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id-post" + } + ], + "responses": { + "201": { + "description": "container id created" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "Identification information of this management interface.", + "description": "Identification information of this management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_id_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id" + } + ], + "responses": { + "201": { + "description": "container id created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "Identification information of this management interface.", + "description": "Identification information of this management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_id_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id" + } + ], + "responses": { + "204": { + "description": "container id updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "Identification information of this management interface.", + "description": "Identification information of this management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_id_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}/id/name": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "The system-assigned name of the physical interface (e.g. DCN,\nILAN-1, ILAN-2). The names are predefined.", + "description": "The system-assigned name of the physical interface (e.g. DCN,\nILAN-1, ILAN-2). The names are predefined.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_id_name_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "The system-assigned name of the physical interface (e.g. DCN,\nILAN-1, ILAN-2). The names are predefined.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id_name" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "The system-assigned name of the physical interface (e.g. DCN,\nILAN-1, ILAN-2). The names are predefined.", + "description": "The system-assigned name of the physical interface (e.g. DCN,\nILAN-1, ILAN-2). The names are predefined.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_id_name_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id_name" + } + ], + "responses": { + "201": { + "description": "leaf name created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "The system-assigned name of the physical interface (e.g. DCN,\nILAN-1, ILAN-2). The names are predefined.", + "description": "The system-assigned name of the physical interface (e.g. DCN,\nILAN-1, ILAN-2). The names are predefined.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_id_name_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id_name" + } + ], + "responses": { + "204": { + "description": "leaf name updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "The system-assigned name of the physical interface (e.g. DCN,\nILAN-1, ILAN-2). The names are predefined.", + "description": "The system-assigned name of the physical interface (e.g. DCN,\nILAN-1, ILAN-2). The names are predefined.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_id_name_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}/id/type": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\nport type will be 'ethernet'. If the port is Console, the port\ntype will be 'serial'.", + "description": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\nport type will be 'ethernet'. If the port is Console, the port\ntype will be 'serial'.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_id_type_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\nport type will be 'ethernet'. If the port is Console, the port\ntype will be 'serial'.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id_type" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\nport type will be 'ethernet'. If the port is Console, the port\ntype will be 'serial'.", + "description": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\nport type will be 'ethernet'. If the port is Console, the port\ntype will be 'serial'.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_id_type_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id_type" + } + ], + "responses": { + "201": { + "description": "leaf type created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\nport type will be 'ethernet'. If the port is Console, the port\ntype will be 'serial'.", + "description": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\nport type will be 'ethernet'. If the port is Console, the port\ntype will be 'serial'.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_id_type_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id_type" + } + ], + "responses": { + "204": { + "description": "leaf type updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\nport type will be 'ethernet'. If the port is Console, the port\ntype will be 'serial'.", + "description": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\nport type will be 'ethernet'. If the port is Console, the port\ntype will be 'serial'.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_id_type_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}/id/description": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Physical interface description, e.g. 'Management'.", + "description": "Physical interface description, e.g. 'Management'.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_id_description_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Physical interface description, e.g. 'Management'.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id_description" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}/id/ifindex": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB.", + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_id_ifindex_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id_ifindex" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}/state": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Physical management interface state information.", + "description": "Physical management interface state information.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_state_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Physical management interface state information.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_state" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "tags": [ + "data", + "post" + ], + "summary": "Physical management interface state information.", + "description": "Physical management interface state information.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_state_post", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_state-post" + } + ], + "responses": { + "201": { + "description": "container state created" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "Physical management interface state information.", + "description": "Physical management interface state information.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_state_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_state" + } + ], + "responses": { + "201": { + "description": "container state created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "Physical management interface state information.", + "description": "Physical management interface state information.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_state_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_state" + } + ], + "responses": { + "204": { + "description": "container state updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "Physical management interface state information.", + "description": "Physical management interface state information.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_state_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}/state/admin-state": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Whether Admin State is enabled or disabled for this management interface.", + "description": "Whether Admin State is enabled or disabled for this management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_state_admin_state_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Whether Admin State is enabled or disabled for this management interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_state_admin-state" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "Whether Admin State is enabled or disabled for this management interface.", + "description": "Whether Admin State is enabled or disabled for this management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_state_admin_state_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_state_admin-state" + } + ], + "responses": { + "201": { + "description": "leaf admin-state created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "Whether Admin State is enabled or disabled for this management interface.", + "description": "Whether Admin State is enabled or disabled for this management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_state_admin_state_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_state_admin-state" + } + ], + "responses": { + "204": { + "description": "leaf admin-state updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "Whether Admin State is enabled or disabled for this management interface.", + "description": "Whether Admin State is enabled or disabled for this management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_state_admin_state_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}/state/operational-state": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Operational state of this management interface.", + "description": "Operational state of this management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_state_operational_state_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Operational state of this management interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_state_operational-state" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}/properties": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "All the configuration data of the physical management interface.", + "description": "All the configuration data of the physical management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "All the configuration data of the physical management interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "tags": [ + "data", + "post" + ], + "summary": "All the configuration data of the physical management interface.", + "description": "All the configuration data of the physical management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_post", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties-post" + } + ], + "responses": { + "201": { + "description": "container properties created" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "All the configuration data of the physical management interface.", + "description": "All the configuration data of the physical management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties" + } + ], + "responses": { + "201": { + "description": "container properties created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "All the configuration data of the physical management interface.", + "description": "All the configuration data of the physical management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties" + } + ], + "responses": { + "204": { + "description": "container properties updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "All the configuration data of the physical management interface.", + "description": "All the configuration data of the physical management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}/properties/management": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Management interface attributes.", + "description": "Management interface attributes.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_management_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Management interface attributes.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_management" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "tags": [ + "data", + "post" + ], + "summary": "Management interface attributes.", + "description": "Management interface attributes.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_management_post", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_management-post" + } + ], + "responses": { + "201": { + "description": "container management created" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "Management interface attributes.", + "description": "Management interface attributes.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_management_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_management" + } + ], + "responses": { + "201": { + "description": "container management created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "Management interface attributes.", + "description": "Management interface attributes.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_management_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_management" + } + ], + "responses": { + "204": { + "description": "container management updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "Management interface attributes.", + "description": "Management interface attributes.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_management_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}/properties/management/mode": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough).", + "description": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough).", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_management_mode_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough).", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_management_mode" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough).", + "description": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough).", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_management_mode_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_management_mode" + } + ], + "responses": { + "201": { + "description": "leaf mode created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough).", + "description": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough).", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_management_mode_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_management_mode" + } + ], + "responses": { + "204": { + "description": "leaf mode updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough).", + "description": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough).", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_management_mode_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}/properties/ethernet": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Ethernet interface attributes.", + "description": "Ethernet interface attributes.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_ethernet_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Ethernet interface attributes.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "tags": [ + "data", + "post" + ], + "summary": "Ethernet interface attributes.", + "description": "Ethernet interface attributes.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_ethernet_post", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet-post" + } + ], + "responses": { + "201": { + "description": "container ethernet created" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "Ethernet interface attributes.", + "description": "Ethernet interface attributes.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_ethernet_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet" + } + ], + "responses": { + "201": { + "description": "container ethernet created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "Ethernet interface attributes.", + "description": "Ethernet interface attributes.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_ethernet_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet" + } + ], + "responses": { + "204": { + "description": "container ethernet updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "Ethernet interface attributes.", + "description": "Ethernet interface attributes.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_ethernet_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}/properties/ethernet/speed": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Ethernet port speed. For ports with auto-negotiation enabled, this\nrepresents the negotiated port speed.", + "description": "Ethernet port speed. For ports with auto-negotiation enabled, this\nrepresents the negotiated port speed.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_ethernet_speed_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Ethernet port speed. For ports with auto-negotiation enabled, this\nrepresents the negotiated port speed.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet_speed" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}/properties/ethernet/duplex": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Ethernet interface duplex mode. For ports with auto-negotiation enabled,\nthis represents the negotiated duplex mode.", + "description": "Ethernet interface duplex mode. For ports with auto-negotiation enabled,\nthis represents the negotiated duplex mode.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_ethernet_duplex_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Ethernet interface duplex mode. For ports with auto-negotiation enabled,\nthis represents the negotiated duplex mode.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet_duplex" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}/properties/ethernet/flow-control": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Specifies whether this interface will participate in Ethernet flow\ncontrol, via pause frames.", + "description": "Specifies whether this interface will participate in Ethernet flow\ncontrol, via pause frames.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_ethernet_flow_control_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Specifies whether this interface will participate in Ethernet flow\ncontrol, via pause frames.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet_flow-control" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}/properties/ethernet/auto-negotiation": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Specifies whether the interface should negotiate common transmission\nparameters, such as speed, duplex, and flow control with its peer.", + "description": "Specifies whether the interface should negotiate common transmission\nparameters, such as speed, duplex, and flow control with its peer.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_ethernet_auto_negotiation_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Specifies whether the interface should negotiate common transmission\nparameters, such as speed, duplex, and flow control with its peer.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet_auto-negotiation" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/physical-interface={physical-interface-name}/properties/ethernet/mac-address": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "The system-assigned MAC address of the Ethernet interface.", + "description": "The system-assigned MAC address of the Ethernet interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_physical_interface_physical_interface_name_properties_ethernet_mac_address_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/physical-interface-name" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "The system-assigned MAC address of the Ethernet interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet_mac-address" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface": { + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "List of logical IP management interfaces (e.g. 'local').", + "description": "List of logical IP management interfaces (e.g. 'local').", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "List of logical IP management interfaces (e.g. 'local').", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "List of logical IP management interfaces (e.g. 'local').", + "description": "List of logical IP management interfaces (e.g. 'local').", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index" + }, + { + "$ref": "#/parameters/insert" + }, + { + "$ref": "#/parameters/point" + } + ], + "responses": { + "201": { + "description": "list logical-interface created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "List of logical IP management interfaces (e.g. 'local').", + "description": "List of logical IP management interfaces (e.g. 'local').", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index" + } + ], + "responses": { + "204": { + "description": "list logical-interface updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "List of logical IP management interfaces (e.g. 'local').", + "description": "List of logical IP management interfaces (e.g. 'local').", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/index": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "References the system-assigned index of the logical interface.", + "description": "References the system-assigned index of the logical interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_index_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "References the system-assigned index of the logical interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_index" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "References the system-assigned index of the logical interface.", + "description": "References the system-assigned index of the logical interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_index_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_index" + } + ], + "responses": { + "201": { + "description": "leaf index created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "References the system-assigned index of the logical interface.", + "description": "References the system-assigned index of the logical interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_index_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_index" + } + ], + "responses": { + "204": { + "description": "leaf index updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "References the system-assigned index of the logical interface.", + "description": "References the system-assigned index of the logical interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_index_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/id": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Identification information of this logical management interface.", + "description": "Identification information of this logical management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_id_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Identification information of this logical management interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "tags": [ + "data", + "post" + ], + "summary": "Identification information of this logical management interface.", + "description": "Identification information of this logical management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_id_post", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id-post" + } + ], + "responses": { + "201": { + "description": "container id created" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "Identification information of this logical management interface.", + "description": "Identification information of this logical management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_id_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id" + } + ], + "responses": { + "201": { + "description": "container id created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "Identification information of this logical management interface.", + "description": "Identification information of this logical management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_id_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id" + } + ], + "responses": { + "204": { + "description": "container id updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "Identification information of this logical management interface.", + "description": "Identification information of this logical management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_id_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/id/index": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "The index of the logical management interface. Waveserver supports\na single logical interface 'local' that is automatically created by\nthe system. The default index is 1 for the 'local' interface.", + "description": "The index of the logical management interface. Waveserver supports\na single logical interface 'local' that is automatically created by\nthe system. The default index is 1 for the 'local' interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_id_index_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "The index of the logical management interface. Waveserver supports\na single logical interface 'local' that is automatically created by\nthe system. The default index is 1 for the 'local' interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id_index" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "The index of the logical management interface. Waveserver supports\na single logical interface 'local' that is automatically created by\nthe system. The default index is 1 for the 'local' interface.", + "description": "The index of the logical management interface. Waveserver supports\na single logical interface 'local' that is automatically created by\nthe system. The default index is 1 for the 'local' interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_id_index_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id_index" + } + ], + "responses": { + "201": { + "description": "leaf index created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "The index of the logical management interface. Waveserver supports\na single logical interface 'local' that is automatically created by\nthe system. The default index is 1 for the 'local' interface.", + "description": "The index of the logical management interface. Waveserver supports\na single logical interface 'local' that is automatically created by\nthe system. The default index is 1 for the 'local' interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_id_index_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id_index" + } + ], + "responses": { + "204": { + "description": "leaf index updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "The index of the logical management interface. Waveserver supports\na single logical interface 'local' that is automatically created by\nthe system. The default index is 1 for the 'local' interface.", + "description": "The index of the logical management interface. Waveserver supports\na single logical interface 'local' that is automatically created by\nthe system. The default index is 1 for the 'local' interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_id_index_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/id/name": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "The name of the logical management interface, e.g. 'local'.", + "description": "The name of the logical management interface, e.g. 'local'.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_id_name_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "The name of the logical management interface, e.g. 'local'.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id_name" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/id/ifindex": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB.", + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_id_ifindex_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id_ifindex" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/state": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Logical interface state information.", + "description": "Logical interface state information.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_state_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Logical interface state information.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_state" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "tags": [ + "data", + "post" + ], + "summary": "Logical interface state information.", + "description": "Logical interface state information.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_state_post", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_state-post" + } + ], + "responses": { + "201": { + "description": "container state created" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "Logical interface state information.", + "description": "Logical interface state information.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_state_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_state" + } + ], + "responses": { + "201": { + "description": "container state created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "Logical interface state information.", + "description": "Logical interface state information.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_state_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_state" + } + ], + "responses": { + "204": { + "description": "container state updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "Logical interface state information.", + "description": "Logical interface state information.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_state_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/state/admin-state": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Whether Admin State is enabled or disabled for this management interface.", + "description": "Whether Admin State is enabled or disabled for this management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_state_admin_state_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Whether Admin State is enabled or disabled for this management interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_state_admin-state" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "Whether Admin State is enabled or disabled for this management interface.", + "description": "Whether Admin State is enabled or disabled for this management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_state_admin_state_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_state_admin-state" + } + ], + "responses": { + "201": { + "description": "leaf admin-state created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "Whether Admin State is enabled or disabled for this management interface.", + "description": "Whether Admin State is enabled or disabled for this management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_state_admin_state_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_state_admin-state" + } + ], + "responses": { + "204": { + "description": "leaf admin-state updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "Whether Admin State is enabled or disabled for this management interface.", + "description": "Whether Admin State is enabled or disabled for this management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_state_admin_state_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/state/operational-state": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Operational state of this management interface.", + "description": "Operational state of this management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_state_operational_state_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Operational state of this management interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_state_operational-state" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/properties": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "All the configuration data of the logical management interface.", + "description": "All the configuration data of the logical management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "All the configuration data of the logical management interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "tags": [ + "data", + "post" + ], + "summary": "All the configuration data of the logical management interface.", + "description": "All the configuration data of the logical management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_post", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties-post" + } + ], + "responses": { + "201": { + "description": "container properties created" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "All the configuration data of the logical management interface.", + "description": "All the configuration data of the logical management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties" + } + ], + "responses": { + "201": { + "description": "container properties created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "All the configuration data of the logical management interface.", + "description": "All the configuration data of the logical management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties" + } + ], + "responses": { + "204": { + "description": "container properties updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "All the configuration data of the logical management interface.", + "description": "All the configuration data of the logical management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/properties/ipv4": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "IPv4 configuration and operational data.", + "description": "IPv4 configuration and operational data.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "IPv4 configuration and operational data.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "tags": [ + "data", + "post" + ], + "summary": "IPv4 configuration and operational data.", + "description": "IPv4 configuration and operational data.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_post", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4-post" + } + ], + "responses": { + "201": { + "description": "container ipv4 created" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "IPv4 configuration and operational data.", + "description": "IPv4 configuration and operational data.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4" + } + ], + "responses": { + "201": { + "description": "container ipv4 created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "IPv4 configuration and operational data.", + "description": "IPv4 configuration and operational data.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4" + } + ], + "responses": { + "204": { + "description": "container ipv4 updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "IPv4 configuration and operational data.", + "description": "IPv4 configuration and operational data.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/properties/ipv4/admin-state": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface.", + "description": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_admin_state_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_admin-state" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface.", + "description": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_admin_state_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_admin-state" + } + ], + "responses": { + "201": { + "description": "leaf admin-state created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface.", + "description": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_admin_state_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_admin-state" + } + ], + "responses": { + "204": { + "description": "leaf admin-state updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface.", + "description": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_admin_state_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/properties/ipv4/user-ip-address": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "The user-configured IPv4 address and prefix on the interface.", + "description": "The user-configured IPv4 address and prefix on the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_user_ip_address_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "The user-configured IPv4 address and prefix on the interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_user-ip-address" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "The user-configured IPv4 address and prefix on the interface.", + "description": "The user-configured IPv4 address and prefix on the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_user_ip_address_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_user-ip-address" + } + ], + "responses": { + "201": { + "description": "leaf user-ip-address created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "The user-configured IPv4 address and prefix on the interface.", + "description": "The user-configured IPv4 address and prefix on the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_user_ip_address_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_user-ip-address" + } + ], + "responses": { + "204": { + "description": "leaf user-ip-address updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "The user-configured IPv4 address and prefix on the interface.", + "description": "The user-configured IPv4 address and prefix on the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_user_ip_address_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/properties/ipv4/oper-ip-address": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "The operational IPv4 address and prefix on the interface.", + "description": "The operational IPv4 address and prefix on the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_oper_ip_address_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "The operational IPv4 address and prefix on the interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_oper-ip-address" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/properties/ipv4/dhcp-ip-address": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "The DHCP-assigned IPv4 address and prefix on the interface.", + "description": "The DHCP-assigned IPv4 address and prefix on the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_dhcp_ip_address_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "The DHCP-assigned IPv4 address and prefix on the interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_dhcp-ip-address" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/properties/ipv4/apipa-ip-address": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "The Automatic Private IP Addressing (APIPA) assigned IPv4 address\nand prefix on the interface.", + "description": "The Automatic Private IP Addressing (APIPA) assigned IPv4 address\nand prefix on the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_apipa_ip_address_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "The Automatic Private IP Addressing (APIPA) assigned IPv4 address\nand prefix on the interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_apipa-ip-address" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/properties/ipv4/user-gateway": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "The user-configured primary IPv4 gateway on the interface.", + "description": "The user-configured primary IPv4 gateway on the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_user_gateway_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "The user-configured primary IPv4 gateway on the interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_user-gateway" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "The user-configured primary IPv4 gateway on the interface.", + "description": "The user-configured primary IPv4 gateway on the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_user_gateway_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_user-gateway" + } + ], + "responses": { + "201": { + "description": "leaf user-gateway created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "The user-configured primary IPv4 gateway on the interface.", + "description": "The user-configured primary IPv4 gateway on the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_user_gateway_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_user-gateway" + } + ], + "responses": { + "204": { + "description": "leaf user-gateway updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "The user-configured primary IPv4 gateway on the interface.", + "description": "The user-configured primary IPv4 gateway on the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_user_gateway_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/properties/ipv4/backup-gateway": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "The user-configured backup IPv4 gateway on the interface.", + "description": "The user-configured backup IPv4 gateway on the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_backup_gateway_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "The user-configured backup IPv4 gateway on the interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_backup-gateway" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "The user-configured backup IPv4 gateway on the interface.", + "description": "The user-configured backup IPv4 gateway on the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_backup_gateway_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_backup-gateway" + } + ], + "responses": { + "201": { + "description": "leaf backup-gateway created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "The user-configured backup IPv4 gateway on the interface.", + "description": "The user-configured backup IPv4 gateway on the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_backup_gateway_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_backup-gateway" + } + ], + "responses": { + "204": { + "description": "leaf backup-gateway updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "The user-configured backup IPv4 gateway on the interface.", + "description": "The user-configured backup IPv4 gateway on the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_backup_gateway_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/properties/ipv4/oper-gateway": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "The operational IPv4 gateway on the interface.", + "description": "The operational IPv4 gateway on the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_oper_gateway_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "The operational IPv4 gateway on the interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_oper-gateway" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/logical-interface={logical-interface-index}/properties/ipv4/dhcp-gateway": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "The DHCP-assigned IPv4 gateway on the interface.", + "description": "The DHCP-assigned IPv4 gateway on the interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_logical_interface_logical_interface_index_properties_ipv4_dhcp_gateway_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/logical-interface-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "The DHCP-assigned IPv4 gateway on the interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_dhcp-gateway" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/routes": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Top-level container for IP route configuration and operational data.", + "description": "Top-level container for IP route configuration and operational data.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Top-level container for IP route configuration and operational data.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_routes" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "post": { + "tags": [ + "data", + "post" + ], + "summary": "Top-level container for IP route configuration and operational data.", + "description": "Top-level container for IP route configuration and operational data.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_post", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_routes-post" + } + ], + "responses": { + "201": { + "description": "container routes created" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "Top-level container for IP route configuration and operational data.", + "description": "Top-level container for IP route configuration and operational data.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_routes" + } + ], + "responses": { + "201": { + "description": "container routes created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "Top-level container for IP route configuration and operational data.", + "description": "Top-level container for IP route configuration and operational data.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_routes" + } + ], + "responses": { + "204": { + "description": "container routes updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "Top-level container for IP route configuration and operational data.", + "description": "Top-level container for IP route configuration and operational data.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/routes/ipv4-static-route": { + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/routes/ipv4-static-route={ipv4-static-route-destination}": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "List of IPv4 static routing entries.", + "description": "List of IPv4 static routing entries.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "List of IPv4 static routing entries.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "List of IPv4 static routing entries.", + "description": "List of IPv4 static routing entries.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/insert" + }, + { + "$ref": "#/parameters/point" + } + ], + "responses": { + "201": { + "description": "list ipv4-static-route created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "List of IPv4 static routing entries.", + "description": "List of IPv4 static routing entries.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination" + } + ], + "responses": { + "204": { + "description": "list ipv4-static-route updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "List of IPv4 static routing entries.", + "description": "List of IPv4 static routing entries.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/routes/ipv4-static-route={ipv4-static-route-destination}/destination": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured.", + "description": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_destination_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_destination" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured.", + "description": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_destination_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_destination" + } + ], + "responses": { + "201": { + "description": "leaf destination created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured.", + "description": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_destination_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_destination" + } + ], + "responses": { + "204": { + "description": "leaf destination updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured.", + "description": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_destination_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/routes/ipv4-static-route={ipv4-static-route-destination}/next-hop": { + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/routes/ipv4-static-route={ipv4-static-route-destination}/next-hop={next-hop-index}": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "A list of next-hop entries associated with the static route.", + "description": "A list of next-hop entries associated with the static route.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "A list of next-hop entries associated with the static route.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "A list of next-hop entries associated with the static route.", + "description": "A list of next-hop entries associated with the static route.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index" + }, + { + "$ref": "#/parameters/insert" + }, + { + "$ref": "#/parameters/point" + } + ], + "responses": { + "201": { + "description": "list next-hop created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "A list of next-hop entries associated with the static route.", + "description": "A list of next-hop entries associated with the static route.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index" + } + ], + "responses": { + "204": { + "description": "list next-hop updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "A list of next-hop entries associated with the static route.", + "description": "A list of next-hop entries associated with the static route.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/routes/ipv4-static-route={ipv4-static-route-destination}/next-hop={next-hop-index}/index": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1.", + "description": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_index_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_index" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1.", + "description": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_index_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_index" + } + ], + "responses": { + "201": { + "description": "leaf index created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1.", + "description": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_index_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_index" + } + ], + "responses": { + "204": { + "description": "leaf index updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1.", + "description": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_index_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/routes/ipv4-static-route={ipv4-static-route-destination}/next-hop={next-hop-index}/ip-address": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used.", + "description": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_ip_address_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_ip-address" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used.", + "description": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_ip_address_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_ip-address" + } + ], + "responses": { + "201": { + "description": "leaf ip-address created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used.", + "description": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_ip_address_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_ip-address" + } + ], + "responses": { + "204": { + "description": "leaf ip-address updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used.", + "description": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_ip_address_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/routes/ipv4-static-route={ipv4-static-route-destination}/next-hop={next-hop-index}/metric": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Routing metric cost.", + "description": "Routing metric cost.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_metric_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Routing metric cost.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_metric" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "put": { + "tags": [ + "data", + "put" + ], + "summary": "Routing metric cost.", + "description": "Routing metric cost.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_metric_put", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_metric" + } + ], + "responses": { + "201": { + "description": "leaf metric created or replaced" + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "patch": { + "tags": [ + "data", + "patch" + ], + "summary": "Routing metric cost.", + "description": "Routing metric cost.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_metric_patch", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + }, + { + "$ref": "#/parameters/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_metric" + } + ], + "responses": { + "204": { + "description": "leaf metric updated" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + }, + "delete": { + "tags": [ + "data", + "delete" + ], + "summary": "Routing metric cost.", + "description": "Routing metric cost.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_metric_delete", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + } + ], + "responses": { + "204": { + "$ref": "#/responses/204" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/routes/ipv4-static-route={ipv4-static-route-destination}/next-hop={next-hop-index}/associated-interface": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Reference to the associated logical-interface name of the route entry.\nDefaults to the 'local' interface for routes within the subnet\nassociated with the active IP address configured on the local\nmanagement interface.", + "description": "Reference to the associated logical-interface name of the route entry.\nDefaults to the 'local' interface for routes within the subnet\nassociated with the active IP address configured on the local\nmanagement interface.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_associated_interface_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Reference to the associated logical-interface name of the route entry.\nDefaults to the 'local' interface for routes within the subnet\nassociated with the active IP address configured on the local\nmanagement interface.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_associated-interface" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/routes/ipv4-static-route={ipv4-static-route-destination}/next-hop={next-hop-index}/static": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Specifies whether the route entry is user-created (static) or\ndynamically created by a routing protocol.", + "description": "Specifies whether the route entry is user-created (static) or\ndynamically created by a routing protocol.", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_static_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Specifies whether the route entry is user-created (static) or\ndynamically created by a routing protocol.", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_static" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + }, + "/data/ciena-waveserver-interfaces:waveserver-interfaces/routes/ipv4-static-route={ipv4-static-route-destination}/next-hop={next-hop-index}/active": { + "get": { + "tags": [ + "data", + "get" + ], + "summary": "Specifies whether the route is active (present in the kernel IP\nrouting table).", + "description": "Specifies whether the route is active (present in the kernel IP\nrouting table).", + "operationId": "data_ciena_waveserver_interfaces_waveserver_interfaces_routes_ipv4_static_route_ipv4_static_route_destination_next_hop_next_hop_index_active_get", + "produces": [ + "application/yang-data+json" + ], + "parameters": [ + { + "$ref": "#/parameters/ipv4-static-route-destination" + }, + { + "$ref": "#/parameters/next-hop-index" + }, + { + "$ref": "#/parameters/content" + }, + { + "$ref": "#/parameters/depth" + }, + { + "$ref": "#/parameters/fields" + }, + { + "$ref": "#/parameters/filter" + }, + { + "$ref": "#/parameters/with-defaults" + } + ], + "responses": { + "200": { + "description": "Specifies whether the route is active (present in the kernel IP\nrouting table).", + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_active" + } + }, + "204": { + "$ref": "#/responses/204" + }, + "400": { + "$ref": "#/responses/400" + }, + "401": { + "$ref": "#/responses/401" + }, + "404": { + "$ref": "#/responses/404" + }, + "405": { + "$ref": "#/responses/405" + }, + "409": { + "$ref": "#/responses/409" + } + }, + "security": [ + { + "basicAuth": [] + } + ] + } + } + }, + "parameters": { + "content": { + "name": "content", + "in": "query", + "description": "controlling descendant nodes in response", + "required": false, + "type": "string", + "format": "enumeration", + "default": "config", + "enum": [ + "config", + "nonconfig", + "all" + ] + }, + "depth": { + "name": "depth", + "in": "query", + "description": "limit the depth of nodes in response", + "required": false, + "type": "integer", + "format": "uint16" + }, + "fields": { + "name": "fields", + "in": "query", + "description": "optionally identify specific data nodes in response", + "required": false, + "type": "string", + "format": "string" + }, + "filter": { + "name": "filter", + "in": "query", + "description": "xpath expression to filter data nodes in response", + "required": false, + "type": "string", + "format": "string" + }, + "with-defaults": { + "name": "with-defaults", + "in": "query", + "description": "controlling default values in response", + "required": false, + "type": "string", + "format": "enumeration", + "default": "report-all", + "enum": [ + "report-all", + "trim", + "explicit", + "report-all-tagged" + ] + }, + "insert": { + "name": "insert", + "in": "query", + "description": "controlling the order when adding new list elements", + "required": false, + "type": "string", + "format": "enumeration", + "default": "first", + "enum": [ + "first", + "last", + "before", + "after" + ] + }, + "point": { + "name": "point", + "in": "query", + "description": "used to specify the insertion point", + "required": false, + "type": "string", + "format": "string" + }, + "physical-interface-name": { + "name": "physical-interface-name", + "in": "path", + "description": "References the system-assigned name of the interface.", + "required": true, + "type": "string", + "format": "leafref" + }, + "next-hop-index": { + "name": "next-hop-index", + "in": "path", + "description": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1.", + "required": true, + "type": "integer", + "format": "uint32" + }, + "logical-interface-index": { + "name": "logical-interface-index", + "in": "path", + "description": "References the system-assigned index of the logical interface.", + "required": true, + "type": "string", + "format": "leafref" + }, + "ipv4-static-route-destination": { + "name": "ipv4-static-route-destination", + "in": "path", + "description": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured.", + "required": true, + "type": "string", + "format": "string" + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_metric": { + "name": "metric", + "in": "body", + "description": "Routing metric cost.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_metric" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_ip-address": { + "name": "ip-address", + "in": "body", + "description": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_ip-address" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_index": { + "name": "index", + "in": "body", + "description": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_index" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index": { + "name": "next-hop", + "in": "body", + "description": "A list of next-hop entries associated with the static route.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_destination": { + "name": "destination", + "in": "body", + "description": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_destination" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination": { + "name": "ipv4-static-route", + "in": "body", + "description": "List of IPv4 static routing entries.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes-post": { + "name": "routes", + "in": "body", + "description": "Top-level container for IP route configuration and operational data.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_routes-post" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes": { + "name": "routes", + "in": "body", + "description": "Top-level container for IP route configuration and operational data.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_routes" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_state_admin-state": { + "name": "admin-state", + "in": "body", + "description": "Whether Admin State is enabled or disabled for this management interface.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_state_admin-state" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_state-post": { + "name": "state", + "in": "body", + "description": "Physical management interface state information.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_state-post" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_state": { + "name": "state", + "in": "body", + "description": "Physical management interface state information.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_state" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_management_mode": { + "name": "mode", + "in": "body", + "description": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough).", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_management_mode" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_management-post": { + "name": "management", + "in": "body", + "description": "Management interface attributes.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_management-post" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_management": { + "name": "management", + "in": "body", + "description": "Management interface attributes.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_management" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet-post": { + "name": "ethernet", + "in": "body", + "description": "Ethernet interface attributes.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet-post" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet": { + "name": "ethernet", + "in": "body", + "description": "Ethernet interface attributes.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties-post": { + "name": "properties", + "in": "body", + "description": "All the configuration data of the physical management interface.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties-post" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties": { + "name": "properties", + "in": "body", + "description": "All the configuration data of the physical management interface.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_name": { + "name": "name", + "in": "body", + "description": "References the system-assigned name of the interface.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_name" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id_type": { + "name": "type", + "in": "body", + "description": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\nport type will be 'ethernet'. If the port is Console, the port\ntype will be 'serial'.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id_type" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id_name": { + "name": "name", + "in": "body", + "description": "The system-assigned name of the physical interface (e.g. DCN,\nILAN-1, ILAN-2). The names are predefined.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id_name" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id-post": { + "name": "id", + "in": "body", + "description": "Identification information of this management interface.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id-post" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id": { + "name": "id", + "in": "body", + "description": "Identification information of this management interface.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name": { + "name": "physical-interface", + "in": "body", + "description": "List of physical Ethernet management interfaces.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_state_admin-state": { + "name": "admin-state", + "in": "body", + "description": "Whether Admin State is enabled or disabled for this management interface.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_state_admin-state" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_state-post": { + "name": "state", + "in": "body", + "description": "Logical interface state information.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_state-post" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_state": { + "name": "state", + "in": "body", + "description": "Logical interface state information.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_state" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_user-ip-address": { + "name": "user-ip-address", + "in": "body", + "description": "The user-configured IPv4 address and prefix on the interface.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_user-ip-address" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_user-gateway": { + "name": "user-gateway", + "in": "body", + "description": "The user-configured primary IPv4 gateway on the interface.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_user-gateway" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_backup-gateway": { + "name": "backup-gateway", + "in": "body", + "description": "The user-configured backup IPv4 gateway on the interface.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_backup-gateway" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_admin-state": { + "name": "admin-state", + "in": "body", + "description": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_admin-state" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4-post": { + "name": "ipv4", + "in": "body", + "description": "IPv4 configuration and operational data.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4-post" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4": { + "name": "ipv4", + "in": "body", + "description": "IPv4 configuration and operational data.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties-post": { + "name": "properties", + "in": "body", + "description": "All the configuration data of the logical management interface.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties-post" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties": { + "name": "properties", + "in": "body", + "description": "All the configuration data of the logical management interface.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_index": { + "name": "index", + "in": "body", + "description": "References the system-assigned index of the logical interface.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_index" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id_index": { + "name": "index", + "in": "body", + "description": "The index of the logical management interface. Waveserver supports\na single logical interface 'local' that is automatically created by\nthe system. The default index is 1 for the 'local' interface.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id_index" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id-post": { + "name": "id", + "in": "body", + "description": "Identification information of this logical management interface.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id-post" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id": { + "name": "id", + "in": "body", + "description": "Identification information of this logical management interface.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index": { + "name": "logical-interface", + "in": "body", + "description": "List of logical IP management interfaces (e.g. 'local').", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces-post": { + "name": "waveserver-interfaces", + "in": "body", + "description": "Top level container for configuration and operational data for physical\nand logical network interfaces.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces-post" + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces": { + "name": "waveserver-interfaces", + "in": "body", + "description": "Top level container for configuration and operational data for physical\nand logical network interfaces.", + "required": true, + "schema": { + "$ref": "#/definitions/data_ciena-waveserver-interfaces_waveserver-interfaces" + } + }, + "data-put-patch": { + "name": "data", + "in": "body", + "description": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "required": true, + "schema": { + "$ref": "#/definitions/data-put-patch" + } + }, + "data-post": { + "name": "data", + "in": "body", + "description": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "required": true, + "schema": { + "$ref": "#/definitions/data-post" + } + } + }, + "responses": { + "200": { + "description": "OK" + }, + "201": { + "description": "Created" + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "description": "Not Found" + }, + "405": { + "description": "Method Not Allowed" + }, + "409": { + "description": "Conflict" + } + }, + "securityDefinitions": { + "basicAuth": { + "type": "basic" + } + }, + "definitions": { + "yang-library-version": { + "type": "object", + "properties": { + "ietf-restconf:yang-library-version": { + "type": "object", + "description": "This leaf identifies the revision date of the 'ietf-yang-library' YANG module that is implemented by this server. See RESTCONF RFC 8040 for further information.", + "x-yang": { + "type": "leaf" + }, + "properties": { + } + } + } + }, + "root": { + "type": "object", + "properties": { + "ietf-restconf:restconf": { + "type": "object", + "x-yang": { + "type": "root" + }, + "description": "This is the RESTCONF root resource for the RESTCONF datastore and operation resources. See RESTCONF RFC 8040 for further information.", + "properties": { + "data": { + "type": "object", + "properties": { + } + }, + "operations": { + "type": "object", + "properties": { + } + }, + "yang-library-version": { + "type": "string" + } + } + } + } + }, + "operations": { + "type": "object", + "properties": { + "ietf-restconf:operations": { + "type": "object", + "x-yang": { + "type": "operations" + }, + "description": "This resource is a container that provides access to the data-model-specific RPC operations supported by the server. See RESTCONF RFC 8040 for further information.", + "properties": { + + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_static": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:static": { + "description": "Specifies whether the route entry is user-created (static) or\ndynamically created by a routing protocol. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_metric": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:metric": { + "description": "Routing metric cost. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_ip-address": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:ip-address": { + "description": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_index": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:index": { + "description": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_associated-interface": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:associated-interface": { + "description": "Reference to the associated logical-interface name of the route entry.\nDefaults to the 'local' interface for routes within the subnet\nassociated with the active IP address configured on the local\nmanagement interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index_active": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:active": { + "description": "Specifies whether the route is active (present in the kernel IP\nrouting table). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_next-hop_next-hop-index": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:next-hop": { + "type": "array", + "description": "A list of next-hop entries associated with the static route. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "active": { + "description": "Specifies whether the route is active (present in the kernel IP\nrouting table). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "associated-interface": { + "description": "Reference to the associated logical-interface name of the route entry.\nDefaults to the 'local' interface for routes within the subnet\nassociated with the active IP address configured on the local\nmanagement interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "index": { + "description": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "ip-address": { + "description": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "metric": { + "description": "Routing metric cost. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "static": { + "description": "Specifies whether the route entry is user-created (static) or\ndynamically created by a routing protocol. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + } + } + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination_destination": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:destination": { + "description": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes_ipv4-static-route_ipv4-static-route-destination": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:ipv4-static-route": { + "type": "array", + "description": "List of IPv4 static routing entries. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "destination": { + "description": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "next-hop": { + "type": "array", + "description": "A list of next-hop entries associated with the static route. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "active": { + "description": "Specifies whether the route is active (present in the kernel IP\nrouting table). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "associated-interface": { + "description": "Reference to the associated logical-interface name of the route entry.\nDefaults to the 'local' interface for routes within the subnet\nassociated with the active IP address configured on the local\nmanagement interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "index": { + "description": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "ip-address": { + "description": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "metric": { + "description": "Routing metric cost. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "static": { + "description": "Specifies whether the route entry is user-created (static) or\ndynamically created by a routing protocol. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + } + } + } + } + } + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes-post": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:ipv4-static-route": { + "type": "array", + "description": "List of IPv4 static routing entries. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "destination": { + "description": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "next-hop": { + "type": "array", + "description": "A list of next-hop entries associated with the static route. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "active": { + "description": "Specifies whether the route is active (present in the kernel IP\nrouting table). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "associated-interface": { + "description": "Reference to the associated logical-interface name of the route entry.\nDefaults to the 'local' interface for routes within the subnet\nassociated with the active IP address configured on the local\nmanagement interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "index": { + "description": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "ip-address": { + "description": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "metric": { + "description": "Routing metric cost. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "static": { + "description": "Specifies whether the route entry is user-created (static) or\ndynamically created by a routing protocol. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + } + } + } + } + } + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_routes": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:routes": { + "description": "Top-level container for IP route configuration and operational data. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "ipv4-static-route": { + "type": "array", + "description": "List of IPv4 static routing entries. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "destination": { + "description": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "next-hop": { + "type": "array", + "description": "A list of next-hop entries associated with the static route. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "active": { + "description": "Specifies whether the route is active (present in the kernel IP\nrouting table). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "associated-interface": { + "description": "Reference to the associated logical-interface name of the route entry.\nDefaults to the 'local' interface for routes within the subnet\nassociated with the active IP address configured on the local\nmanagement interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "index": { + "description": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "ip-address": { + "description": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "metric": { + "description": "Routing metric cost. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "static": { + "description": "Specifies whether the route entry is user-created (static) or\ndynamically created by a routing protocol. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + } + } + } + } + } + } + } + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_state_operational-state": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:operational-state": { + "description": "Operational state of this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "down", + "enum": [ + "down", + "up" + ] + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_state_admin-state": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_state-post": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "ciena-waveserver-interfaces:operational-state": { + "description": "Operational state of this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "down", + "enum": [ + "down", + "up" + ] + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_state": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:state": { + "description": "Physical management interface state information. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "operational-state": { + "description": "Operational state of this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "down", + "enum": [ + "down", + "up" + ] + } + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_management_mode": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:mode": { + "description": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "management", + "enum": [ + "management", + "wayside-channel" + ] + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_management-post": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:mode": { + "description": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "management", + "enum": [ + "management", + "wayside-channel" + ] + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_management": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:management": { + "description": "Management interface attributes. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "mode": { + "description": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "management", + "enum": [ + "management", + "wayside-channel" + ] + } + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet_speed": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:speed": { + "description": "Ethernet port speed. For ports with auto-negotiation enabled, this\nrepresents the negotiated port speed. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "10M", + "100M", + "1G", + "10G" + ] + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet_mac-address": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:mac-address": { + "description": "The system-assigned MAC address of the Ethernet interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet_flow-control": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:flow-control": { + "description": "Specifies whether this interface will participate in Ethernet flow\ncontrol, via pause frames. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet_duplex": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:duplex": { + "description": "Ethernet interface duplex mode. For ports with auto-negotiation enabled,\nthis represents the negotiated duplex mode. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "full", + "half" + ] + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet_auto-negotiation": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:auto-negotiation": { + "description": "Specifies whether the interface should negotiate common transmission\nparameters, such as speed, duplex, and flow control with its peer. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet-post": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:speed": { + "description": "Ethernet port speed. For ports with auto-negotiation enabled, this\nrepresents the negotiated port speed. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "10M", + "100M", + "1G", + "10G" + ] + }, + "ciena-waveserver-interfaces:duplex": { + "description": "Ethernet interface duplex mode. For ports with auto-negotiation enabled,\nthis represents the negotiated duplex mode. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "full", + "half" + ] + }, + "ciena-waveserver-interfaces:flow-control": { + "description": "Specifies whether this interface will participate in Ethernet flow\ncontrol, via pause frames. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "ciena-waveserver-interfaces:auto-negotiation": { + "description": "Specifies whether the interface should negotiate common transmission\nparameters, such as speed, duplex, and flow control with its peer. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "ciena-waveserver-interfaces:mac-address": { + "description": "The system-assigned MAC address of the Ethernet interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties_ethernet": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:ethernet": { + "description": "Ethernet interface attributes. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "speed": { + "description": "Ethernet port speed. For ports with auto-negotiation enabled, this\nrepresents the negotiated port speed. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "10M", + "100M", + "1G", + "10G" + ] + }, + "duplex": { + "description": "Ethernet interface duplex mode. For ports with auto-negotiation enabled,\nthis represents the negotiated duplex mode. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "full", + "half" + ] + }, + "flow-control": { + "description": "Specifies whether this interface will participate in Ethernet flow\ncontrol, via pause frames. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "auto-negotiation": { + "description": "Specifies whether the interface should negotiate common transmission\nparameters, such as speed, duplex, and flow control with its peer. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "mac-address": { + "description": "The system-assigned MAC address of the Ethernet interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties-post": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:management": { + "description": "Management interface attributes. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "mode": { + "description": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "management", + "enum": [ + "management", + "wayside-channel" + ] + } + } + }, + "ciena-waveserver-interfaces:ethernet": { + "description": "Ethernet interface attributes. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "speed": { + "description": "Ethernet port speed. For ports with auto-negotiation enabled, this\nrepresents the negotiated port speed. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "10M", + "100M", + "1G", + "10G" + ] + }, + "duplex": { + "description": "Ethernet interface duplex mode. For ports with auto-negotiation enabled,\nthis represents the negotiated duplex mode. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "full", + "half" + ] + }, + "flow-control": { + "description": "Specifies whether this interface will participate in Ethernet flow\ncontrol, via pause frames. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "auto-negotiation": { + "description": "Specifies whether the interface should negotiate common transmission\nparameters, such as speed, duplex, and flow control with its peer. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "mac-address": { + "description": "The system-assigned MAC address of the Ethernet interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_properties": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:properties": { + "description": "All the configuration data of the physical management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "management": { + "description": "Management interface attributes. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "mode": { + "description": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "management", + "enum": [ + "management", + "wayside-channel" + ] + } + } + }, + "ethernet": { + "description": "Ethernet interface attributes. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "speed": { + "description": "Ethernet port speed. For ports with auto-negotiation enabled, this\nrepresents the negotiated port speed. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "10M", + "100M", + "1G", + "10G" + ] + }, + "duplex": { + "description": "Ethernet interface duplex mode. For ports with auto-negotiation enabled,\nthis represents the negotiated duplex mode. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "full", + "half" + ] + }, + "flow-control": { + "description": "Specifies whether this interface will participate in Ethernet flow\ncontrol, via pause frames. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "auto-negotiation": { + "description": "Specifies whether the interface should negotiate common transmission\nparameters, such as speed, duplex, and flow control with its peer. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "mac-address": { + "description": "The system-assigned MAC address of the Ethernet interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_name": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:name": { + "description": "References the system-assigned name of the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "leafref" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id_type": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:type": { + "description": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\nport type will be 'ethernet'. If the port is Console, the port\ntype will be 'serial'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "ethernet", + "enum": [ + "ethernet", + "serial" + ] + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id_name": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:name": { + "description": "The system-assigned name of the physical interface (e.g. DCN,\nILAN-1, ILAN-2). The names are predefined. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id_ifindex": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:ifindex": { + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id_description": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:description": { + "description": "Physical interface description, e.g. 'Management'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id-post": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:name": { + "description": "The system-assigned name of the physical interface (e.g. DCN,\nILAN-1, ILAN-2). The names are predefined. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ciena-waveserver-interfaces:type": { + "description": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\nport type will be 'ethernet'. If the port is Console, the port\ntype will be 'serial'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "ethernet", + "enum": [ + "ethernet", + "serial" + ] + }, + "ciena-waveserver-interfaces:description": { + "description": "Physical interface description, e.g. 'Management'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ciena-waveserver-interfaces:ifindex": { + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name_id": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:id": { + "description": "Identification information of this management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "name": { + "description": "The system-assigned name of the physical interface (e.g. DCN,\nILAN-1, ILAN-2). The names are predefined. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "type": { + "description": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\nport type will be 'ethernet'. If the port is Console, the port\ntype will be 'serial'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "ethernet", + "enum": [ + "ethernet", + "serial" + ] + }, + "description": { + "description": "Physical interface description, e.g. 'Management'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ifindex": { + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_physical-interface_physical-interface-name": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:physical-interface": { + "type": "array", + "description": "List of physical Ethernet management interfaces. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "id": { + "description": "Identification information of this management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "name": { + "description": "The system-assigned name of the physical interface (e.g. DCN,\nILAN-1, ILAN-2). The names are predefined. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "type": { + "description": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\nport type will be 'ethernet'. If the port is Console, the port\ntype will be 'serial'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "ethernet", + "enum": [ + "ethernet", + "serial" + ] + }, + "description": { + "description": "Physical interface description, e.g. 'Management'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ifindex": { + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + }, + "name": { + "description": "References the system-assigned name of the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "leafref" + }, + "properties": { + "description": "All the configuration data of the physical management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "management": { + "description": "Management interface attributes. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "mode": { + "description": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "management", + "enum": [ + "management", + "wayside-channel" + ] + } + } + }, + "ethernet": { + "description": "Ethernet interface attributes. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "speed": { + "description": "Ethernet port speed. For ports with auto-negotiation enabled, this\nrepresents the negotiated port speed. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "10M", + "100M", + "1G", + "10G" + ] + }, + "duplex": { + "description": "Ethernet interface duplex mode. For ports with auto-negotiation enabled,\nthis represents the negotiated duplex mode. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "full", + "half" + ] + }, + "flow-control": { + "description": "Specifies whether this interface will participate in Ethernet flow\ncontrol, via pause frames. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "auto-negotiation": { + "description": "Specifies whether the interface should negotiate common transmission\nparameters, such as speed, duplex, and flow control with its peer. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "mac-address": { + "description": "The system-assigned MAC address of the Ethernet interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + }, + "state": { + "description": "Physical management interface state information. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "operational-state": { + "description": "Operational state of this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "down", + "enum": [ + "down", + "up" + ] + } + } + } + } + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_state_operational-state": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:operational-state": { + "description": "Operational state of this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "down", + "enum": [ + "down", + "up" + ] + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_state_admin-state": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_state-post": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "ciena-waveserver-interfaces:operational-state": { + "description": "Operational state of this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "down", + "enum": [ + "down", + "up" + ] + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_state": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:state": { + "description": "Logical interface state information. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "operational-state": { + "description": "Operational state of this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "down", + "enum": [ + "down", + "up" + ] + } + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_user-ip-address": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:user-ip-address": { + "description": "The user-configured IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_user-gateway": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:user-gateway": { + "description": "The user-configured primary IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_oper-ip-address": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:oper-ip-address": { + "description": "The operational IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_oper-gateway": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:oper-gateway": { + "description": "The operational IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_dhcp-ip-address": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:dhcp-ip-address": { + "description": "The DHCP-assigned IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_dhcp-gateway": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:dhcp-gateway": { + "description": "The DHCP-assigned IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_backup-gateway": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:backup-gateway": { + "description": "The user-configured backup IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_apipa-ip-address": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:apipa-ip-address": { + "description": "The Automatic Private IP Addressing (APIPA) assigned IPv4 address\nand prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4_admin-state": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:admin-state": { + "description": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4-post": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:admin-state": { + "description": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "ciena-waveserver-interfaces:user-ip-address": { + "description": "The user-configured IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ciena-waveserver-interfaces:oper-ip-address": { + "description": "The operational IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ciena-waveserver-interfaces:dhcp-ip-address": { + "description": "The DHCP-assigned IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ciena-waveserver-interfaces:apipa-ip-address": { + "description": "The Automatic Private IP Addressing (APIPA) assigned IPv4 address\nand prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ciena-waveserver-interfaces:user-gateway": { + "description": "The user-configured primary IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ciena-waveserver-interfaces:backup-gateway": { + "description": "The user-configured backup IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ciena-waveserver-interfaces:oper-gateway": { + "description": "The operational IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ciena-waveserver-interfaces:dhcp-gateway": { + "description": "The DHCP-assigned IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties_ipv4": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:ipv4": { + "description": "IPv4 configuration and operational data. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "user-ip-address": { + "description": "The user-configured IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-ip-address": { + "description": "The operational IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "dhcp-ip-address": { + "description": "The DHCP-assigned IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "apipa-ip-address": { + "description": "The Automatic Private IP Addressing (APIPA) assigned IPv4 address\nand prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "user-gateway": { + "description": "The user-configured primary IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "backup-gateway": { + "description": "The user-configured backup IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-gateway": { + "description": "The operational IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "dhcp-gateway": { + "description": "The DHCP-assigned IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties-post": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:ipv4": { + "description": "IPv4 configuration and operational data. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "user-ip-address": { + "description": "The user-configured IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-ip-address": { + "description": "The operational IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "dhcp-ip-address": { + "description": "The DHCP-assigned IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "apipa-ip-address": { + "description": "The Automatic Private IP Addressing (APIPA) assigned IPv4 address\nand prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "user-gateway": { + "description": "The user-configured primary IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "backup-gateway": { + "description": "The user-configured backup IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-gateway": { + "description": "The operational IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "dhcp-gateway": { + "description": "The DHCP-assigned IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_properties": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:properties": { + "description": "All the configuration data of the logical management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "ipv4": { + "description": "IPv4 configuration and operational data. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "user-ip-address": { + "description": "The user-configured IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-ip-address": { + "description": "The operational IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "dhcp-ip-address": { + "description": "The DHCP-assigned IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "apipa-ip-address": { + "description": "The Automatic Private IP Addressing (APIPA) assigned IPv4 address\nand prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "user-gateway": { + "description": "The user-configured primary IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "backup-gateway": { + "description": "The user-configured backup IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-gateway": { + "description": "The operational IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "dhcp-gateway": { + "description": "The DHCP-assigned IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_index": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:index": { + "description": "References the system-assigned index of the logical interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "leafref" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id_name": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:name": { + "description": "The name of the logical management interface, e.g. 'local'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id_index": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:index": { + "description": "The index of the logical management interface. Waveserver supports\na single logical interface 'local' that is automatically created by\nthe system. The default index is 1 for the 'local' interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id_ifindex": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:ifindex": { + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id-post": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:index": { + "description": "The index of the logical management interface. Waveserver supports\na single logical interface 'local' that is automatically created by\nthe system. The default index is 1 for the 'local' interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "ciena-waveserver-interfaces:name": { + "description": "The name of the logical management interface, e.g. 'local'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ciena-waveserver-interfaces:ifindex": { + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index_id": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:id": { + "description": "Identification information of this logical management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "index": { + "description": "The index of the logical management interface. Waveserver supports\na single logical interface 'local' that is automatically created by\nthe system. The default index is 1 for the 'local' interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "name": { + "description": "The name of the logical management interface, e.g. 'local'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ifindex": { + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces_logical-interface_logical-interface-index": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:logical-interface": { + "type": "array", + "description": "List of logical IP management interfaces (e.g. 'local'). (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "id": { + "description": "Identification information of this logical management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "index": { + "description": "The index of the logical management interface. Waveserver supports\na single logical interface 'local' that is automatically created by\nthe system. The default index is 1 for the 'local' interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "name": { + "description": "The name of the logical management interface, e.g. 'local'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ifindex": { + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + }, + "index": { + "description": "References the system-assigned index of the logical interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "leafref" + }, + "properties": { + "description": "All the configuration data of the logical management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "ipv4": { + "description": "IPv4 configuration and operational data. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "user-ip-address": { + "description": "The user-configured IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-ip-address": { + "description": "The operational IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "dhcp-ip-address": { + "description": "The DHCP-assigned IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "apipa-ip-address": { + "description": "The Automatic Private IP Addressing (APIPA) assigned IPv4 address\nand prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "user-gateway": { + "description": "The user-configured primary IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "backup-gateway": { + "description": "The user-configured backup IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-gateway": { + "description": "The operational IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "dhcp-gateway": { + "description": "The DHCP-assigned IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + }, + "state": { + "description": "Logical interface state information. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "operational-state": { + "description": "Operational state of this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "down", + "enum": [ + "down", + "up" + ] + } + } + } + } + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces-post": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:physical-interface": { + "type": "array", + "description": "List of physical Ethernet management interfaces. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "id": { + "description": "Identification information of this management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "name": { + "description": "The system-assigned name of the physical interface (e.g. DCN,\nILAN-1, ILAN-2). The names are predefined. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "type": { + "description": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\nport type will be 'ethernet'. If the port is Console, the port\ntype will be 'serial'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "ethernet", + "enum": [ + "ethernet", + "serial" + ] + }, + "description": { + "description": "Physical interface description, e.g. 'Management'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ifindex": { + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + }, + "name": { + "description": "References the system-assigned name of the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "leafref" + }, + "properties": { + "description": "All the configuration data of the physical management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "management": { + "description": "Management interface attributes. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "mode": { + "description": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "management", + "enum": [ + "management", + "wayside-channel" + ] + } + } + }, + "ethernet": { + "description": "Ethernet interface attributes. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "speed": { + "description": "Ethernet port speed. For ports with auto-negotiation enabled, this\nrepresents the negotiated port speed. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "10M", + "100M", + "1G", + "10G" + ] + }, + "duplex": { + "description": "Ethernet interface duplex mode. For ports with auto-negotiation enabled,\nthis represents the negotiated duplex mode. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "full", + "half" + ] + }, + "flow-control": { + "description": "Specifies whether this interface will participate in Ethernet flow\ncontrol, via pause frames. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "auto-negotiation": { + "description": "Specifies whether the interface should negotiate common transmission\nparameters, such as speed, duplex, and flow control with its peer. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "mac-address": { + "description": "The system-assigned MAC address of the Ethernet interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + }, + "state": { + "description": "Physical management interface state information. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "operational-state": { + "description": "Operational state of this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "down", + "enum": [ + "down", + "up" + ] + } + } + } + } + } + }, + "ciena-waveserver-interfaces:logical-interface": { + "type": "array", + "description": "List of logical IP management interfaces (e.g. 'local'). (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "id": { + "description": "Identification information of this logical management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "index": { + "description": "The index of the logical management interface. Waveserver supports\na single logical interface 'local' that is automatically created by\nthe system. The default index is 1 for the 'local' interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "name": { + "description": "The name of the logical management interface, e.g. 'local'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ifindex": { + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + }, + "index": { + "description": "References the system-assigned index of the logical interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "leafref" + }, + "properties": { + "description": "All the configuration data of the logical management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "ipv4": { + "description": "IPv4 configuration and operational data. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "user-ip-address": { + "description": "The user-configured IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-ip-address": { + "description": "The operational IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "dhcp-ip-address": { + "description": "The DHCP-assigned IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "apipa-ip-address": { + "description": "The Automatic Private IP Addressing (APIPA) assigned IPv4 address\nand prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "user-gateway": { + "description": "The user-configured primary IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "backup-gateway": { + "description": "The user-configured backup IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-gateway": { + "description": "The operational IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "dhcp-gateway": { + "description": "The DHCP-assigned IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + }, + "state": { + "description": "Logical interface state information. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "operational-state": { + "description": "Operational state of this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "down", + "enum": [ + "down", + "up" + ] + } + } + } + } + } + }, + "ciena-waveserver-interfaces:routes": { + "description": "Top-level container for IP route configuration and operational data. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "ipv4-static-route": { + "type": "array", + "description": "List of IPv4 static routing entries. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "destination": { + "description": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "next-hop": { + "type": "array", + "description": "A list of next-hop entries associated with the static route. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "active": { + "description": "Specifies whether the route is active (present in the kernel IP\nrouting table). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "associated-interface": { + "description": "Reference to the associated logical-interface name of the route entry.\nDefaults to the 'local' interface for routes within the subnet\nassociated with the active IP address configured on the local\nmanagement interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "index": { + "description": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "ip-address": { + "description": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "metric": { + "description": "Routing metric cost. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "static": { + "description": "Specifies whether the route entry is user-created (static) or\ndynamically created by a routing protocol. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + } + } + } + } + } + } + } + } + } + } + }, + "data_ciena-waveserver-interfaces_waveserver-interfaces": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:waveserver-interfaces": { + "description": "Top level container for configuration and operational data for physical\nand logical network interfaces. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "physical-interface": { + "type": "array", + "description": "List of physical Ethernet management interfaces. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "id": { + "description": "Identification information of this management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "name": { + "description": "The system-assigned name of the physical interface (e.g. DCN,\nILAN-1, ILAN-2). The names are predefined. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "type": { + "description": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\nport type will be 'ethernet'. If the port is Console, the port\ntype will be 'serial'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "ethernet", + "enum": [ + "ethernet", + "serial" + ] + }, + "description": { + "description": "Physical interface description, e.g. 'Management'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ifindex": { + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + }, + "name": { + "description": "References the system-assigned name of the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "leafref" + }, + "properties": { + "description": "All the configuration data of the physical management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "management": { + "description": "Management interface attributes. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "mode": { + "description": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "management", + "enum": [ + "management", + "wayside-channel" + ] + } + } + }, + "ethernet": { + "description": "Ethernet interface attributes. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "speed": { + "description": "Ethernet port speed. For ports with auto-negotiation enabled, this\nrepresents the negotiated port speed. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "10M", + "100M", + "1G", + "10G" + ] + }, + "duplex": { + "description": "Ethernet interface duplex mode. For ports with auto-negotiation enabled,\nthis represents the negotiated duplex mode. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "full", + "half" + ] + }, + "flow-control": { + "description": "Specifies whether this interface will participate in Ethernet flow\ncontrol, via pause frames. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "auto-negotiation": { + "description": "Specifies whether the interface should negotiate common transmission\nparameters, such as speed, duplex, and flow control with its peer. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "mac-address": { + "description": "The system-assigned MAC address of the Ethernet interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + }, + "state": { + "description": "Physical management interface state information. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "operational-state": { + "description": "Operational state of this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "down", + "enum": [ + "down", + "up" + ] + } + } + } + } + } + }, + "logical-interface": { + "type": "array", + "description": "List of logical IP management interfaces (e.g. 'local'). (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "id": { + "description": "Identification information of this logical management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "index": { + "description": "The index of the logical management interface. Waveserver supports\na single logical interface 'local' that is automatically created by\nthe system. The default index is 1 for the 'local' interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "name": { + "description": "The name of the logical management interface, e.g. 'local'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ifindex": { + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + }, + "index": { + "description": "References the system-assigned index of the logical interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "leafref" + }, + "properties": { + "description": "All the configuration data of the logical management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "ipv4": { + "description": "IPv4 configuration and operational data. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "user-ip-address": { + "description": "The user-configured IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-ip-address": { + "description": "The operational IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "dhcp-ip-address": { + "description": "The DHCP-assigned IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "apipa-ip-address": { + "description": "The Automatic Private IP Addressing (APIPA) assigned IPv4 address\nand prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "user-gateway": { + "description": "The user-configured primary IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "backup-gateway": { + "description": "The user-configured backup IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-gateway": { + "description": "The operational IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "dhcp-gateway": { + "description": "The DHCP-assigned IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + }, + "state": { + "description": "Logical interface state information. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "operational-state": { + "description": "Operational state of this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "down", + "enum": [ + "down", + "up" + ] + } + } + } + } + } + }, + "routes": { + "description": "Top-level container for IP route configuration and operational data. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "ipv4-static-route": { + "type": "array", + "description": "List of IPv4 static routing entries. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "destination": { + "description": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "next-hop": { + "type": "array", + "description": "A list of next-hop entries associated with the static route. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "active": { + "description": "Specifies whether the route is active (present in the kernel IP\nrouting table). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "associated-interface": { + "description": "Reference to the associated logical-interface name of the route entry.\nDefaults to the 'local' interface for routes within the subnet\nassociated with the active IP address configured on the local\nmanagement interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "index": { + "description": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "ip-address": { + "description": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "metric": { + "description": "Routing metric cost. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "static": { + "description": "Specifies whether the route entry is user-created (static) or\ndynamically created by a routing protocol. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "data-put-patch": { + "type": "object", + "properties": { + "ietf-restconf:data": { + "description": "This module defines Ethernet and IP management interfaces support for\nCiena's Waveserver Platform.", + "type": "object", + "x-yang": { + "type": "datastore" + }, + "properties": { + "ciena-waveserver-interfaces:waveserver-interfaces": { + "description": "Top level container for configuration and operational data for physical\nand logical network interfaces. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "physical-interface": { + "type": "array", + "description": "List of physical Ethernet management interfaces. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "id": { + "description": "Identification information of this management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "name": { + "description": "The system-assigned name of the physical interface (e.g. DCN,\nILAN-1, ILAN-2). The names are predefined. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "type": { + "description": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\nport type will be 'ethernet'. If the port is Console, the port\ntype will be 'serial'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "ethernet", + "enum": [ + "ethernet", + "serial" + ] + }, + "description": { + "description": "Physical interface description, e.g. 'Management'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ifindex": { + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + }, + "name": { + "description": "References the system-assigned name of the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "leafref" + }, + "properties": { + "description": "All the configuration data of the physical management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "management": { + "description": "Management interface attributes. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "mode": { + "description": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "management", + "enum": [ + "management", + "wayside-channel" + ] + } + } + }, + "ethernet": { + "description": "Ethernet interface attributes. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "speed": { + "description": "Ethernet port speed. For ports with auto-negotiation enabled, this\nrepresents the negotiated port speed. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "10M", + "100M", + "1G", + "10G" + ] + }, + "duplex": { + "description": "Ethernet interface duplex mode. For ports with auto-negotiation enabled,\nthis represents the negotiated duplex mode. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "full", + "half" + ] + }, + "flow-control": { + "description": "Specifies whether this interface will participate in Ethernet flow\ncontrol, via pause frames. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "auto-negotiation": { + "description": "Specifies whether the interface should negotiate common transmission\nparameters, such as speed, duplex, and flow control with its peer. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "mac-address": { + "description": "The system-assigned MAC address of the Ethernet interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + }, + "state": { + "description": "Physical management interface state information. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "operational-state": { + "description": "Operational state of this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "down", + "enum": [ + "down", + "up" + ] + } + } + } + } + } + }, + "logical-interface": { + "type": "array", + "description": "List of logical IP management interfaces (e.g. 'local'). (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "id": { + "description": "Identification information of this logical management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "index": { + "description": "The index of the logical management interface. Waveserver supports\na single logical interface 'local' that is automatically created by\nthe system. The default index is 1 for the 'local' interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "name": { + "description": "The name of the logical management interface, e.g. 'local'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ifindex": { + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + }, + "index": { + "description": "References the system-assigned index of the logical interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "leafref" + }, + "properties": { + "description": "All the configuration data of the logical management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "ipv4": { + "description": "IPv4 configuration and operational data. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "user-ip-address": { + "description": "The user-configured IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-ip-address": { + "description": "The operational IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "dhcp-ip-address": { + "description": "The DHCP-assigned IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "apipa-ip-address": { + "description": "The Automatic Private IP Addressing (APIPA) assigned IPv4 address\nand prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "user-gateway": { + "description": "The user-configured primary IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "backup-gateway": { + "description": "The user-configured backup IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-gateway": { + "description": "The operational IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "dhcp-gateway": { + "description": "The DHCP-assigned IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + }, + "state": { + "description": "Logical interface state information. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "operational-state": { + "description": "Operational state of this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "down", + "enum": [ + "down", + "up" + ] + } + } + } + } + } + }, + "routes": { + "description": "Top-level container for IP route configuration and operational data. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "ipv4-static-route": { + "type": "array", + "description": "List of IPv4 static routing entries. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "destination": { + "description": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "next-hop": { + "type": "array", + "description": "A list of next-hop entries associated with the static route. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "active": { + "description": "Specifies whether the route is active (present in the kernel IP\nrouting table). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "associated-interface": { + "description": "Reference to the associated logical-interface name of the route entry.\nDefaults to the 'local' interface for routes within the subnet\nassociated with the active IP address configured on the local\nmanagement interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "index": { + "description": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "ip-address": { + "description": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "metric": { + "description": "Routing metric cost. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "static": { + "description": "Specifies whether the route entry is user-created (static) or\ndynamically created by a routing protocol. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + } + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "data-post": { + "type": "object", + "properties": { + "ciena-waveserver-interfaces:waveserver-interfaces": { + "description": "Top level container for configuration and operational data for physical\nand logical network interfaces. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "physical-interface": { + "type": "array", + "description": "List of physical Ethernet management interfaces. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "id": { + "description": "Identification information of this management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "name": { + "description": "The system-assigned name of the physical interface (e.g. DCN,\nILAN-1, ILAN-2). The names are predefined. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "type": { + "description": "Management port type. If the port is DCN, ILAN-1, or ILAN-2, the\nport type will be 'ethernet'. If the port is Console, the port\ntype will be 'serial'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "ethernet", + "enum": [ + "ethernet", + "serial" + ] + }, + "description": { + "description": "Physical interface description, e.g. 'Management'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ifindex": { + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + }, + "name": { + "description": "References the system-assigned name of the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "leafref" + }, + "properties": { + "description": "All the configuration data of the physical management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "management": { + "description": "Management interface attributes. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "mode": { + "description": "Management port mode. Specifies whether the port is configured as a\nlocal management interface or wayside communications channel (carry\nthrough). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "management", + "enum": [ + "management", + "wayside-channel" + ] + } + } + }, + "ethernet": { + "description": "Ethernet interface attributes. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "speed": { + "description": "Ethernet port speed. For ports with auto-negotiation enabled, this\nrepresents the negotiated port speed. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "10M", + "100M", + "1G", + "10G" + ] + }, + "duplex": { + "description": "Ethernet interface duplex mode. For ports with auto-negotiation enabled,\nthis represents the negotiated duplex mode. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "Unknown", + "enum": [ + "Unknown", + "full", + "half" + ] + }, + "flow-control": { + "description": "Specifies whether this interface will participate in Ethernet flow\ncontrol, via pause frames. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "auto-negotiation": { + "description": "Specifies whether the interface should negotiate common transmission\nparameters, such as speed, duplex, and flow control with its peer. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "mac-address": { + "description": "The system-assigned MAC address of the Ethernet interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + }, + "state": { + "description": "Physical management interface state information. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "operational-state": { + "description": "Operational state of this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "down", + "enum": [ + "down", + "up" + ] + } + } + } + } + } + }, + "logical-interface": { + "type": "array", + "description": "List of logical IP management interfaces (e.g. 'local'). (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "id": { + "description": "Identification information of this logical management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "index": { + "description": "The index of the logical management interface. Waveserver supports\na single logical interface 'local' that is automatically created by\nthe system. The default index is 1 for the 'local' interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "name": { + "description": "The name of the logical management interface, e.g. 'local'. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "ifindex": { + "description": "The system-assigned interface index number, corresponding to the\nifIndex in SNMP IF-MIB. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + } + } + }, + "index": { + "description": "References the system-assigned index of the logical interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "leafref" + }, + "properties": { + "description": "All the configuration data of the logical management interface. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "ipv4": { + "description": "IPv4 configuration and operational data. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether IPv4 stack is enabled or disabled on this interface.\nAlways enabled for the local management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "user-ip-address": { + "description": "The user-configured IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-ip-address": { + "description": "The operational IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "dhcp-ip-address": { + "description": "The DHCP-assigned IPv4 address and prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "apipa-ip-address": { + "description": "The Automatic Private IP Addressing (APIPA) assigned IPv4 address\nand prefix on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "user-gateway": { + "description": "The user-configured primary IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "backup-gateway": { + "description": "The user-configured backup IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "oper-gateway": { + "description": "The operational IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "dhcp-gateway": { + "description": "The DHCP-assigned IPv4 gateway on the interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + } + } + } + } + }, + "state": { + "description": "Logical interface state information. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "admin-state": { + "description": "Whether Admin State is enabled or disabled for this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "disabled", + "enum": [ + "disabled", + "enabled" + ] + }, + "operational-state": { + "description": "Operational state of this management interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "enumeration", + "default": "down", + "enum": [ + "down", + "up" + ] + } + } + } + } + } + }, + "routes": { + "description": "Top-level container for IP route configuration and operational data. (non-presence)", + "type": "object", + "x-yang": { + "type": "container", + "is_presence": "false" + }, + "properties": { + "ipv4-static-route": { + "type": "array", + "description": "List of IPv4 static routing entries. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "destination": { + "description": "IPv4 route destination prefix for the static route. Only one static\nrouting entry per unique destination ip/prefix can be configured. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "next-hop": { + "type": "array", + "description": "A list of next-hop entries associated with the static route. (list)", + "x-yang": { + "type": "list" + }, + "items": { + "type": "object", + "properties": { + "active": { + "description": "Specifies whether the route is active (present in the kernel IP\nrouting table). (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + }, + "associated-interface": { + "description": "Reference to the associated logical-interface name of the route entry.\nDefaults to the 'local' interface for routes within the subnet\nassociated with the active IP address configured on the local\nmanagement interface. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "index": { + "description": "The index key of the entry in the next-hop list. Currently only\none static entry is supported per destination prefix, so the\nindex should always be 1. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "ip-address": { + "description": "IPv4 route next-hop or gateway address associated with the route. If\nnot specified, the default gateway value for the local management\ninterface will be used. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "string" + }, + "metric": { + "description": "Routing metric cost. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "integer", + "format": "uint32" + }, + "static": { + "description": "Specifies whether the route entry is user-created (static) or\ndynamically created by a routing protocol. (leaf)", + "x-yang": { + "type": "leaf" + }, + "type": "string", + "format": "boolean" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "data": { + "type": "object", + "properties": { + "ietf-restconf:data": { + "type": "object", + "description": "This resource represents the combined configuration and state data resources that can be accessed by a client and cannot be created or deleted by the client. See RESTCONF RFC 8040 for further information.", + "x-yang": { + "type": "datastore" + }, + "properties": { + } + } + } + } + } +} diff --git a/yang/cocsn.yang b/yang/cocsn.yang new file mode 100644 index 0000000000000000000000000000000000000000..6b644a03efd35179044b857241b11cdc3f21a18d --- /dev/null +++ b/yang/cocsn.yang @@ -0,0 +1,132 @@ +module cocsn { + yang-version 1.1; + namespace "urn:danet:params:xml:ns:yang:cocsn"; + prefix coc; + + import ietf-yang-types { + prefix yang; + } + + import ietf-restconf { + prefix rc; + } + + organization + "Darmstadt University of Applied Sciences"; + + description + "This YANG module represents the CoCSN API"; + + revision "2020-08-17" { + description + "Initial Revision"; + } + + container interfaces { + list interface { + config false; + key "name"; + leaf name { + type string; + mandatory "true"; + description + "Interface name. Example value: en0"; + } + leaf-list addresses { + type yang:dotted-quad; + description + "Interface IP address. Example value: 10.10.10.1"; + } + leaf phys-address { + type yang:phys-address; + description + "The interface's address at its protocol sub-layer. For + example, for an 802.x interface, this object normally + contains a Media Access Control (MAC) address. The + interface's media-specific modules must define the bit + and byte ordering and the format of the value of this + object. For interfaces that do not have such an address + (e.g., a serial line), this node is not present."; + reference + "RFC 2863: The Interfaces Group MIB - ifPhysAddress"; + } + leaf enabled { + type boolean; + default "false"; + description + "Enable or disable the interface. Example value: true"; + } + leaf oper-status { + type enumeration { + enum up; + enum down; + } + mandatory "true"; + description + "Describes whether the interface is physically up or down"; + } + } + } + + container routes { + list route { + config false; + key "destination"; + leaf destination { + type string; + mandatory "true"; + description + "Route destination. IP network"; + } + leaf gateway { + type string; + mandatory "true"; + description + "Route gateway. IP address or host name"; + } + leaf flags { + type string; + mandatory "true"; + description + "Flags of the route"; + } + leaf interface { + type string; + mandatory "true"; + description + "Interface used for the route"; + } + leaf expire { + type string; + mandatory "false"; + description + "Expiration timer of the route"; + } + } + } + + container arp-table { + list arp-entry { + config false; + key "address"; + leaf address { + type string; + mandatory "true"; + description + "IP address of the arp entry"; + } + leaf phs-address { + type yang:phys-address; + mandatory "true"; + description + "MAC address of the arp entry"; + } + leaf interface { + type string; + mandatory "true"; + description + "Interface of the arp entry"; + } + } + } +} \ No newline at end of file diff --git a/yang/cocsn.yml b/yang/cocsn.yml new file mode 100644 index 0000000000000000000000000000000000000000..8189791e36f033a5b4279424f83b9202d0cc341e --- /dev/null +++ b/yang/cocsn.yml @@ -0,0 +1,176 @@ +--- +swagger: "2.0" +info: + description: "This YANG module represents the CoCSN API" + version: "1.0" + title: "cocsn API" +host: "localhost:8080" +consumes: +- "application/yang-data+json" +produces: +- "application/yang-data+json" +paths: + /data/interfaces/: + get: + tags: + - "cocsn" + summary: "returns cocsn.Interfaces" + description: "returns cocsn.Interfaces" + parameters: [] + responses: + 200: + description: "cocsn.Interfaces" + schema: + $ref: "#/definitions/cocsn.InterfacesWrapper" + 400: + description: "Internal error" + post: + tags: + - "cocsn" + summary: "creates cocsn.Interfaces" + description: "creates cocsn.Interfaces" + parameters: + - in: "body" + name: "cocsn.Interfaces.body-param" + description: "cocsn.Interfaces to be added to list" + required: false + schema: + $ref: "#/definitions/cocsn.InterfacesWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "cocsn" + summary: "creates or updates cocsn.Interfaces" + description: "creates or updates cocsn.Interfaces" + parameters: + - in: "body" + name: "cocsn.Interfaces.body-param" + description: "cocsn.Interfaces to be added or updated" + required: false + schema: + $ref: "#/definitions/cocsn.InterfacesWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "cocsn" + summary: "removes cocsn.Interfaces" + description: "removes cocsn.Interfaces" + parameters: [] + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/interfaces/interface-state={name}/: + get: + tags: + - "cocsn" + summary: "returns cocsn.interfaces.InterfaceState" + description: "returns cocsn.interfaces.InterfaceState" + parameters: + - name: "name" + in: "path" + description: "Id of interface-state" + required: true + type: "string" + responses: + 200: + description: "cocsn.interfaces.InterfaceState" + schema: + $ref: "#/definitions/cocsn.interfaces.InterfaceStateWrapper" + 400: + description: "Internal error" + /data/interfaces/interface={name}/: + get: + tags: + - "cocsn" + summary: "returns cocsn.interfaces.Interface" + description: "returns cocsn.interfaces.Interface" + parameters: + - name: "name" + in: "path" + description: "Id of interface" + required: true + type: "string" + responses: + 200: + description: "cocsn.interfaces.Interface" + schema: + $ref: "#/definitions/cocsn.interfaces.InterfaceWrapper" + 400: + description: "Internal error" +definitions: + cocsn.Interfaces: + type: "object" + properties: + interface: + type: "array" + items: + $ref: "#/definitions/cocsn.interfaces.Interface" + interface-state: + type: "array" + items: + $ref: "#/definitions/cocsn.interfaces.InterfaceState" + cocsn.InterfacesWrapper: + properties: + interfaces: + $ref: "#/definitions/cocsn.Interfaces" + cocsn.OperStatusEnumeration: + type: "string" + enum: + - "up" + - "down" + cocsn.interfaces.Interface: + type: "object" + properties: + phys-address: + type: "string" + description: "The interface's address at its protocol sub-layer. For\n \ + \ example, for an 802.x interface, this object normally\n \ + \ contains a Media Access Control (MAC) address. The\n \ + \ interface's media-specific modules must define the bit\n\ + \ and byte ordering and the format of the value of this\n\ + \ object. For interfaces that do not have such an address\n\ + \ (e.g., a serial line), this node is not present. REF:RFC\ + \ 2863: The Interfaces Group MIB - ifPhysAddress" + name: + type: "string" + description: "Interface name. Example value: en0" + addresses: + type: "array" + description: "Interface IP address. Example value: 10.10.10.1" + items: + type: "string" + enabled: + type: "boolean" + description: "Enable or disable the interface. Example value: true" + default: false + cocsn.interfaces.InterfaceState: + type: "object" + properties: + name: + type: "string" + description: "Interface name. Example value: GigabitEthernet 0/0/0" + oper-status: + description: "Describes whether the interface is physically up or down" + $ref: "#/definitions/cocsn.OperStatusEnumeration" + cocsn.interfaces.InterfaceStateWrapper: + properties: + interface-state: + $ref: "#/definitions/cocsn.interfaces.InterfaceState" + cocsn.interfaces.InterfaceWrapper: + properties: + interface: + $ref: "#/definitions/cocsn.interfaces.Interface" diff --git a/yang/debug.yang b/yang/debug.yang new file mode 100644 index 0000000000000000000000000000000000000000..a3e02a17d074244e7df9fa2066d52512cf27df1e --- /dev/null +++ b/yang/debug.yang @@ -0,0 +1,29 @@ +module debug { + yang-version 1.1; + namespace "urn:example:params:xml:ns:yang:example"; + prefix if; + + organization + "example"; + + description + "example"; + + revision "2020-08-17" { + description + "Initial Revision"; + } + + container interfaces { + list interface { + config false; + key "name"; + leaf name { + type string; + mandatory "true"; + description + "Interface name. Example value: en0"; + } + } + } +} \ No newline at end of file diff --git a/yang/ietf-restconf.yang b/yang/ietf-restconf.yang new file mode 100644 index 0000000000000000000000000000000000000000..b47455b81644ddf810e7e3241cf69cb4d2f975b3 --- /dev/null +++ b/yang/ietf-restconf.yang @@ -0,0 +1,278 @@ +module ietf-restconf { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf"; + prefix "rc"; + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "WG Web: <https://datatracker.ietf.org/wg/netconf/> + WG List: <mailto:netconf@ietf.org> + + Author: Andy Bierman + <mailto:andy@yumaworks.com> + + Author: Martin Bjorklund + <mailto:mbj@tail-f.com> + + Author: Kent Watsen + <mailto:kwatsen@juniper.net>"; + + description + "This module contains conceptual YANG specifications + for basic RESTCONF media type definitions used in + RESTCONF protocol messages. + + Note that the YANG definitions within this module do not + represent configuration data of any kind. + The 'restconf-media-type' YANG extension statement + provides a normative syntax for XML and JSON + message-encoding purposes. + + Copyright (c) 2017 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8040; see + the RFC itself for full legal notices."; + + revision 2017-01-26 { + description + "Initial revision."; + reference + "RFC 8040: RESTCONF Protocol."; + } + + extension yang-data { + argument name { + yin-element true; + } + description + "This extension is used to specify a YANG data template that + represents conceptual data defined in YANG. It is + intended to describe hierarchical data independent of + protocol context or specific message-encoding format. + Data definition statements within a yang-data extension + specify the generic syntax for the specific YANG data + template, whose name is the argument of the 'yang-data' + extension statement. + + Note that this extension does not define a media type. + A specification using this extension MUST specify the + message-encoding rules, including the content media type. + + The mandatory 'name' parameter value identifies the YANG + data template that is being defined. It contains the + template name. + + This extension is ignored unless it appears as a top-level + statement. It MUST contain data definition statements + that result in exactly one container data node definition. + An instance of a YANG data template can thus be translated + into an XML instance document, whose top-level element + corresponds to the top-level container. + The module name and namespace values for the YANG module using + the extension statement are assigned to instance document data + conforming to the data definition statements within + this extension. + + The substatements of this extension MUST follow the + 'data-def-stmt' rule in the YANG ABNF. + + The XPath document root is the extension statement itself, + such that the child nodes of the document root are + represented by the data-def-stmt substatements within + this extension. This conceptual document is the context + for the following YANG statements: + + - must-stmt + - when-stmt + - path-stmt + - min-elements-stmt + - max-elements-stmt + - mandatory-stmt + - unique-stmt + - ordered-by + - instance-identifier data type + + The following data-def-stmt substatements are constrained + when used within a 'yang-data' extension statement. + + - The list-stmt is not required to have a key-stmt defined. + - The if-feature-stmt is ignored if present. + - The config-stmt is ignored if present. + - The available identity values for any 'identityref' + leaf or leaf-list nodes are limited to the module + containing this extension statement and the modules + imported into that module. + "; + } + + rc:yang-data yang-errors { + uses errors; + } + + rc:yang-data yang-api { + uses restconf; + } + + grouping errors { + description + "A grouping that contains a YANG container + representing the syntax and semantics of a + YANG Patch error report within a response message."; + + container errors { + description + "Represents an error report returned by the server if + a request results in an error."; + + list error { + description + "An entry containing information about one + specific error that occurred while processing + a RESTCONF request."; + reference + "RFC 6241, Section 4.3."; + + leaf error-type { + type enumeration { + enum transport { + description + "The transport layer."; + } + enum rpc { + description + "The rpc or notification layer."; + } + enum protocol { + description + "The protocol operation layer."; + } + enum application { + description + "The server application layer."; + } + } + mandatory true; + description + "The protocol layer where the error occurred."; + } + + leaf error-tag { + type string; + mandatory true; + description + "The enumerated error-tag."; + } + + leaf error-app-tag { + type string; + description + "The application-specific error-tag."; + } + + leaf error-path { + type instance-identifier; + description + "The YANG instance identifier associated + with the error node."; + } + + leaf error-message { + type string; + description + "A message describing the error."; + } + + anydata error-info { + description + "This anydata value MUST represent a container with + zero or more data nodes representing additional + error information."; + } + } + } + } + + grouping restconf { + description + "Conceptual grouping representing the RESTCONF + root resource."; + + container restconf { + description + "Conceptual container representing the RESTCONF + root resource."; + + container data { + description + "Container representing the datastore resource. + Represents the conceptual root of all state data + and configuration data supported by the server. + The child nodes of this container can be any data + resources that are defined as top-level data nodes + from the YANG modules advertised by the server in + the 'ietf-yang-library' module."; + } + + container operations { + description + "Container for all operation resources. + + Each resource is represented as an empty leaf with the + name of the RPC operation from the YANG 'rpc' statement. + + For example, the 'system-restart' RPC operation defined + in the 'ietf-system' module would be represented as + an empty leaf in the 'ietf-system' namespace. This is + a conceptual leaf and will not actually be found in + the module: + + module ietf-system { + leaf system-reset { + type empty; + } + } + + To invoke the 'system-restart' RPC operation: + + POST /restconf/operations/ietf-system:system-restart + + To discover the RPC operations supported by the server: + + GET /restconf/operations + + In XML, the YANG module namespace identifies the module: + + <system-restart + xmlns='urn:ietf:params:xml:ns:yang:ietf-system'/> + + In JSON, the YANG module name identifies the module: + + { 'ietf-system:system-restart' : [null] } + "; + } + leaf yang-library-version { + type string { + pattern '\d{4}-\d{2}-\d{2}'; + } + config false; + mandatory true; + description + "Identifies the revision date of the 'ietf-yang-library' + module that is implemented by this RESTCONF server. + Indicates the year, month, and day in YYYY-MM-DD + numeric format."; + } + } + } + +} diff --git a/yang/ietf-yang-types.yang b/yang/ietf-yang-types.yang new file mode 100644 index 0000000000000000000000000000000000000000..ee58fa3ab0042120d5607b8713d21fa0ba845895 --- /dev/null +++ b/yang/ietf-yang-types.yang @@ -0,0 +1,474 @@ +module ietf-yang-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types"; + prefix "yang"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + WG Chair: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de> + + Editor: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de>"; + + description + "This module contains a collection of generally useful derived + YANG data types. + + Copyright (c) 2013 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6991; see + the RFC itself for full legal notices."; + + revision 2013-07-15 { + description + "This revision adds the following new data types: + - yang-identifier + - hex-string + - uuid + - dotted-quad"; + reference + "RFC 6991: Common YANG Data Types"; + } + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of counter and gauge types ***/ + + typedef counter32 { + type uint32; + description + "The counter32 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter32 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter32 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter32. + + In the value set and its semantics, this type is equivalent + to the Counter32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef zero-based-counter32 { + type yang:counter32; + default "0"; + description + "The zero-based-counter32 type represents a counter32 + that has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter32 textual convention of the SMIv2."; + reference + "RFC 4502: Remote Network Monitoring Management Information + Base Version 2"; + } + + typedef counter64 { + type uint64; + description + "The counter64 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter64 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter64 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter64. + + In the value set and its semantics, this type is equivalent + to the Counter64 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef zero-based-counter64 { + type yang:counter64; + default "0"; + description + "The zero-based-counter64 type represents a counter64 that + has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter64 textual convention of the SMIv2."; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + typedef gauge32 { + type uint32; + description + "The gauge32 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^32-1 (4294967295 decimal), and + the minimum value cannot be smaller than 0. The value of + a gauge32 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge32 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the Gauge32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef gauge64 { + type uint64; + description + "The gauge64 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^64-1 (18446744073709551615), and + the minimum value cannot be smaller than 0. The value of + a gauge64 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge64 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the CounterBasedGauge64 SMIv2 textual convention defined + in RFC 2856"; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + /*** collection of identifier-related types ***/ + + typedef object-identifier { + type string { + pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))' + + '(\.(0|([1-9]\d*)))*'; + } + description + "The object-identifier type represents administratively + assigned names in a registration-hierarchical-name tree. + + Values of this type are denoted as a sequence of numerical + non-negative sub-identifier values. Each sub-identifier + value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers + are separated by single dots and without any intermediate + whitespace. + + The ASN.1 standard restricts the value space of the first + sub-identifier to 0, 1, or 2. Furthermore, the value space + of the second sub-identifier is restricted to the range + 0 to 39 if the first sub-identifier is 0 or 1. Finally, + the ASN.1 standard requires that an object identifier + has always at least two sub-identifiers. The pattern + captures these restrictions. + + Although the number of sub-identifiers is not limited, + module designers should realize that there may be + implementations that stick with the SMIv2 limit of 128 + sub-identifiers. + + This type is a superset of the SMIv2 OBJECT IDENTIFIER type + since it is not restricted to 128 sub-identifiers. Hence, + this type SHOULD NOT be used to represent the SMIv2 OBJECT + IDENTIFIER type; the object-identifier-128 type SHOULD be + used instead."; + reference + "ISO9834-1: Information technology -- Open Systems + Interconnection -- Procedures for the operation of OSI + Registration Authorities: General procedures and top + arcs of the ASN.1 Object Identifier tree"; + } + + typedef object-identifier-128 { + type object-identifier { + pattern '\d*(\.\d*){1,127}'; + } + description + "This type represents object-identifiers restricted to 128 + sub-identifiers. + + In the value set and its semantics, this type is equivalent + to the OBJECT IDENTIFIER type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef yang-identifier { + type string { + length "1..max"; + pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'; + pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*'; + } + description + "A YANG identifier string as defined by the 'identifier' + rule in Section 12 of RFC 6020. An identifier must + start with an alphabetic character or an underscore + followed by an arbitrary sequence of alphabetic or + numeric characters, underscores, hyphens, or dots. + + A YANG identifier MUST NOT start with any possible + combination of the lowercase or uppercase character + sequence 'xml'."; + reference + "RFC 6020: YANG - A Data Modeling Language for the Network + Configuration Protocol (NETCONF)"; + } + + /*** collection of types related to date and time***/ + + typedef date-and-time { + type string { + pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?' + + '(Z|[\+\-]\d{2}:\d{2})'; + } + description + "The date-and-time type is a profile of the ISO 8601 + standard for representation of dates and times using the + Gregorian calendar. The profile is defined by the + date-time production in Section 5.6 of RFC 3339. + + The date-and-time type is compatible with the dateTime XML + schema type with the following notable exceptions: + + (a) The date-and-time type does not allow negative years. + + (b) The date-and-time time-offset -00:00 indicates an unknown + time zone (see RFC 3339) while -00:00 and +00:00 and Z + all represent the same time zone in dateTime. + + (c) The canonical format (see below) of data-and-time values + differs from the canonical format used by the dateTime XML + schema type, which requires all times to be in UTC using + the time-offset 'Z'. + + This type is not equivalent to the DateAndTime textual + convention of the SMIv2 since RFC 3339 uses a different + separator between full-date and full-time and provides + higher resolution of time-secfrac. + + The canonical format for date-and-time values with a known time + zone uses a numeric time zone offset that is calculated using + the device's configured known offset to UTC time. A change of + the device's offset to UTC time will cause date-and-time values + to change accordingly. Such changes might happen periodically + in case a server follows automatically daylight saving time + (DST) time zone offset changes. The canonical format for + date-and-time values with an unknown time zone (usually + referring to the notion of local time) uses the time-offset + -00:00."; + reference + "RFC 3339: Date and Time on the Internet: Timestamps + RFC 2579: Textual Conventions for SMIv2 + XSD-TYPES: XML Schema Part 2: Datatypes Second Edition"; + } + + typedef timeticks { + type uint32; + description + "The timeticks type represents a non-negative integer that + represents the time, modulo 2^32 (4294967296 decimal), in + hundredths of a second between two epochs. When a schema + node is defined that uses this type, the description of + the schema node identifies both of the reference epochs. + + In the value set and its semantics, this type is equivalent + to the TimeTicks type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef timestamp { + type yang:timeticks; + description + "The timestamp type represents the value of an associated + timeticks schema node at which a specific occurrence + happened. The specific occurrence must be defined in the + description of any schema node defined using this type. When + the specific occurrence occurred prior to the last time the + associated timeticks attribute was zero, then the timestamp + value is zero. Note that this requires all timestamp values + to be reset to zero when the value of the associated timeticks + attribute reaches 497+ days and wraps around to zero. + + The associated timeticks schema node must be specified + in the description of any schema node using this type. + + In the value set and its semantics, this type is equivalent + to the TimeStamp textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of generic address types ***/ + + typedef phys-address { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + + description + "Represents media- or physical-level addresses represented + as a sequence octets, each octet represented by two hexadecimal + numbers. Octets are separated by colons. The canonical + representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the PhysAddress textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + typedef mac-address { + type string { + pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'; + } + description + "The mac-address type represents an IEEE 802 MAC address. + The canonical representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the MacAddress textual convention of the SMIv2."; + reference + "IEEE 802: IEEE Standard for Local and Metropolitan Area + Networks: Overview and Architecture + RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of XML-specific types ***/ + + typedef xpath1.0 { + type string; + description + "This type represents an XPATH 1.0 expression. + + When a schema node is defined that uses this type, the + description of the schema node MUST specify the XPath + context in which the XPath expression is evaluated."; + reference + "XPATH: XML Path Language (XPath) Version 1.0"; + } + + /*** collection of string types ***/ + + typedef hex-string { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + description + "A hexadecimal string with octets represented as hex digits + separated by colons. The canonical representation uses + lowercase characters."; + } + + typedef uuid { + type string { + pattern '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12}'; + } + description + "A Universally Unique IDentifier in the string representation + defined in RFC 4122. The canonical representation uses + lowercase characters. + + The following is an example of a UUID in string representation: + f81d4fae-7dec-11d0-a765-00a0c91e6bf6 + "; + reference + "RFC 4122: A Universally Unique IDentifier (UUID) URN + Namespace"; + } + + typedef dotted-quad { + type string { + pattern + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}' + + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'; + } + description + "An unsigned 32-bit number expressed in the dotted-quad + notation, i.e., four octets written as decimal numbers + and separated with the '.' (full stop) character."; + } +}