You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
package compute
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// ChangeMACRequest struct to change MAC for network
type ChangeMACRequest struct {
// ID of compute instance
// Required: true
ComputeID uint64 ` url:"compute_id" json:"compute_id" validate:"required" `
// Current mac address
// Required: true
С urrentMAC string ` url:"current_mac_address" json:"current_mac_address" validate:"required" `
// the MAC address to which we will change the existing one
// Required: true
NewMAC string ` url:"new_mac_address" json:"new_mac_address" validate:"required" `
}
// ChangeMAC change MAC for compute instance
func ( c Compute ) ChangeMAC ( ctx context . Context , req ChangeMACRequest ) ( bool , error ) {
err := validators . ValidateRequest ( req )
if err != nil {
return false , validators . ValidationErrors ( validators . GetErrors ( err ) )
}
url := "/cloudbroker/compute/changeMac"
res , err := c . client . DecortApiCall ( ctx , http . MethodPost , url , req )
if err != nil {
return false , err
}
result , err := strconv . ParseBool ( string ( res ) )
if err != nil {
return false , err
}
return result , nil
}