-
Notifications
You must be signed in to change notification settings - Fork 10
/
remote_access_specification.go
91 lines (72 loc) · 3.26 KB
/
remote_access_specification.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// 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 (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// RemoteAccessSpecification Represents a specification for machine's remote access settings.
//
// swagger:model RemoteAccessSpecification
type RemoteAccessSpecification struct {
// One of four authentication types.
// `generatedPublicPrivateKey`: The provisioned machine generates the public/private key pair and enables SSH to use them without user input.
// `publicPrivateKey`: The user enters the private key in the SSH command. See remoteAccess.sshKey.
// `usernamePassword`: The user enters a username and password for remote access.
// `keyPairName`: The user enters an already existing keyPair name. See remoteAccess.keyPair
// Example: publicPrivateKey
// Required: true
Authentication *string `json:"authentication"`
// Key Pair Name.
KeyPair string `json:"keyPair,omitempty"`
// Remote access password for the Azure machine.
Password string `json:"password,omitempty"`
// In key pair authentication, the public key on the provisioned machine. Users are expected to log in with their private key and a default username from the cloud provider. An AWS Ubuntu image comes with default user ubuntu, and Azure comes with default user azureuser. To log in by SSH:
// `ssh -i <private-key-path> ubuntu@52.90.80.153`
// `ssh -i <private-key-path> azureuser@40.76.14.255`
// Example: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCu74dLkAGGYIgNuszEAM0HaS2Y6boTPw+HqsFmtPSOpxPQoosws/OWGZlW1uue6Y4lIvdRqZOaLK+2di5512etY67ZwFHc5h1kx4az433DsnoZhIzXEKKI+EXfH/w72CIyG/uVhIzmA4FvRVQKXinE1vaVen6v1CBQEZibx9RXrVRP1VRibsKFRXYxywNEl1VtPK7KaxCEYO9IXi4SKVulSAhOVequwjlo5E8bKNT61/g/YyMvwCbaTTPPeCpS/7i+JHYY3QZ8fQY/Syn+bOFpKCCHl+7VpsL8gjWe6fI4bUp6KUiW7ZkQpL/47rxawKnRMKKEU9P0ICp3RRB39lXT
SSHKey string `json:"sshKey,omitempty"`
// Remote access username for the Azure machine.
Username string `json:"username,omitempty"`
}
// Validate validates this remote access specification
func (m *RemoteAccessSpecification) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAuthentication(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *RemoteAccessSpecification) validateAuthentication(formats strfmt.Registry) error {
if err := validate.Required("authentication", "body", m.Authentication); err != nil {
return err
}
return nil
}
// ContextValidate validates this remote access specification based on context it is used
func (m *RemoteAccessSpecification) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *RemoteAccessSpecification) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *RemoteAccessSpecification) UnmarshalBinary(b []byte) error {
var res RemoteAccessSpecification
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}