repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
partition
stringclasses
1 value
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewDeleteNetscalerLoadBalancerParams
func (s *LoadBalancerService) NewDeleteNetscalerLoadBalancerParams(lbdeviceid string) *DeleteNetscalerLoadBalancerParams { p := &DeleteNetscalerLoadBalancerParams{} p.p = make(map[string]interface{}) p.p["lbdeviceid"] = lbdeviceid return p }
go
func (s *LoadBalancerService) NewDeleteNetscalerLoadBalancerParams(lbdeviceid string) *DeleteNetscalerLoadBalancerParams { p := &DeleteNetscalerLoadBalancerParams{} p.p = make(map[string]interface{}) p.p["lbdeviceid"] = lbdeviceid return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewDeleteNetscalerLoadBalancerParams", "(", "lbdeviceid", "string", ")", "*", "DeleteNetscalerLoadBalancerParams", "{", "p", ":=", "&", "DeleteNetscalerLoadBalancerParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "lbdeviceid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteNetscalerLoadBalancerParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteNetscalerLoadBalancerParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L1955-L1960
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
DeleteNetscalerLoadBalancer
func (s *LoadBalancerService) DeleteNetscalerLoadBalancer(p *DeleteNetscalerLoadBalancerParams) (*DeleteNetscalerLoadBalancerResponse, error) { resp, err := s.cs.newRequest("deleteNetscalerLoadBalancer", p.toURLValues()) if err != nil { return nil, err } var r DeleteNetscalerLoadBalancerResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *LoadBalancerService) DeleteNetscalerLoadBalancer(p *DeleteNetscalerLoadBalancerParams) (*DeleteNetscalerLoadBalancerResponse, error) { resp, err := s.cs.newRequest("deleteNetscalerLoadBalancer", p.toURLValues()) if err != nil { return nil, err } var r DeleteNetscalerLoadBalancerResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "DeleteNetscalerLoadBalancer", "(", "p", "*", "DeleteNetscalerLoadBalancerParams", ")", "(", "*", "DeleteNetscalerLoadBalancerResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "DeleteNetscalerLoadBalancerResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// delete a netscaler load balancer device
[ "delete", "a", "netscaler", "load", "balancer", "device" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L1963-L1990
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewDeleteSslCertParams
func (s *LoadBalancerService) NewDeleteSslCertParams(id string) *DeleteSslCertParams { p := &DeleteSslCertParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *LoadBalancerService) NewDeleteSslCertParams(id string) *DeleteSslCertParams { p := &DeleteSslCertParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewDeleteSslCertParams", "(", "id", "string", ")", "*", "DeleteSslCertParams", "{", "p", ":=", "&", "DeleteSslCertParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteSslCertParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteSslCertParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L2023-L2028
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
DeleteSslCert
func (s *LoadBalancerService) DeleteSslCert(p *DeleteSslCertParams) (*DeleteSslCertResponse, error) { resp, err := s.cs.newRequest("deleteSslCert", p.toURLValues()) if err != nil { return nil, err } var r DeleteSslCertResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *LoadBalancerService) DeleteSslCert(p *DeleteSslCertParams) (*DeleteSslCertResponse, error) { resp, err := s.cs.newRequest("deleteSslCert", p.toURLValues()) if err != nil { return nil, err } var r DeleteSslCertResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "DeleteSslCert", "(", "p", "*", "DeleteSslCertParams", ")", "(", "*", "DeleteSslCertResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "DeleteSslCertResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Delete a certificate to CloudStack
[ "Delete", "a", "certificate", "to", "CloudStack" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L2031-L2043
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewListGlobalLoadBalancerRulesParams
func (s *LoadBalancerService) NewListGlobalLoadBalancerRulesParams() *ListGlobalLoadBalancerRulesParams { p := &ListGlobalLoadBalancerRulesParams{} p.p = make(map[string]interface{}) return p }
go
func (s *LoadBalancerService) NewListGlobalLoadBalancerRulesParams() *ListGlobalLoadBalancerRulesParams { p := &ListGlobalLoadBalancerRulesParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewListGlobalLoadBalancerRulesParams", "(", ")", "*", "ListGlobalLoadBalancerRulesParams", "{", "p", ":=", "&", "ListGlobalLoadBalancerRulesParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListGlobalLoadBalancerRulesParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListGlobalLoadBalancerRulesParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L2214-L2218
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewListLBHealthCheckPoliciesParams
func (s *LoadBalancerService) NewListLBHealthCheckPoliciesParams() *ListLBHealthCheckPoliciesParams { p := &ListLBHealthCheckPoliciesParams{} p.p = make(map[string]interface{}) return p }
go
func (s *LoadBalancerService) NewListLBHealthCheckPoliciesParams() *ListLBHealthCheckPoliciesParams { p := &ListLBHealthCheckPoliciesParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewListLBHealthCheckPoliciesParams", "(", ")", "*", "ListLBHealthCheckPoliciesParams", "{", "p", ":=", "&", "ListLBHealthCheckPoliciesParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListLBHealthCheckPoliciesParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListLBHealthCheckPoliciesParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L2447-L2451
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
ListLBHealthCheckPolicies
func (s *LoadBalancerService) ListLBHealthCheckPolicies(p *ListLBHealthCheckPoliciesParams) (*ListLBHealthCheckPoliciesResponse, error) { resp, err := s.cs.newRequest("listLBHealthCheckPolicies", p.toURLValues()) if err != nil { return nil, err } var r ListLBHealthCheckPoliciesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *LoadBalancerService) ListLBHealthCheckPolicies(p *ListLBHealthCheckPoliciesParams) (*ListLBHealthCheckPoliciesResponse, error) { resp, err := s.cs.newRequest("listLBHealthCheckPolicies", p.toURLValues()) if err != nil { return nil, err } var r ListLBHealthCheckPoliciesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "ListLBHealthCheckPolicies", "(", "p", "*", "ListLBHealthCheckPoliciesParams", ")", "(", "*", "ListLBHealthCheckPoliciesResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListLBHealthCheckPoliciesResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Lists load balancer health check policies.
[ "Lists", "load", "balancer", "health", "check", "policies", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L2487-L2499
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewListLBStickinessPoliciesParams
func (s *LoadBalancerService) NewListLBStickinessPoliciesParams() *ListLBStickinessPoliciesParams { p := &ListLBStickinessPoliciesParams{} p.p = make(map[string]interface{}) return p }
go
func (s *LoadBalancerService) NewListLBStickinessPoliciesParams() *ListLBStickinessPoliciesParams { p := &ListLBStickinessPoliciesParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewListLBStickinessPoliciesParams", "(", ")", "*", "ListLBStickinessPoliciesParams", "{", "p", ":=", "&", "ListLBStickinessPoliciesParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListLBStickinessPoliciesParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListLBStickinessPoliciesParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L2610-L2614
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
ListLBStickinessPolicies
func (s *LoadBalancerService) ListLBStickinessPolicies(p *ListLBStickinessPoliciesParams) (*ListLBStickinessPoliciesResponse, error) { resp, err := s.cs.newRequest("listLBStickinessPolicies", p.toURLValues()) if err != nil { return nil, err } var r ListLBStickinessPoliciesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *LoadBalancerService) ListLBStickinessPolicies(p *ListLBStickinessPoliciesParams) (*ListLBStickinessPoliciesResponse, error) { resp, err := s.cs.newRequest("listLBStickinessPolicies", p.toURLValues()) if err != nil { return nil, err } var r ListLBStickinessPoliciesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "ListLBStickinessPolicies", "(", "p", "*", "ListLBStickinessPoliciesParams", ")", "(", "*", "ListLBStickinessPoliciesResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListLBStickinessPoliciesResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Lists load balancer stickiness policies.
[ "Lists", "load", "balancer", "stickiness", "policies", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L2650-L2662
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewListLoadBalancerRuleInstancesParams
func (s *LoadBalancerService) NewListLoadBalancerRuleInstancesParams(id string) *ListLoadBalancerRuleInstancesParams { p := &ListLoadBalancerRuleInstancesParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *LoadBalancerService) NewListLoadBalancerRuleInstancesParams(id string) *ListLoadBalancerRuleInstancesParams { p := &ListLoadBalancerRuleInstancesParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewListLoadBalancerRuleInstancesParams", "(", "id", "string", ")", "*", "ListLoadBalancerRuleInstancesParams", "{", "p", ":=", "&", "ListLoadBalancerRuleInstancesParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListLoadBalancerRuleInstancesParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListLoadBalancerRuleInstancesParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L2775-L2780
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewListLoadBalancerRulesParams
func (s *LoadBalancerService) NewListLoadBalancerRulesParams() *ListLoadBalancerRulesParams { p := &ListLoadBalancerRulesParams{} p.p = make(map[string]interface{}) return p }
go
func (s *LoadBalancerService) NewListLoadBalancerRulesParams() *ListLoadBalancerRulesParams { p := &ListLoadBalancerRulesParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewListLoadBalancerRulesParams", "(", ")", "*", "ListLoadBalancerRulesParams", "{", "p", ":=", "&", "ListLoadBalancerRulesParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListLoadBalancerRulesParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListLoadBalancerRulesParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L3041-L3045
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewListLoadBalancersParams
func (s *LoadBalancerService) NewListLoadBalancersParams() *ListLoadBalancersParams { p := &ListLoadBalancersParams{} p.p = make(map[string]interface{}) return p }
go
func (s *LoadBalancerService) NewListLoadBalancersParams() *ListLoadBalancersParams { p := &ListLoadBalancersParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewListLoadBalancersParams", "(", ")", "*", "ListLoadBalancersParams", "{", "p", ":=", "&", "ListLoadBalancersParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListLoadBalancersParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListLoadBalancersParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L3374-L3378
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
ListLoadBalancers
func (s *LoadBalancerService) ListLoadBalancers(p *ListLoadBalancersParams) (*ListLoadBalancersResponse, error) { resp, err := s.cs.newRequest("listLoadBalancers", p.toURLValues()) if err != nil { return nil, err } var r ListLoadBalancersResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *LoadBalancerService) ListLoadBalancers(p *ListLoadBalancersParams) (*ListLoadBalancersResponse, error) { resp, err := s.cs.newRequest("listLoadBalancers", p.toURLValues()) if err != nil { return nil, err } var r ListLoadBalancersResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "ListLoadBalancers", "(", "p", "*", "ListLoadBalancersParams", ")", "(", "*", "ListLoadBalancersResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListLoadBalancersResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Lists load balancers
[ "Lists", "load", "balancers" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L3464-L3476
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewListNetscalerLoadBalancersParams
func (s *LoadBalancerService) NewListNetscalerLoadBalancersParams() *ListNetscalerLoadBalancersParams { p := &ListNetscalerLoadBalancersParams{} p.p = make(map[string]interface{}) return p }
go
func (s *LoadBalancerService) NewListNetscalerLoadBalancersParams() *ListNetscalerLoadBalancersParams { p := &ListNetscalerLoadBalancersParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewListNetscalerLoadBalancersParams", "(", ")", "*", "ListNetscalerLoadBalancersParams", "{", "p", ":=", "&", "ListNetscalerLoadBalancersParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListNetscalerLoadBalancersParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListNetscalerLoadBalancersParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L3586-L3590
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
ListNetscalerLoadBalancers
func (s *LoadBalancerService) ListNetscalerLoadBalancers(p *ListNetscalerLoadBalancersParams) (*ListNetscalerLoadBalancersResponse, error) { resp, err := s.cs.newRequest("listNetscalerLoadBalancers", p.toURLValues()) if err != nil { return nil, err } var r ListNetscalerLoadBalancersResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *LoadBalancerService) ListNetscalerLoadBalancers(p *ListNetscalerLoadBalancersParams) (*ListNetscalerLoadBalancersResponse, error) { resp, err := s.cs.newRequest("listNetscalerLoadBalancers", p.toURLValues()) if err != nil { return nil, err } var r ListNetscalerLoadBalancersResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "ListNetscalerLoadBalancers", "(", "p", "*", "ListNetscalerLoadBalancersParams", ")", "(", "*", "ListNetscalerLoadBalancersResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListNetscalerLoadBalancersResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// lists netscaler load balancer devices
[ "lists", "netscaler", "load", "balancer", "devices" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L3593-L3605
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewListSslCertsParams
func (s *LoadBalancerService) NewListSslCertsParams() *ListSslCertsParams { p := &ListSslCertsParams{} p.p = make(map[string]interface{}) return p }
go
func (s *LoadBalancerService) NewListSslCertsParams() *ListSslCertsParams { p := &ListSslCertsParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewListSslCertsParams", "(", ")", "*", "ListSslCertsParams", "{", "p", ":=", "&", "ListSslCertsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListSslCertsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListSslCertsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L3688-L3692
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
ListSslCerts
func (s *LoadBalancerService) ListSslCerts(p *ListSslCertsParams) (*ListSslCertsResponse, error) { resp, err := s.cs.newRequest("listSslCerts", p.toURLValues()) if err != nil { return nil, err } var r ListSslCertsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *LoadBalancerService) ListSslCerts(p *ListSslCertsParams) (*ListSslCertsResponse, error) { resp, err := s.cs.newRequest("listSslCerts", p.toURLValues()) if err != nil { return nil, err } var r ListSslCertsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "ListSslCerts", "(", "p", "*", "ListSslCertsParams", ")", "(", "*", "ListSslCertsResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListSslCertsResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Lists SSL certificates
[ "Lists", "SSL", "certificates" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L3695-L3707
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewRemoveCertFromLoadBalancerParams
func (s *LoadBalancerService) NewRemoveCertFromLoadBalancerParams(lbruleid string) *RemoveCertFromLoadBalancerParams { p := &RemoveCertFromLoadBalancerParams{} p.p = make(map[string]interface{}) p.p["lbruleid"] = lbruleid return p }
go
func (s *LoadBalancerService) NewRemoveCertFromLoadBalancerParams(lbruleid string) *RemoveCertFromLoadBalancerParams { p := &RemoveCertFromLoadBalancerParams{} p.p = make(map[string]interface{}) p.p["lbruleid"] = lbruleid return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewRemoveCertFromLoadBalancerParams", "(", "lbruleid", "string", ")", "*", "RemoveCertFromLoadBalancerParams", "{", "p", ":=", "&", "RemoveCertFromLoadBalancerParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "lbruleid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new RemoveCertFromLoadBalancerParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "RemoveCertFromLoadBalancerParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L3753-L3758
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
RemoveCertFromLoadBalancer
func (s *LoadBalancerService) RemoveCertFromLoadBalancer(p *RemoveCertFromLoadBalancerParams) (*RemoveCertFromLoadBalancerResponse, error) { resp, err := s.cs.newRequest("removeCertFromLoadBalancer", p.toURLValues()) if err != nil { return nil, err } var r RemoveCertFromLoadBalancerResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *LoadBalancerService) RemoveCertFromLoadBalancer(p *RemoveCertFromLoadBalancerParams) (*RemoveCertFromLoadBalancerResponse, error) { resp, err := s.cs.newRequest("removeCertFromLoadBalancer", p.toURLValues()) if err != nil { return nil, err } var r RemoveCertFromLoadBalancerResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "RemoveCertFromLoadBalancer", "(", "p", "*", "RemoveCertFromLoadBalancerParams", ")", "(", "*", "RemoveCertFromLoadBalancerResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "RemoveCertFromLoadBalancerResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Removes a certificate from a load balancer rule
[ "Removes", "a", "certificate", "from", "a", "load", "balancer", "rule" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L3761-L3788
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewRemoveFromGlobalLoadBalancerRuleParams
func (s *LoadBalancerService) NewRemoveFromGlobalLoadBalancerRuleParams(id string, loadbalancerrulelist []string) *RemoveFromGlobalLoadBalancerRuleParams { p := &RemoveFromGlobalLoadBalancerRuleParams{} p.p = make(map[string]interface{}) p.p["id"] = id p.p["loadbalancerrulelist"] = loadbalancerrulelist return p }
go
func (s *LoadBalancerService) NewRemoveFromGlobalLoadBalancerRuleParams(id string, loadbalancerrulelist []string) *RemoveFromGlobalLoadBalancerRuleParams { p := &RemoveFromGlobalLoadBalancerRuleParams{} p.p = make(map[string]interface{}) p.p["id"] = id p.p["loadbalancerrulelist"] = loadbalancerrulelist return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewRemoveFromGlobalLoadBalancerRuleParams", "(", "id", "string", ",", "loadbalancerrulelist", "[", "]", "string", ")", "*", "RemoveFromGlobalLoadBalancerRuleParams", "{", "p", ":=", "&", "RemoveFromGlobalLoadBalancerRuleParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "loadbalancerrulelist", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new RemoveFromGlobalLoadBalancerRuleParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "RemoveFromGlobalLoadBalancerRuleParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L3833-L3839
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
RemoveFromGlobalLoadBalancerRule
func (s *LoadBalancerService) RemoveFromGlobalLoadBalancerRule(p *RemoveFromGlobalLoadBalancerRuleParams) (*RemoveFromGlobalLoadBalancerRuleResponse, error) { resp, err := s.cs.newRequest("removeFromGlobalLoadBalancerRule", p.toURLValues()) if err != nil { return nil, err } var r RemoveFromGlobalLoadBalancerRuleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *LoadBalancerService) RemoveFromGlobalLoadBalancerRule(p *RemoveFromGlobalLoadBalancerRuleParams) (*RemoveFromGlobalLoadBalancerRuleResponse, error) { resp, err := s.cs.newRequest("removeFromGlobalLoadBalancerRule", p.toURLValues()) if err != nil { return nil, err } var r RemoveFromGlobalLoadBalancerRuleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "RemoveFromGlobalLoadBalancerRule", "(", "p", "*", "RemoveFromGlobalLoadBalancerRuleParams", ")", "(", "*", "RemoveFromGlobalLoadBalancerRuleResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "RemoveFromGlobalLoadBalancerRuleResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Removes a load balancer rule association with global load balancer rule
[ "Removes", "a", "load", "balancer", "rule", "association", "with", "global", "load", "balancer", "rule" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L3842-L3869
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewRemoveFromLoadBalancerRuleParams
func (s *LoadBalancerService) NewRemoveFromLoadBalancerRuleParams(id string) *RemoveFromLoadBalancerRuleParams { p := &RemoveFromLoadBalancerRuleParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *LoadBalancerService) NewRemoveFromLoadBalancerRuleParams(id string) *RemoveFromLoadBalancerRuleParams { p := &RemoveFromLoadBalancerRuleParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewRemoveFromLoadBalancerRuleParams", "(", "id", "string", ")", "*", "RemoveFromLoadBalancerRuleParams", "{", "p", ":=", "&", "RemoveFromLoadBalancerRuleParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new RemoveFromLoadBalancerRuleParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "RemoveFromLoadBalancerRuleParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L3930-L3935
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewUpdateGlobalLoadBalancerRuleParams
func (s *LoadBalancerService) NewUpdateGlobalLoadBalancerRuleParams(id string) *UpdateGlobalLoadBalancerRuleParams { p := &UpdateGlobalLoadBalancerRuleParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *LoadBalancerService) NewUpdateGlobalLoadBalancerRuleParams(id string) *UpdateGlobalLoadBalancerRuleParams { p := &UpdateGlobalLoadBalancerRuleParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewUpdateGlobalLoadBalancerRuleParams", "(", "id", "string", ")", "*", "UpdateGlobalLoadBalancerRuleParams", "{", "p", ":=", "&", "UpdateGlobalLoadBalancerRuleParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new UpdateGlobalLoadBalancerRuleParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "UpdateGlobalLoadBalancerRuleParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L4031-L4036
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
UpdateGlobalLoadBalancerRule
func (s *LoadBalancerService) UpdateGlobalLoadBalancerRule(p *UpdateGlobalLoadBalancerRuleParams) (*UpdateGlobalLoadBalancerRuleResponse, error) { resp, err := s.cs.newRequest("updateGlobalLoadBalancerRule", p.toURLValues()) if err != nil { return nil, err } var r UpdateGlobalLoadBalancerRuleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *LoadBalancerService) UpdateGlobalLoadBalancerRule(p *UpdateGlobalLoadBalancerRuleParams) (*UpdateGlobalLoadBalancerRuleResponse, error) { resp, err := s.cs.newRequest("updateGlobalLoadBalancerRule", p.toURLValues()) if err != nil { return nil, err } var r UpdateGlobalLoadBalancerRuleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "UpdateGlobalLoadBalancerRule", "(", "p", "*", "UpdateGlobalLoadBalancerRuleParams", ")", "(", "*", "UpdateGlobalLoadBalancerRuleResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "UpdateGlobalLoadBalancerRuleResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "b", ",", "err", "=", "getRawValue", "(", "b", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// update global load balancer rules.
[ "update", "global", "load", "balancer", "rules", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L4039-L4071
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewUpdateLBHealthCheckPolicyParams
func (s *LoadBalancerService) NewUpdateLBHealthCheckPolicyParams(id string) *UpdateLBHealthCheckPolicyParams { p := &UpdateLBHealthCheckPolicyParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *LoadBalancerService) NewUpdateLBHealthCheckPolicyParams(id string) *UpdateLBHealthCheckPolicyParams { p := &UpdateLBHealthCheckPolicyParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewUpdateLBHealthCheckPolicyParams", "(", "id", "string", ")", "*", "UpdateLBHealthCheckPolicyParams", "{", "p", ":=", "&", "UpdateLBHealthCheckPolicyParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new UpdateLBHealthCheckPolicyParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "UpdateLBHealthCheckPolicyParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L4163-L4168
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
UpdateLBHealthCheckPolicy
func (s *LoadBalancerService) UpdateLBHealthCheckPolicy(p *UpdateLBHealthCheckPolicyParams) (*UpdateLBHealthCheckPolicyResponse, error) { resp, err := s.cs.newRequest("updateLBHealthCheckPolicy", p.toURLValues()) if err != nil { return nil, err } var r UpdateLBHealthCheckPolicyResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *LoadBalancerService) UpdateLBHealthCheckPolicy(p *UpdateLBHealthCheckPolicyParams) (*UpdateLBHealthCheckPolicyResponse, error) { resp, err := s.cs.newRequest("updateLBHealthCheckPolicy", p.toURLValues()) if err != nil { return nil, err } var r UpdateLBHealthCheckPolicyResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "UpdateLBHealthCheckPolicy", "(", "p", "*", "UpdateLBHealthCheckPolicyParams", ")", "(", "*", "UpdateLBHealthCheckPolicyResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "UpdateLBHealthCheckPolicyResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "b", ",", "err", "=", "getRawValue", "(", "b", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Updates load balancer health check policy
[ "Updates", "load", "balancer", "health", "check", "policy" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L4171-L4203
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewUpdateLBStickinessPolicyParams
func (s *LoadBalancerService) NewUpdateLBStickinessPolicyParams(id string) *UpdateLBStickinessPolicyParams { p := &UpdateLBStickinessPolicyParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *LoadBalancerService) NewUpdateLBStickinessPolicyParams(id string) *UpdateLBStickinessPolicyParams { p := &UpdateLBStickinessPolicyParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewUpdateLBStickinessPolicyParams", "(", "id", "string", ")", "*", "UpdateLBStickinessPolicyParams", "{", "p", ":=", "&", "UpdateLBStickinessPolicyParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new UpdateLBStickinessPolicyParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "UpdateLBStickinessPolicyParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L4275-L4280
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
UpdateLBStickinessPolicy
func (s *LoadBalancerService) UpdateLBStickinessPolicy(p *UpdateLBStickinessPolicyParams) (*UpdateLBStickinessPolicyResponse, error) { resp, err := s.cs.newRequest("updateLBStickinessPolicy", p.toURLValues()) if err != nil { return nil, err } var r UpdateLBStickinessPolicyResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *LoadBalancerService) UpdateLBStickinessPolicy(p *UpdateLBStickinessPolicyParams) (*UpdateLBStickinessPolicyResponse, error) { resp, err := s.cs.newRequest("updateLBStickinessPolicy", p.toURLValues()) if err != nil { return nil, err } var r UpdateLBStickinessPolicyResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "UpdateLBStickinessPolicy", "(", "p", "*", "UpdateLBStickinessPolicyParams", ")", "(", "*", "UpdateLBStickinessPolicyResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "UpdateLBStickinessPolicyResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "b", ",", "err", "=", "getRawValue", "(", "b", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Updates load balancer stickiness policy
[ "Updates", "load", "balancer", "stickiness", "policy" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L4283-L4315
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewUpdateLoadBalancerParams
func (s *LoadBalancerService) NewUpdateLoadBalancerParams(id string) *UpdateLoadBalancerParams { p := &UpdateLoadBalancerParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *LoadBalancerService) NewUpdateLoadBalancerParams(id string) *UpdateLoadBalancerParams { p := &UpdateLoadBalancerParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewUpdateLoadBalancerParams", "(", "id", "string", ")", "*", "UpdateLoadBalancerParams", "{", "p", ":=", "&", "UpdateLoadBalancerParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new UpdateLoadBalancerParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "UpdateLoadBalancerParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L4388-L4393
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
UpdateLoadBalancer
func (s *LoadBalancerService) UpdateLoadBalancer(p *UpdateLoadBalancerParams) (*UpdateLoadBalancerResponse, error) { resp, err := s.cs.newRequest("updateLoadBalancer", p.toURLValues()) if err != nil { return nil, err } var r UpdateLoadBalancerResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *LoadBalancerService) UpdateLoadBalancer(p *UpdateLoadBalancerParams) (*UpdateLoadBalancerResponse, error) { resp, err := s.cs.newRequest("updateLoadBalancer", p.toURLValues()) if err != nil { return nil, err } var r UpdateLoadBalancerResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "UpdateLoadBalancer", "(", "p", "*", "UpdateLoadBalancerParams", ")", "(", "*", "UpdateLoadBalancerResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "UpdateLoadBalancerResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "b", ",", "err", "=", "getRawValue", "(", "b", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Updates a load balancer
[ "Updates", "a", "load", "balancer" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L4396-L4428
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewUpdateLoadBalancerRuleParams
func (s *LoadBalancerService) NewUpdateLoadBalancerRuleParams(id string) *UpdateLoadBalancerRuleParams { p := &UpdateLoadBalancerRuleParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *LoadBalancerService) NewUpdateLoadBalancerRuleParams(id string) *UpdateLoadBalancerRuleParams { p := &UpdateLoadBalancerRuleParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewUpdateLoadBalancerRuleParams", "(", "id", "string", ")", "*", "UpdateLoadBalancerRuleParams", "{", "p", ":=", "&", "UpdateLoadBalancerRuleParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new UpdateLoadBalancerRuleParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "UpdateLoadBalancerRuleParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L4555-L4560
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
NewUploadSslCertParams
func (s *LoadBalancerService) NewUploadSslCertParams(certificate string, name string, privatekey string) *UploadSslCertParams { p := &UploadSslCertParams{} p.p = make(map[string]interface{}) p.p["certificate"] = certificate p.p["name"] = name p.p["privatekey"] = privatekey return p }
go
func (s *LoadBalancerService) NewUploadSslCertParams(certificate string, name string, privatekey string) *UploadSslCertParams { p := &UploadSslCertParams{} p.p = make(map[string]interface{}) p.p["certificate"] = certificate p.p["name"] = name p.p["privatekey"] = privatekey return p }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "NewUploadSslCertParams", "(", "certificate", "string", ",", "name", "string", ",", "privatekey", "string", ")", "*", "UploadSslCertParams", "{", "p", ":=", "&", "UploadSslCertParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "certificate", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "name", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "privatekey", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new UploadSslCertParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "UploadSslCertParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L4724-L4731
train
xanzy/go-cloudstack
cloudstack/LoadBalancerService.go
UploadSslCert
func (s *LoadBalancerService) UploadSslCert(p *UploadSslCertParams) (*UploadSslCertResponse, error) { resp, err := s.cs.newRequest("uploadSslCert", p.toURLValues()) if err != nil { return nil, err } var r UploadSslCertResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *LoadBalancerService) UploadSslCert(p *UploadSslCertParams) (*UploadSslCertResponse, error) { resp, err := s.cs.newRequest("uploadSslCert", p.toURLValues()) if err != nil { return nil, err } var r UploadSslCertResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "LoadBalancerService", ")", "UploadSslCert", "(", "p", "*", "UploadSslCertParams", ")", "(", "*", "UploadSslCertResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "UploadSslCertResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Upload a certificate to CloudStack
[ "Upload", "a", "certificate", "to", "CloudStack" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/LoadBalancerService.go#L4734-L4746
train
xanzy/go-cloudstack
cloudstack/UCSService.go
NewAddUcsManagerParams
func (s *UCSService) NewAddUcsManagerParams(password string, url string, username string, zoneid string) *AddUcsManagerParams { p := &AddUcsManagerParams{} p.p = make(map[string]interface{}) p.p["password"] = password p.p["url"] = url p.p["username"] = username p.p["zoneid"] = zoneid return p }
go
func (s *UCSService) NewAddUcsManagerParams(password string, url string, username string, zoneid string) *AddUcsManagerParams { p := &AddUcsManagerParams{} p.p = make(map[string]interface{}) p.p["password"] = password p.p["url"] = url p.p["username"] = username p.p["zoneid"] = zoneid return p }
[ "func", "(", "s", "*", "UCSService", ")", "NewAddUcsManagerParams", "(", "password", "string", ",", "url", "string", ",", "username", "string", ",", "zoneid", "string", ")", "*", "AddUcsManagerParams", "{", "p", ":=", "&", "AddUcsManagerParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "password", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "url", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "username", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "zoneid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new AddUcsManagerParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "AddUcsManagerParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UCSService.go#L96-L104
train
xanzy/go-cloudstack
cloudstack/UCSService.go
AddUcsManager
func (s *UCSService) AddUcsManager(p *AddUcsManagerParams) (*AddUcsManagerResponse, error) { resp, err := s.cs.newRequest("addUcsManager", p.toURLValues()) if err != nil { return nil, err } var r AddUcsManagerResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *UCSService) AddUcsManager(p *AddUcsManagerParams) (*AddUcsManagerResponse, error) { resp, err := s.cs.newRequest("addUcsManager", p.toURLValues()) if err != nil { return nil, err } var r AddUcsManagerResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "UCSService", ")", "AddUcsManager", "(", "p", "*", "AddUcsManagerParams", ")", "(", "*", "AddUcsManagerResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "AddUcsManagerResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Adds a Ucs manager
[ "Adds", "a", "Ucs", "manager" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UCSService.go#L107-L119
train
xanzy/go-cloudstack
cloudstack/UCSService.go
NewAssociateUcsProfileToBladeParams
func (s *UCSService) NewAssociateUcsProfileToBladeParams(bladeid string, profiledn string, ucsmanagerid string) *AssociateUcsProfileToBladeParams { p := &AssociateUcsProfileToBladeParams{} p.p = make(map[string]interface{}) p.p["bladeid"] = bladeid p.p["profiledn"] = profiledn p.p["ucsmanagerid"] = ucsmanagerid return p }
go
func (s *UCSService) NewAssociateUcsProfileToBladeParams(bladeid string, profiledn string, ucsmanagerid string) *AssociateUcsProfileToBladeParams { p := &AssociateUcsProfileToBladeParams{} p.p = make(map[string]interface{}) p.p["bladeid"] = bladeid p.p["profiledn"] = profiledn p.p["ucsmanagerid"] = ucsmanagerid return p }
[ "func", "(", "s", "*", "UCSService", ")", "NewAssociateUcsProfileToBladeParams", "(", "bladeid", "string", ",", "profiledn", "string", ",", "ucsmanagerid", "string", ")", "*", "AssociateUcsProfileToBladeParams", "{", "p", ":=", "&", "AssociateUcsProfileToBladeParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "bladeid", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "profiledn", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "ucsmanagerid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new AssociateUcsProfileToBladeParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "AssociateUcsProfileToBladeParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UCSService.go#L175-L182
train
xanzy/go-cloudstack
cloudstack/UCSService.go
AssociateUcsProfileToBlade
func (s *UCSService) AssociateUcsProfileToBlade(p *AssociateUcsProfileToBladeParams) (*AssociateUcsProfileToBladeResponse, error) { resp, err := s.cs.newRequest("associateUcsProfileToBlade", p.toURLValues()) if err != nil { return nil, err } var r AssociateUcsProfileToBladeResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *UCSService) AssociateUcsProfileToBlade(p *AssociateUcsProfileToBladeParams) (*AssociateUcsProfileToBladeResponse, error) { resp, err := s.cs.newRequest("associateUcsProfileToBlade", p.toURLValues()) if err != nil { return nil, err } var r AssociateUcsProfileToBladeResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "UCSService", ")", "AssociateUcsProfileToBlade", "(", "p", "*", "AssociateUcsProfileToBladeParams", ")", "(", "*", "AssociateUcsProfileToBladeResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "AssociateUcsProfileToBladeResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "b", ",", "err", "=", "getRawValue", "(", "b", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// associate a profile to a blade
[ "associate", "a", "profile", "to", "a", "blade" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UCSService.go#L185-L217
train
xanzy/go-cloudstack
cloudstack/UCSService.go
NewDeleteUcsManagerParams
func (s *UCSService) NewDeleteUcsManagerParams(ucsmanagerid string) *DeleteUcsManagerParams { p := &DeleteUcsManagerParams{} p.p = make(map[string]interface{}) p.p["ucsmanagerid"] = ucsmanagerid return p }
go
func (s *UCSService) NewDeleteUcsManagerParams(ucsmanagerid string) *DeleteUcsManagerParams { p := &DeleteUcsManagerParams{} p.p = make(map[string]interface{}) p.p["ucsmanagerid"] = ucsmanagerid return p }
[ "func", "(", "s", "*", "UCSService", ")", "NewDeleteUcsManagerParams", "(", "ucsmanagerid", "string", ")", "*", "DeleteUcsManagerParams", "{", "p", ":=", "&", "DeleteUcsManagerParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "ucsmanagerid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteUcsManagerParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteUcsManagerParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UCSService.go#L253-L258
train
xanzy/go-cloudstack
cloudstack/UCSService.go
DeleteUcsManager
func (s *UCSService) DeleteUcsManager(p *DeleteUcsManagerParams) (*DeleteUcsManagerResponse, error) { resp, err := s.cs.newRequest("deleteUcsManager", p.toURLValues()) if err != nil { return nil, err } var r DeleteUcsManagerResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *UCSService) DeleteUcsManager(p *DeleteUcsManagerParams) (*DeleteUcsManagerResponse, error) { resp, err := s.cs.newRequest("deleteUcsManager", p.toURLValues()) if err != nil { return nil, err } var r DeleteUcsManagerResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "UCSService", ")", "DeleteUcsManager", "(", "p", "*", "DeleteUcsManagerParams", ")", "(", "*", "DeleteUcsManagerResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "DeleteUcsManagerResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Delete a Ucs manager
[ "Delete", "a", "Ucs", "manager" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UCSService.go#L261-L273
train
xanzy/go-cloudstack
cloudstack/UCSService.go
NewListUcsBladesParams
func (s *UCSService) NewListUcsBladesParams(ucsmanagerid string) *ListUcsBladesParams { p := &ListUcsBladesParams{} p.p = make(map[string]interface{}) p.p["ucsmanagerid"] = ucsmanagerid return p }
go
func (s *UCSService) NewListUcsBladesParams(ucsmanagerid string) *ListUcsBladesParams { p := &ListUcsBladesParams{} p.p = make(map[string]interface{}) p.p["ucsmanagerid"] = ucsmanagerid return p }
[ "func", "(", "s", "*", "UCSService", ")", "NewListUcsBladesParams", "(", "ucsmanagerid", "string", ")", "*", "ListUcsBladesParams", "{", "p", ":=", "&", "ListUcsBladesParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "ucsmanagerid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListUcsBladesParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListUcsBladesParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UCSService.go#L359-L364
train
xanzy/go-cloudstack
cloudstack/UCSService.go
ListUcsBlades
func (s *UCSService) ListUcsBlades(p *ListUcsBladesParams) (*ListUcsBladesResponse, error) { resp, err := s.cs.newRequest("listUcsBlades", p.toURLValues()) if err != nil { return nil, err } var r ListUcsBladesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *UCSService) ListUcsBlades(p *ListUcsBladesParams) (*ListUcsBladesResponse, error) { resp, err := s.cs.newRequest("listUcsBlades", p.toURLValues()) if err != nil { return nil, err } var r ListUcsBladesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "UCSService", ")", "ListUcsBlades", "(", "p", "*", "ListUcsBladesParams", ")", "(", "*", "ListUcsBladesResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListUcsBladesResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// List ucs blades
[ "List", "ucs", "blades" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UCSService.go#L367-L379
train
xanzy/go-cloudstack
cloudstack/UCSService.go
NewListUcsManagersParams
func (s *UCSService) NewListUcsManagersParams() *ListUcsManagersParams { p := &ListUcsManagersParams{} p.p = make(map[string]interface{}) return p }
go
func (s *UCSService) NewListUcsManagersParams() *ListUcsManagersParams { p := &ListUcsManagersParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "UCSService", ")", "NewListUcsManagersParams", "(", ")", "*", "ListUcsManagersParams", "{", "p", ":=", "&", "ListUcsManagersParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListUcsManagersParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListUcsManagersParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UCSService.go#L465-L469
train
xanzy/go-cloudstack
cloudstack/UCSService.go
ListUcsManagers
func (s *UCSService) ListUcsManagers(p *ListUcsManagersParams) (*ListUcsManagersResponse, error) { resp, err := s.cs.newRequest("listUcsManagers", p.toURLValues()) if err != nil { return nil, err } var r ListUcsManagersResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *UCSService) ListUcsManagers(p *ListUcsManagersParams) (*ListUcsManagersResponse, error) { resp, err := s.cs.newRequest("listUcsManagers", p.toURLValues()) if err != nil { return nil, err } var r ListUcsManagersResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "UCSService", ")", "ListUcsManagers", "(", "p", "*", "ListUcsManagersParams", ")", "(", "*", "ListUcsManagersResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListUcsManagersResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// List ucs manager
[ "List", "ucs", "manager" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UCSService.go#L555-L567
train
xanzy/go-cloudstack
cloudstack/UCSService.go
NewListUcsProfilesParams
func (s *UCSService) NewListUcsProfilesParams(ucsmanagerid string) *ListUcsProfilesParams { p := &ListUcsProfilesParams{} p.p = make(map[string]interface{}) p.p["ucsmanagerid"] = ucsmanagerid return p }
go
func (s *UCSService) NewListUcsProfilesParams(ucsmanagerid string) *ListUcsProfilesParams { p := &ListUcsProfilesParams{} p.p = make(map[string]interface{}) p.p["ucsmanagerid"] = ucsmanagerid return p }
[ "func", "(", "s", "*", "UCSService", ")", "NewListUcsProfilesParams", "(", "ucsmanagerid", "string", ")", "*", "ListUcsProfilesParams", "{", "p", ":=", "&", "ListUcsProfilesParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "ucsmanagerid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListUcsProfilesParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListUcsProfilesParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UCSService.go#L641-L646
train
xanzy/go-cloudstack
cloudstack/UCSService.go
ListUcsProfiles
func (s *UCSService) ListUcsProfiles(p *ListUcsProfilesParams) (*ListUcsProfilesResponse, error) { resp, err := s.cs.newRequest("listUcsProfiles", p.toURLValues()) if err != nil { return nil, err } var r ListUcsProfilesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *UCSService) ListUcsProfiles(p *ListUcsProfilesParams) (*ListUcsProfilesResponse, error) { resp, err := s.cs.newRequest("listUcsProfiles", p.toURLValues()) if err != nil { return nil, err } var r ListUcsProfilesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "UCSService", ")", "ListUcsProfiles", "(", "p", "*", "ListUcsProfilesParams", ")", "(", "*", "ListUcsProfilesResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListUcsProfilesResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// List profile in ucs manager
[ "List", "profile", "in", "ucs", "manager" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UCSService.go#L649-L661
train
xanzy/go-cloudstack
cloudstack/RegionService.go
NewAddRegionParams
func (s *RegionService) NewAddRegionParams(endpoint string, id int, name string) *AddRegionParams { p := &AddRegionParams{} p.p = make(map[string]interface{}) p.p["endpoint"] = endpoint p.p["id"] = id p.p["name"] = name return p }
go
func (s *RegionService) NewAddRegionParams(endpoint string, id int, name string) *AddRegionParams { p := &AddRegionParams{} p.p = make(map[string]interface{}) p.p["endpoint"] = endpoint p.p["id"] = id p.p["name"] = name return p }
[ "func", "(", "s", "*", "RegionService", ")", "NewAddRegionParams", "(", "endpoint", "string", ",", "id", "int", ",", "name", "string", ")", "*", "AddRegionParams", "{", "p", ":=", "&", "AddRegionParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "endpoint", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "name", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new AddRegionParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "AddRegionParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RegionService.go#L73-L80
train
xanzy/go-cloudstack
cloudstack/RegionService.go
AddRegion
func (s *RegionService) AddRegion(p *AddRegionParams) (*AddRegionResponse, error) { resp, err := s.cs.newRequest("addRegion", p.toURLValues()) if err != nil { return nil, err } var r AddRegionResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *RegionService) AddRegion(p *AddRegionParams) (*AddRegionResponse, error) { resp, err := s.cs.newRequest("addRegion", p.toURLValues()) if err != nil { return nil, err } var r AddRegionResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "RegionService", ")", "AddRegion", "(", "p", "*", "AddRegionParams", ")", "(", "*", "AddRegionResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "AddRegionResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Adds a Region
[ "Adds", "a", "Region" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RegionService.go#L83-L95
train
xanzy/go-cloudstack
cloudstack/RegionService.go
NewListRegionsParams
func (s *RegionService) NewListRegionsParams() *ListRegionsParams { p := &ListRegionsParams{} p.p = make(map[string]interface{}) return p }
go
func (s *RegionService) NewListRegionsParams() *ListRegionsParams { p := &ListRegionsParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "RegionService", ")", "NewListRegionsParams", "(", ")", "*", "ListRegionsParams", "{", "p", ":=", "&", "ListRegionsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListRegionsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListRegionsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RegionService.go#L177-L181
train
xanzy/go-cloudstack
cloudstack/RegionService.go
NewRemoveRegionParams
func (s *RegionService) NewRemoveRegionParams(id int) *RemoveRegionParams { p := &RemoveRegionParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *RegionService) NewRemoveRegionParams(id int) *RemoveRegionParams { p := &RemoveRegionParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "RegionService", ")", "NewRemoveRegionParams", "(", "id", "int", ")", "*", "RemoveRegionParams", "{", "p", ":=", "&", "RemoveRegionParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new RemoveRegionParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "RemoveRegionParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RegionService.go#L237-L242
train
xanzy/go-cloudstack
cloudstack/RegionService.go
RemoveRegion
func (s *RegionService) RemoveRegion(p *RemoveRegionParams) (*RemoveRegionResponse, error) { resp, err := s.cs.newRequest("removeRegion", p.toURLValues()) if err != nil { return nil, err } var r RemoveRegionResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *RegionService) RemoveRegion(p *RemoveRegionParams) (*RemoveRegionResponse, error) { resp, err := s.cs.newRequest("removeRegion", p.toURLValues()) if err != nil { return nil, err } var r RemoveRegionResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "RegionService", ")", "RemoveRegion", "(", "p", "*", "RemoveRegionParams", ")", "(", "*", "RemoveRegionResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "RemoveRegionResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Removes specified region
[ "Removes", "specified", "region" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RegionService.go#L245-L257
train
xanzy/go-cloudstack
cloudstack/RegionService.go
NewUpdateRegionParams
func (s *RegionService) NewUpdateRegionParams(id int) *UpdateRegionParams { p := &UpdateRegionParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *RegionService) NewUpdateRegionParams(id int) *UpdateRegionParams { p := &UpdateRegionParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "RegionService", ")", "NewUpdateRegionParams", "(", "id", "int", ")", "*", "UpdateRegionParams", "{", "p", ":=", "&", "UpdateRegionParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new UpdateRegionParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "UpdateRegionParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RegionService.go#L331-L336
train
xanzy/go-cloudstack
cloudstack/RegionService.go
UpdateRegion
func (s *RegionService) UpdateRegion(p *UpdateRegionParams) (*UpdateRegionResponse, error) { resp, err := s.cs.newRequest("updateRegion", p.toURLValues()) if err != nil { return nil, err } var r UpdateRegionResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *RegionService) UpdateRegion(p *UpdateRegionParams) (*UpdateRegionResponse, error) { resp, err := s.cs.newRequest("updateRegion", p.toURLValues()) if err != nil { return nil, err } var r UpdateRegionResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "RegionService", ")", "UpdateRegion", "(", "p", "*", "UpdateRegionParams", ")", "(", "*", "UpdateRegionResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "UpdateRegionResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Updates a region
[ "Updates", "a", "region" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RegionService.go#L339-L351
train
xanzy/go-cloudstack
cloudstack/SystemCapacityService.go
NewListCapacityParams
func (s *SystemCapacityService) NewListCapacityParams() *ListCapacityParams { p := &ListCapacityParams{} p.p = make(map[string]interface{}) return p }
go
func (s *SystemCapacityService) NewListCapacityParams() *ListCapacityParams { p := &ListCapacityParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "SystemCapacityService", ")", "NewListCapacityParams", "(", ")", "*", "ListCapacityParams", "{", "p", ":=", "&", "ListCapacityParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListCapacityParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListCapacityParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SystemCapacityService.go#L142-L146
train
xanzy/go-cloudstack
cloudstack/SystemCapacityService.go
ListCapacity
func (s *SystemCapacityService) ListCapacity(p *ListCapacityParams) (*ListCapacityResponse, error) { resp, err := s.cs.newRequest("listCapacity", p.toURLValues()) if err != nil { return nil, err } var r ListCapacityResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *SystemCapacityService) ListCapacity(p *ListCapacityParams) (*ListCapacityResponse, error) { resp, err := s.cs.newRequest("listCapacity", p.toURLValues()) if err != nil { return nil, err } var r ListCapacityResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "SystemCapacityService", ")", "ListCapacity", "(", "p", "*", "ListCapacityParams", ")", "(", "*", "ListCapacityResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListCapacityResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Lists all the system wide capacities.
[ "Lists", "all", "the", "system", "wide", "capacities", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SystemCapacityService.go#L149-L161
train
xanzy/go-cloudstack
cloudstack/cloudstack.go
NewAsyncClient
func NewAsyncClient(apiurl string, apikey string, secret string, verifyssl bool) *CloudStackClient { cs := newClient(apiurl, apikey, secret, true, verifyssl) return cs }
go
func NewAsyncClient(apiurl string, apikey string, secret string, verifyssl bool) *CloudStackClient { cs := newClient(apiurl, apikey, secret, true, verifyssl) return cs }
[ "func", "NewAsyncClient", "(", "apiurl", "string", ",", "apikey", "string", ",", "secret", "string", ",", "verifyssl", "bool", ")", "*", "CloudStackClient", "{", "cs", ":=", "newClient", "(", "apiurl", ",", "apikey", ",", "secret", ",", "true", ",", "verifyssl", ")", "\n", "return", "cs", "\n", "}" ]
// For sync API calls this client behaves exactly the same as a standard client call, but for async API calls // this client will wait until the async job is finished or until the configured AsyncTimeout is reached. When the async // job finishes successfully it will return actual object received from the API and nil, but when the timout is // reached it will return the initial object containing the async job ID for the running job and a warning.
[ "For", "sync", "API", "calls", "this", "client", "behaves", "exactly", "the", "same", "as", "a", "standard", "client", "call", "but", "for", "async", "API", "calls", "this", "client", "will", "wait", "until", "the", "async", "job", "is", "finished", "or", "until", "the", "configured", "AsyncTimeout", "is", "reached", ".", "When", "the", "async", "job", "finishes", "successfully", "it", "will", "return", "actual", "object", "received", "from", "the", "API", "and", "nil", "but", "when", "the", "timout", "is", "reached", "it", "will", "return", "the", "initial", "object", "containing", "the", "async", "job", "ID", "for", "the", "running", "job", "and", "a", "warning", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/cloudstack.go#L256-L259
train
xanzy/go-cloudstack
cloudstack/cloudstack.go
DefaultOptions
func (cs *CloudStackClient) DefaultOptions(options ...OptionFunc) { if options != nil { cs.options = options } else { cs.options = []OptionFunc{} } }
go
func (cs *CloudStackClient) DefaultOptions(options ...OptionFunc) { if options != nil { cs.options = options } else { cs.options = []OptionFunc{} } }
[ "func", "(", "cs", "*", "CloudStackClient", ")", "DefaultOptions", "(", "options", "...", "OptionFunc", ")", "{", "if", "options", "!=", "nil", "{", "cs", ".", "options", "=", "options", "\n", "}", "else", "{", "cs", ".", "options", "=", "[", "]", "OptionFunc", "{", "}", "\n", "}", "\n", "}" ]
// Set any default options that would be added to all API calls that support it.
[ "Set", "any", "default", "options", "that", "would", "be", "added", "to", "all", "API", "calls", "that", "support", "it", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/cloudstack.go#L268-L274
train
xanzy/go-cloudstack
cloudstack/cloudstack.go
GetAsyncJobResult
func (cs *CloudStackClient) GetAsyncJobResult(jobid string, timeout int64) (json.RawMessage, error) { var timer time.Duration currentTime := time.Now().Unix() for { p := cs.Asyncjob.NewQueryAsyncJobResultParams(jobid) r, err := cs.Asyncjob.QueryAsyncJobResult(p) if err != nil { return nil, err } // Status 1 means the job is finished successfully if r.Jobstatus == 1 { return r.Jobresult, nil } // When the status is 2, the job has failed if r.Jobstatus == 2 { if r.Jobresulttype == "text" { return nil, fmt.Errorf(string(r.Jobresult)) } else { return nil, fmt.Errorf("Undefined error: %s", string(r.Jobresult)) } } if time.Now().Unix()-currentTime > timeout { return nil, AsyncTimeoutErr } // Add an (extremely simple) exponential backoff like feature to prevent // flooding the CloudStack API if timer < 15 { timer++ } time.Sleep(timer * time.Second) } }
go
func (cs *CloudStackClient) GetAsyncJobResult(jobid string, timeout int64) (json.RawMessage, error) { var timer time.Duration currentTime := time.Now().Unix() for { p := cs.Asyncjob.NewQueryAsyncJobResultParams(jobid) r, err := cs.Asyncjob.QueryAsyncJobResult(p) if err != nil { return nil, err } // Status 1 means the job is finished successfully if r.Jobstatus == 1 { return r.Jobresult, nil } // When the status is 2, the job has failed if r.Jobstatus == 2 { if r.Jobresulttype == "text" { return nil, fmt.Errorf(string(r.Jobresult)) } else { return nil, fmt.Errorf("Undefined error: %s", string(r.Jobresult)) } } if time.Now().Unix()-currentTime > timeout { return nil, AsyncTimeoutErr } // Add an (extremely simple) exponential backoff like feature to prevent // flooding the CloudStack API if timer < 15 { timer++ } time.Sleep(timer * time.Second) } }
[ "func", "(", "cs", "*", "CloudStackClient", ")", "GetAsyncJobResult", "(", "jobid", "string", ",", "timeout", "int64", ")", "(", "json", ".", "RawMessage", ",", "error", ")", "{", "var", "timer", "time", ".", "Duration", "\n", "currentTime", ":=", "time", ".", "Now", "(", ")", ".", "Unix", "(", ")", "\n\n", "for", "{", "p", ":=", "cs", ".", "Asyncjob", ".", "NewQueryAsyncJobResultParams", "(", "jobid", ")", "\n", "r", ",", "err", ":=", "cs", ".", "Asyncjob", ".", "QueryAsyncJobResult", "(", "p", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// Status 1 means the job is finished successfully", "if", "r", ".", "Jobstatus", "==", "1", "{", "return", "r", ".", "Jobresult", ",", "nil", "\n", "}", "\n\n", "// When the status is 2, the job has failed", "if", "r", ".", "Jobstatus", "==", "2", "{", "if", "r", ".", "Jobresulttype", "==", "\"", "\"", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "string", "(", "r", ".", "Jobresult", ")", ")", "\n", "}", "else", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "string", "(", "r", ".", "Jobresult", ")", ")", "\n", "}", "\n", "}", "\n\n", "if", "time", ".", "Now", "(", ")", ".", "Unix", "(", ")", "-", "currentTime", ">", "timeout", "{", "return", "nil", ",", "AsyncTimeoutErr", "\n", "}", "\n\n", "// Add an (extremely simple) exponential backoff like feature to prevent", "// flooding the CloudStack API", "if", "timer", "<", "15", "{", "timer", "++", "\n", "}", "\n\n", "time", ".", "Sleep", "(", "timer", "*", "time", ".", "Second", ")", "\n", "}", "\n", "}" ]
// A helper function that you can use to get the result of a running async job. If the job is not finished within the configured // timeout, the async job returns a AsyncTimeoutErr.
[ "A", "helper", "function", "that", "you", "can", "use", "to", "get", "the", "result", "of", "a", "running", "async", "job", ".", "If", "the", "job", "is", "not", "finished", "within", "the", "configured", "timeout", "the", "async", "job", "returns", "a", "AsyncTimeoutErr", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/cloudstack.go#L280-L317
train
xanzy/go-cloudstack
cloudstack/cloudstack.go
getRawValue
func getRawValue(b json.RawMessage) (json.RawMessage, error) { var m map[string]json.RawMessage if err := json.Unmarshal(b, &m); err != nil { return nil, err } for _, v := range m { return v, nil } return nil, fmt.Errorf("Unable to extract the raw value from:\n\n%s\n\n", string(b)) }
go
func getRawValue(b json.RawMessage) (json.RawMessage, error) { var m map[string]json.RawMessage if err := json.Unmarshal(b, &m); err != nil { return nil, err } for _, v := range m { return v, nil } return nil, fmt.Errorf("Unable to extract the raw value from:\n\n%s\n\n", string(b)) }
[ "func", "getRawValue", "(", "b", "json", ".", "RawMessage", ")", "(", "json", ".", "RawMessage", ",", "error", ")", "{", "var", "m", "map", "[", "string", "]", "json", ".", "RawMessage", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "m", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "for", "_", ",", "v", ":=", "range", "m", "{", "return", "v", ",", "nil", "\n", "}", "\n", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\\n", "\\n", "\\n", "\\n", "\"", ",", "string", "(", "b", ")", ")", "\n", "}" ]
// Generic function to get the first raw value from a response as json.RawMessage
[ "Generic", "function", "to", "get", "the", "first", "raw", "value", "from", "a", "response", "as", "json", ".", "RawMessage" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/cloudstack.go#L411-L420
train
xanzy/go-cloudstack
cloudstack/cloudstack.go
WithDomain
func WithDomain(domain string) OptionFunc { return func(cs *CloudStackClient, p interface{}) error { ps, ok := p.(DomainIDSetter) if !ok || domain == "" { return nil } if !IsID(domain) { id, _, err := cs.Domain.GetDomainID(domain) if err != nil { return err } domain = id } ps.SetDomainid(domain) return nil } }
go
func WithDomain(domain string) OptionFunc { return func(cs *CloudStackClient, p interface{}) error { ps, ok := p.(DomainIDSetter) if !ok || domain == "" { return nil } if !IsID(domain) { id, _, err := cs.Domain.GetDomainID(domain) if err != nil { return err } domain = id } ps.SetDomainid(domain) return nil } }
[ "func", "WithDomain", "(", "domain", "string", ")", "OptionFunc", "{", "return", "func", "(", "cs", "*", "CloudStackClient", ",", "p", "interface", "{", "}", ")", "error", "{", "ps", ",", "ok", ":=", "p", ".", "(", "DomainIDSetter", ")", "\n\n", "if", "!", "ok", "||", "domain", "==", "\"", "\"", "{", "return", "nil", "\n", "}", "\n\n", "if", "!", "IsID", "(", "domain", ")", "{", "id", ",", "_", ",", "err", ":=", "cs", ".", "Domain", ".", "GetDomainID", "(", "domain", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "domain", "=", "id", "\n", "}", "\n\n", "ps", ".", "SetDomainid", "(", "domain", ")", "\n\n", "return", "nil", "\n", "}", "\n", "}" ]
// WithDomain takes either a domain name or ID and sets the `domainid` parameter
[ "WithDomain", "takes", "either", "a", "domain", "name", "or", "ID", "and", "sets", "the", "domainid", "parameter" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/cloudstack.go#L428-L448
train
xanzy/go-cloudstack
cloudstack/cloudstack.go
WithProject
func WithProject(project string) OptionFunc { return func(cs *CloudStackClient, p interface{}) error { ps, ok := p.(ProjectIDSetter) if !ok || project == "" { return nil } if !IsID(project) { id, _, err := cs.Project.GetProjectID(project) if err != nil { return err } project = id } ps.SetProjectid(project) return nil } }
go
func WithProject(project string) OptionFunc { return func(cs *CloudStackClient, p interface{}) error { ps, ok := p.(ProjectIDSetter) if !ok || project == "" { return nil } if !IsID(project) { id, _, err := cs.Project.GetProjectID(project) if err != nil { return err } project = id } ps.SetProjectid(project) return nil } }
[ "func", "WithProject", "(", "project", "string", ")", "OptionFunc", "{", "return", "func", "(", "cs", "*", "CloudStackClient", ",", "p", "interface", "{", "}", ")", "error", "{", "ps", ",", "ok", ":=", "p", ".", "(", "ProjectIDSetter", ")", "\n\n", "if", "!", "ok", "||", "project", "==", "\"", "\"", "{", "return", "nil", "\n", "}", "\n\n", "if", "!", "IsID", "(", "project", ")", "{", "id", ",", "_", ",", "err", ":=", "cs", ".", "Project", ".", "GetProjectID", "(", "project", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "project", "=", "id", "\n", "}", "\n\n", "ps", ".", "SetProjectid", "(", "project", ")", "\n\n", "return", "nil", "\n", "}", "\n", "}" ]
// WithProject takes either a project name or ID and sets the `projectid` parameter
[ "WithProject", "takes", "either", "a", "project", "name", "or", "ID", "and", "sets", "the", "projectid", "parameter" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/cloudstack.go#L456-L476
train
xanzy/go-cloudstack
cloudstack/cloudstack.go
WithVPCID
func WithVPCID(id string) OptionFunc { return func(cs *CloudStackClient, p interface{}) error { vs, ok := p.(VPCIDSetter) if !ok || id == "" { return nil } vs.SetVpcid(id) return nil } }
go
func WithVPCID(id string) OptionFunc { return func(cs *CloudStackClient, p interface{}) error { vs, ok := p.(VPCIDSetter) if !ok || id == "" { return nil } vs.SetVpcid(id) return nil } }
[ "func", "WithVPCID", "(", "id", "string", ")", "OptionFunc", "{", "return", "func", "(", "cs", "*", "CloudStackClient", ",", "p", "interface", "{", "}", ")", "error", "{", "vs", ",", "ok", ":=", "p", ".", "(", "VPCIDSetter", ")", "\n\n", "if", "!", "ok", "||", "id", "==", "\"", "\"", "{", "return", "nil", "\n", "}", "\n\n", "vs", ".", "SetVpcid", "(", "id", ")", "\n\n", "return", "nil", "\n", "}", "\n", "}" ]
// WithVPCID takes a vpc ID and sets the `vpcid` parameter
[ "WithVPCID", "takes", "a", "vpc", "ID", "and", "sets", "the", "vpcid", "parameter" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/cloudstack.go#L484-L496
train
xanzy/go-cloudstack
cloudstack/ImageStoreService.go
NewAddImageStoreParams
func (s *ImageStoreService) NewAddImageStoreParams(provider string) *AddImageStoreParams { p := &AddImageStoreParams{} p.p = make(map[string]interface{}) p.p["provider"] = provider return p }
go
func (s *ImageStoreService) NewAddImageStoreParams(provider string) *AddImageStoreParams { p := &AddImageStoreParams{} p.p = make(map[string]interface{}) p.p["provider"] = provider return p }
[ "func", "(", "s", "*", "ImageStoreService", ")", "NewAddImageStoreParams", "(", "provider", "string", ")", "*", "AddImageStoreParams", "{", "p", ":=", "&", "AddImageStoreParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "provider", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new AddImageStoreParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "AddImageStoreParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ImageStoreService.go#L100-L105
train
xanzy/go-cloudstack
cloudstack/ImageStoreService.go
NewAddImageStoreS3Params
func (s *ImageStoreService) NewAddImageStoreS3Params(accesskey string, bucket string, endpoint string, secretkey string) *AddImageStoreS3Params { p := &AddImageStoreS3Params{} p.p = make(map[string]interface{}) p.p["accesskey"] = accesskey p.p["bucket"] = bucket p.p["endpoint"] = endpoint p.p["secretkey"] = secretkey return p }
go
func (s *ImageStoreService) NewAddImageStoreS3Params(accesskey string, bucket string, endpoint string, secretkey string) *AddImageStoreS3Params { p := &AddImageStoreS3Params{} p.p = make(map[string]interface{}) p.p["accesskey"] = accesskey p.p["bucket"] = bucket p.p["endpoint"] = endpoint p.p["secretkey"] = secretkey return p }
[ "func", "(", "s", "*", "ImageStoreService", ")", "NewAddImageStoreS3Params", "(", "accesskey", "string", ",", "bucket", "string", ",", "endpoint", "string", ",", "secretkey", "string", ")", "*", "AddImageStoreS3Params", "{", "p", ":=", "&", "AddImageStoreS3Params", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "accesskey", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "bucket", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "endpoint", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "secretkey", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new AddImageStoreS3Params instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "AddImageStoreS3Params", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ImageStoreService.go#L274-L282
train
xanzy/go-cloudstack
cloudstack/ImageStoreService.go
AddImageStoreS3
func (s *ImageStoreService) AddImageStoreS3(p *AddImageStoreS3Params) (*AddImageStoreS3Response, error) { resp, err := s.cs.newRequest("addImageStoreS3", p.toURLValues()) if err != nil { return nil, err } var r AddImageStoreS3Response if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *ImageStoreService) AddImageStoreS3(p *AddImageStoreS3Params) (*AddImageStoreS3Response, error) { resp, err := s.cs.newRequest("addImageStoreS3", p.toURLValues()) if err != nil { return nil, err } var r AddImageStoreS3Response if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "ImageStoreService", ")", "AddImageStoreS3", "(", "p", "*", "AddImageStoreS3Params", ")", "(", "*", "AddImageStoreS3Response", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "AddImageStoreS3Response", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Adds S3 Image Store
[ "Adds", "S3", "Image", "Store" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ImageStoreService.go#L285-L297
train
xanzy/go-cloudstack
cloudstack/ImageStoreService.go
NewCreateSecondaryStagingStoreParams
func (s *ImageStoreService) NewCreateSecondaryStagingStoreParams(url string) *CreateSecondaryStagingStoreParams { p := &CreateSecondaryStagingStoreParams{} p.p = make(map[string]interface{}) p.p["url"] = url return p }
go
func (s *ImageStoreService) NewCreateSecondaryStagingStoreParams(url string) *CreateSecondaryStagingStoreParams { p := &CreateSecondaryStagingStoreParams{} p.p = make(map[string]interface{}) p.p["url"] = url return p }
[ "func", "(", "s", "*", "ImageStoreService", ")", "NewCreateSecondaryStagingStoreParams", "(", "url", "string", ")", "*", "CreateSecondaryStagingStoreParams", "{", "p", ":=", "&", "CreateSecondaryStagingStoreParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "url", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new CreateSecondaryStagingStoreParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "CreateSecondaryStagingStoreParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ImageStoreService.go#L383-L388
train
xanzy/go-cloudstack
cloudstack/ImageStoreService.go
NewDeleteImageStoreParams
func (s *ImageStoreService) NewDeleteImageStoreParams(id string) *DeleteImageStoreParams { p := &DeleteImageStoreParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *ImageStoreService) NewDeleteImageStoreParams(id string) *DeleteImageStoreParams { p := &DeleteImageStoreParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "ImageStoreService", ")", "NewDeleteImageStoreParams", "(", "id", "string", ")", "*", "DeleteImageStoreParams", "{", "p", ":=", "&", "DeleteImageStoreParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteImageStoreParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteImageStoreParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ImageStoreService.go#L441-L446
train
xanzy/go-cloudstack
cloudstack/ImageStoreService.go
DeleteImageStore
func (s *ImageStoreService) DeleteImageStore(p *DeleteImageStoreParams) (*DeleteImageStoreResponse, error) { resp, err := s.cs.newRequest("deleteImageStore", p.toURLValues()) if err != nil { return nil, err } var r DeleteImageStoreResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *ImageStoreService) DeleteImageStore(p *DeleteImageStoreParams) (*DeleteImageStoreResponse, error) { resp, err := s.cs.newRequest("deleteImageStore", p.toURLValues()) if err != nil { return nil, err } var r DeleteImageStoreResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "ImageStoreService", ")", "DeleteImageStore", "(", "p", "*", "DeleteImageStoreParams", ")", "(", "*", "DeleteImageStoreResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "DeleteImageStoreResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Deletes an image store or Secondary Storage.
[ "Deletes", "an", "image", "store", "or", "Secondary", "Storage", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ImageStoreService.go#L449-L461
train
xanzy/go-cloudstack
cloudstack/ImageStoreService.go
NewDeleteSecondaryStagingStoreParams
func (s *ImageStoreService) NewDeleteSecondaryStagingStoreParams(id string) *DeleteSecondaryStagingStoreParams { p := &DeleteSecondaryStagingStoreParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *ImageStoreService) NewDeleteSecondaryStagingStoreParams(id string) *DeleteSecondaryStagingStoreParams { p := &DeleteSecondaryStagingStoreParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "ImageStoreService", ")", "NewDeleteSecondaryStagingStoreParams", "(", "id", "string", ")", "*", "DeleteSecondaryStagingStoreParams", "{", "p", ":=", "&", "DeleteSecondaryStagingStoreParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteSecondaryStagingStoreParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteSecondaryStagingStoreParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ImageStoreService.go#L512-L517
train
xanzy/go-cloudstack
cloudstack/ImageStoreService.go
NewListImageStoresParams
func (s *ImageStoreService) NewListImageStoresParams() *ListImageStoresParams { p := &ListImageStoresParams{} p.p = make(map[string]interface{}) return p }
go
func (s *ImageStoreService) NewListImageStoresParams() *ListImageStoresParams { p := &ListImageStoresParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "ImageStoreService", ")", "NewListImageStoresParams", "(", ")", "*", "ListImageStoresParams", "{", "p", ":=", "&", "ListImageStoresParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListImageStoresParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListImageStoresParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ImageStoreService.go#L662-L666
train
xanzy/go-cloudstack
cloudstack/ImageStoreService.go
NewListSecondaryStagingStoresParams
func (s *ImageStoreService) NewListSecondaryStagingStoresParams() *ListSecondaryStagingStoresParams { p := &ListSecondaryStagingStoresParams{} p.p = make(map[string]interface{}) return p }
go
func (s *ImageStoreService) NewListSecondaryStagingStoresParams() *ListSecondaryStagingStoresParams { p := &ListSecondaryStagingStoresParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "ImageStoreService", ")", "NewListSecondaryStagingStoresParams", "(", ")", "*", "ListSecondaryStagingStoresParams", "{", "p", ":=", "&", "ListSecondaryStagingStoresParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListSecondaryStagingStoresParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListSecondaryStagingStoresParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ImageStoreService.go#L886-L890
train
xanzy/go-cloudstack
cloudstack/ImageStoreService.go
NewUpdateCloudToUseObjectStoreParams
func (s *ImageStoreService) NewUpdateCloudToUseObjectStoreParams(provider string) *UpdateCloudToUseObjectStoreParams { p := &UpdateCloudToUseObjectStoreParams{} p.p = make(map[string]interface{}) p.p["provider"] = provider return p }
go
func (s *ImageStoreService) NewUpdateCloudToUseObjectStoreParams(provider string) *UpdateCloudToUseObjectStoreParams { p := &UpdateCloudToUseObjectStoreParams{} p.p = make(map[string]interface{}) p.p["provider"] = provider return p }
[ "func", "(", "s", "*", "ImageStoreService", ")", "NewUpdateCloudToUseObjectStoreParams", "(", "provider", "string", ")", "*", "UpdateCloudToUseObjectStoreParams", "{", "p", ":=", "&", "UpdateCloudToUseObjectStoreParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "provider", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new UpdateCloudToUseObjectStoreParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "UpdateCloudToUseObjectStoreParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ImageStoreService.go#L1068-L1073
train
xanzy/go-cloudstack
cloudstack/APIDiscoveryService.go
NewListApisParams
func (s *APIDiscoveryService) NewListApisParams() *ListApisParams { p := &ListApisParams{} p.p = make(map[string]interface{}) return p }
go
func (s *APIDiscoveryService) NewListApisParams() *ListApisParams { p := &ListApisParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "APIDiscoveryService", ")", "NewListApisParams", "(", ")", "*", "ListApisParams", "{", "p", ":=", "&", "ListApisParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListApisParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListApisParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/APIDiscoveryService.go#L49-L53
train
xanzy/go-cloudstack
cloudstack/APIDiscoveryService.go
ListApis
func (s *APIDiscoveryService) ListApis(p *ListApisParams) (*ListApisResponse, error) { resp, err := s.cs.newRequest("listApis", p.toURLValues()) if err != nil { return nil, err } var r ListApisResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *APIDiscoveryService) ListApis(p *ListApisParams) (*ListApisResponse, error) { resp, err := s.cs.newRequest("listApis", p.toURLValues()) if err != nil { return nil, err } var r ListApisResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "APIDiscoveryService", ")", "ListApis", "(", "p", "*", "ListApisParams", ")", "(", "*", "ListApisResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListApisResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// lists all available apis on the server, provided by the Api Discovery plugin
[ "lists", "all", "available", "apis", "on", "the", "server", "provided", "by", "the", "Api", "Discovery", "plugin" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/APIDiscoveryService.go#L56-L68
train
xanzy/go-cloudstack
cloudstack/SSHService.go
NewCreateSSHKeyPairParams
func (s *SSHService) NewCreateSSHKeyPairParams(name string) *CreateSSHKeyPairParams { p := &CreateSSHKeyPairParams{} p.p = make(map[string]interface{}) p.p["name"] = name return p }
go
func (s *SSHService) NewCreateSSHKeyPairParams(name string) *CreateSSHKeyPairParams { p := &CreateSSHKeyPairParams{} p.p = make(map[string]interface{}) p.p["name"] = name return p }
[ "func", "(", "s", "*", "SSHService", ")", "NewCreateSSHKeyPairParams", "(", "name", "string", ")", "*", "CreateSSHKeyPairParams", "{", "p", ":=", "&", "CreateSSHKeyPairParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "name", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new CreateSSHKeyPairParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "CreateSSHKeyPairParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SSHService.go#L83-L88
train
xanzy/go-cloudstack
cloudstack/SSHService.go
CreateSSHKeyPair
func (s *SSHService) CreateSSHKeyPair(p *CreateSSHKeyPairParams) (*CreateSSHKeyPairResponse, error) { resp, err := s.cs.newRequest("createSSHKeyPair", p.toURLValues()) if err != nil { return nil, err } if resp, err = getRawValue(resp); err != nil { return nil, err } var r CreateSSHKeyPairResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *SSHService) CreateSSHKeyPair(p *CreateSSHKeyPairParams) (*CreateSSHKeyPairResponse, error) { resp, err := s.cs.newRequest("createSSHKeyPair", p.toURLValues()) if err != nil { return nil, err } if resp, err = getRawValue(resp); err != nil { return nil, err } var r CreateSSHKeyPairResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "SSHService", ")", "CreateSSHKeyPair", "(", "p", "*", "CreateSSHKeyPairParams", ")", "(", "*", "CreateSSHKeyPairResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "resp", ",", "err", "=", "getRawValue", "(", "resp", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "CreateSSHKeyPairResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Create a new keypair and returns the private key
[ "Create", "a", "new", "keypair", "and", "returns", "the", "private", "key" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SSHService.go#L91-L107
train
xanzy/go-cloudstack
cloudstack/SSHService.go
NewDeleteSSHKeyPairParams
func (s *SSHService) NewDeleteSSHKeyPairParams(name string) *DeleteSSHKeyPairParams { p := &DeleteSSHKeyPairParams{} p.p = make(map[string]interface{}) p.p["name"] = name return p }
go
func (s *SSHService) NewDeleteSSHKeyPairParams(name string) *DeleteSSHKeyPairParams { p := &DeleteSSHKeyPairParams{} p.p = make(map[string]interface{}) p.p["name"] = name return p }
[ "func", "(", "s", "*", "SSHService", ")", "NewDeleteSSHKeyPairParams", "(", "name", "string", ")", "*", "DeleteSSHKeyPairParams", "{", "p", ":=", "&", "DeleteSSHKeyPairParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "name", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteSSHKeyPairParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteSSHKeyPairParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SSHService.go#L171-L176
train
xanzy/go-cloudstack
cloudstack/SSHService.go
DeleteSSHKeyPair
func (s *SSHService) DeleteSSHKeyPair(p *DeleteSSHKeyPairParams) (*DeleteSSHKeyPairResponse, error) { resp, err := s.cs.newRequest("deleteSSHKeyPair", p.toURLValues()) if err != nil { return nil, err } var r DeleteSSHKeyPairResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *SSHService) DeleteSSHKeyPair(p *DeleteSSHKeyPairParams) (*DeleteSSHKeyPairResponse, error) { resp, err := s.cs.newRequest("deleteSSHKeyPair", p.toURLValues()) if err != nil { return nil, err } var r DeleteSSHKeyPairResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "SSHService", ")", "DeleteSSHKeyPair", "(", "p", "*", "DeleteSSHKeyPairParams", ")", "(", "*", "DeleteSSHKeyPairResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "DeleteSSHKeyPairResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Deletes a keypair by name
[ "Deletes", "a", "keypair", "by", "name" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SSHService.go#L179-L191
train
xanzy/go-cloudstack
cloudstack/SSHService.go
NewListSSHKeyPairsParams
func (s *SSHService) NewListSSHKeyPairsParams() *ListSSHKeyPairsParams { p := &ListSSHKeyPairsParams{} p.p = make(map[string]interface{}) return p }
go
func (s *SSHService) NewListSSHKeyPairsParams() *ListSSHKeyPairsParams { p := &ListSSHKeyPairsParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "SSHService", ")", "NewListSSHKeyPairsParams", "(", ")", "*", "ListSSHKeyPairsParams", "{", "p", ":=", "&", "ListSSHKeyPairsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListSSHKeyPairsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListSSHKeyPairsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SSHService.go#L345-L349
train
xanzy/go-cloudstack
cloudstack/SSHService.go
ListSSHKeyPairs
func (s *SSHService) ListSSHKeyPairs(p *ListSSHKeyPairsParams) (*ListSSHKeyPairsResponse, error) { resp, err := s.cs.newRequest("listSSHKeyPairs", p.toURLValues()) if err != nil { return nil, err } var r ListSSHKeyPairsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *SSHService) ListSSHKeyPairs(p *ListSSHKeyPairsParams) (*ListSSHKeyPairsResponse, error) { resp, err := s.cs.newRequest("listSSHKeyPairs", p.toURLValues()) if err != nil { return nil, err } var r ListSSHKeyPairsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "SSHService", ")", "ListSSHKeyPairs", "(", "p", "*", "ListSSHKeyPairsParams", ")", "(", "*", "ListSSHKeyPairsResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListSSHKeyPairsResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// List registered keypairs
[ "List", "registered", "keypairs" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SSHService.go#L352-L364
train
xanzy/go-cloudstack
cloudstack/SSHService.go
NewRegisterSSHKeyPairParams
func (s *SSHService) NewRegisterSSHKeyPairParams(name string, publickey string) *RegisterSSHKeyPairParams { p := &RegisterSSHKeyPairParams{} p.p = make(map[string]interface{}) p.p["name"] = name p.p["publickey"] = publickey return p }
go
func (s *SSHService) NewRegisterSSHKeyPairParams(name string, publickey string) *RegisterSSHKeyPairParams { p := &RegisterSSHKeyPairParams{} p.p = make(map[string]interface{}) p.p["name"] = name p.p["publickey"] = publickey return p }
[ "func", "(", "s", "*", "SSHService", ")", "NewRegisterSSHKeyPairParams", "(", "name", "string", ",", "publickey", "string", ")", "*", "RegisterSSHKeyPairParams", "{", "p", ":=", "&", "RegisterSSHKeyPairParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "name", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "publickey", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new RegisterSSHKeyPairParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "RegisterSSHKeyPairParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SSHService.go#L448-L454
train
xanzy/go-cloudstack
cloudstack/SSHService.go
RegisterSSHKeyPair
func (s *SSHService) RegisterSSHKeyPair(p *RegisterSSHKeyPairParams) (*RegisterSSHKeyPairResponse, error) { resp, err := s.cs.newRequest("registerSSHKeyPair", p.toURLValues()) if err != nil { return nil, err } if resp, err = getRawValue(resp); err != nil { return nil, err } var r RegisterSSHKeyPairResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *SSHService) RegisterSSHKeyPair(p *RegisterSSHKeyPairParams) (*RegisterSSHKeyPairResponse, error) { resp, err := s.cs.newRequest("registerSSHKeyPair", p.toURLValues()) if err != nil { return nil, err } if resp, err = getRawValue(resp); err != nil { return nil, err } var r RegisterSSHKeyPairResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "SSHService", ")", "RegisterSSHKeyPair", "(", "p", "*", "RegisterSSHKeyPairParams", ")", "(", "*", "RegisterSSHKeyPairResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "resp", ",", "err", "=", "getRawValue", "(", "resp", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "RegisterSSHKeyPairResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Register a public key in a keypair under a certain name
[ "Register", "a", "public", "key", "in", "a", "keypair", "under", "a", "certain", "name" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SSHService.go#L457-L473
train
xanzy/go-cloudstack
cloudstack/SSHService.go
NewResetSSHKeyForVirtualMachineParams
func (s *SSHService) NewResetSSHKeyForVirtualMachineParams(id string, keypair string) *ResetSSHKeyForVirtualMachineParams { p := &ResetSSHKeyForVirtualMachineParams{} p.p = make(map[string]interface{}) p.p["id"] = id p.p["keypair"] = keypair return p }
go
func (s *SSHService) NewResetSSHKeyForVirtualMachineParams(id string, keypair string) *ResetSSHKeyForVirtualMachineParams { p := &ResetSSHKeyForVirtualMachineParams{} p.p = make(map[string]interface{}) p.p["id"] = id p.p["keypair"] = keypair return p }
[ "func", "(", "s", "*", "SSHService", ")", "NewResetSSHKeyForVirtualMachineParams", "(", "id", "string", ",", "keypair", "string", ")", "*", "ResetSSHKeyForVirtualMachineParams", "{", "p", ":=", "&", "ResetSSHKeyForVirtualMachineParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "keypair", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ResetSSHKeyForVirtualMachineParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ResetSSHKeyForVirtualMachineParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SSHService.go#L552-L558
train
xanzy/go-cloudstack
cloudstack/ClusterService.go
NewAddClusterParams
func (s *ClusterService) NewAddClusterParams(clustername string, clustertype string, hypervisor string, podid string, zoneid string) *AddClusterParams { p := &AddClusterParams{} p.p = make(map[string]interface{}) p.p["clustername"] = clustername p.p["clustertype"] = clustertype p.p["hypervisor"] = hypervisor p.p["podid"] = podid p.p["zoneid"] = zoneid return p }
go
func (s *ClusterService) NewAddClusterParams(clustername string, clustertype string, hypervisor string, podid string, zoneid string) *AddClusterParams { p := &AddClusterParams{} p.p = make(map[string]interface{}) p.p["clustername"] = clustername p.p["clustertype"] = clustertype p.p["hypervisor"] = hypervisor p.p["podid"] = podid p.p["zoneid"] = zoneid return p }
[ "func", "(", "s", "*", "ClusterService", ")", "NewAddClusterParams", "(", "clustername", "string", ",", "clustertype", "string", ",", "hypervisor", "string", ",", "podid", "string", ",", "zoneid", "string", ")", "*", "AddClusterParams", "{", "p", ":=", "&", "AddClusterParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "clustername", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "clustertype", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "hypervisor", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "podid", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "zoneid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new AddClusterParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "AddClusterParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ClusterService.go#L250-L259
train
xanzy/go-cloudstack
cloudstack/ClusterService.go
NewDedicateClusterParams
func (s *ClusterService) NewDedicateClusterParams(clusterid string, domainid string) *DedicateClusterParams { p := &DedicateClusterParams{} p.p = make(map[string]interface{}) p.p["clusterid"] = clusterid p.p["domainid"] = domainid return p }
go
func (s *ClusterService) NewDedicateClusterParams(clusterid string, domainid string) *DedicateClusterParams { p := &DedicateClusterParams{} p.p = make(map[string]interface{}) p.p["clusterid"] = clusterid p.p["domainid"] = domainid return p }
[ "func", "(", "s", "*", "ClusterService", ")", "NewDedicateClusterParams", "(", "clusterid", "string", ",", "domainid", "string", ")", "*", "DedicateClusterParams", "{", "p", ":=", "&", "DedicateClusterParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "clusterid", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "domainid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DedicateClusterParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DedicateClusterParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ClusterService.go#L356-L362
train
xanzy/go-cloudstack
cloudstack/ClusterService.go
NewDeleteClusterParams
func (s *ClusterService) NewDeleteClusterParams(id string) *DeleteClusterParams { p := &DeleteClusterParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *ClusterService) NewDeleteClusterParams(id string) *DeleteClusterParams { p := &DeleteClusterParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "ClusterService", ")", "NewDeleteClusterParams", "(", "id", "string", ")", "*", "DeleteClusterParams", "{", "p", ":=", "&", "DeleteClusterParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteClusterParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteClusterParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ClusterService.go#L434-L439
train
xanzy/go-cloudstack
cloudstack/ClusterService.go
NewDisableOutOfBandManagementForClusterParams
func (s *ClusterService) NewDisableOutOfBandManagementForClusterParams(clusterid string) *DisableOutOfBandManagementForClusterParams { p := &DisableOutOfBandManagementForClusterParams{} p.p = make(map[string]interface{}) p.p["clusterid"] = clusterid return p }
go
func (s *ClusterService) NewDisableOutOfBandManagementForClusterParams(clusterid string) *DisableOutOfBandManagementForClusterParams { p := &DisableOutOfBandManagementForClusterParams{} p.p = make(map[string]interface{}) p.p["clusterid"] = clusterid return p }
[ "func", "(", "s", "*", "ClusterService", ")", "NewDisableOutOfBandManagementForClusterParams", "(", "clusterid", "string", ")", "*", "DisableOutOfBandManagementForClusterParams", "{", "p", ":=", "&", "DisableOutOfBandManagementForClusterParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "clusterid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DisableOutOfBandManagementForClusterParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DisableOutOfBandManagementForClusterParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ClusterService.go#L505-L510
train
xanzy/go-cloudstack
cloudstack/ClusterService.go
DisableOutOfBandManagementForCluster
func (s *ClusterService) DisableOutOfBandManagementForCluster(p *DisableOutOfBandManagementForClusterParams) (*DisableOutOfBandManagementForClusterResponse, error) { resp, err := s.cs.newRequest("disableOutOfBandManagementForCluster", p.toURLValues()) if err != nil { return nil, err } var r DisableOutOfBandManagementForClusterResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *ClusterService) DisableOutOfBandManagementForCluster(p *DisableOutOfBandManagementForClusterParams) (*DisableOutOfBandManagementForClusterResponse, error) { resp, err := s.cs.newRequest("disableOutOfBandManagementForCluster", p.toURLValues()) if err != nil { return nil, err } var r DisableOutOfBandManagementForClusterResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "ClusterService", ")", "DisableOutOfBandManagementForCluster", "(", "p", "*", "DisableOutOfBandManagementForClusterParams", ")", "(", "*", "DisableOutOfBandManagementForClusterResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "DisableOutOfBandManagementForClusterResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "b", ",", "err", "=", "getRawValue", "(", "b", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Disables out-of-band management for a cluster
[ "Disables", "out", "-", "of", "-", "band", "management", "for", "a", "cluster" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ClusterService.go#L513-L545
train
xanzy/go-cloudstack
cloudstack/ClusterService.go
NewEnableOutOfBandManagementForClusterParams
func (s *ClusterService) NewEnableOutOfBandManagementForClusterParams(clusterid string) *EnableOutOfBandManagementForClusterParams { p := &EnableOutOfBandManagementForClusterParams{} p.p = make(map[string]interface{}) p.p["clusterid"] = clusterid return p }
go
func (s *ClusterService) NewEnableOutOfBandManagementForClusterParams(clusterid string) *EnableOutOfBandManagementForClusterParams { p := &EnableOutOfBandManagementForClusterParams{} p.p = make(map[string]interface{}) p.p["clusterid"] = clusterid return p }
[ "func", "(", "s", "*", "ClusterService", ")", "NewEnableOutOfBandManagementForClusterParams", "(", "clusterid", "string", ")", "*", "EnableOutOfBandManagementForClusterParams", "{", "p", ":=", "&", "EnableOutOfBandManagementForClusterParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "clusterid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new EnableOutOfBandManagementForClusterParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "EnableOutOfBandManagementForClusterParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ClusterService.go#L587-L592
train
xanzy/go-cloudstack
cloudstack/ClusterService.go
EnableOutOfBandManagementForCluster
func (s *ClusterService) EnableOutOfBandManagementForCluster(p *EnableOutOfBandManagementForClusterParams) (*EnableOutOfBandManagementForClusterResponse, error) { resp, err := s.cs.newRequest("enableOutOfBandManagementForCluster", p.toURLValues()) if err != nil { return nil, err } var r EnableOutOfBandManagementForClusterResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *ClusterService) EnableOutOfBandManagementForCluster(p *EnableOutOfBandManagementForClusterParams) (*EnableOutOfBandManagementForClusterResponse, error) { resp, err := s.cs.newRequest("enableOutOfBandManagementForCluster", p.toURLValues()) if err != nil { return nil, err } var r EnableOutOfBandManagementForClusterResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "ClusterService", ")", "EnableOutOfBandManagementForCluster", "(", "p", "*", "EnableOutOfBandManagementForClusterParams", ")", "(", "*", "EnableOutOfBandManagementForClusterResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "EnableOutOfBandManagementForClusterResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "b", ",", "err", "=", "getRawValue", "(", "b", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Enables out-of-band management for a cluster
[ "Enables", "out", "-", "of", "-", "band", "management", "for", "a", "cluster" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ClusterService.go#L595-L627
train
xanzy/go-cloudstack
cloudstack/ClusterService.go
NewListClustersParams
func (s *ClusterService) NewListClustersParams() *ListClustersParams { p := &ListClustersParams{} p.p = make(map[string]interface{}) return p }
go
func (s *ClusterService) NewListClustersParams() *ListClustersParams { p := &ListClustersParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "ClusterService", ")", "NewListClustersParams", "(", ")", "*", "ListClustersParams", "{", "p", ":=", "&", "ListClustersParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListClustersParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListClustersParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ClusterService.go#L793-L797
train
xanzy/go-cloudstack
cloudstack/ClusterService.go
NewListDedicatedClustersParams
func (s *ClusterService) NewListDedicatedClustersParams() *ListDedicatedClustersParams { p := &ListDedicatedClustersParams{} p.p = make(map[string]interface{}) return p }
go
func (s *ClusterService) NewListDedicatedClustersParams() *ListDedicatedClustersParams { p := &ListDedicatedClustersParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "ClusterService", ")", "NewListDedicatedClustersParams", "(", ")", "*", "ListDedicatedClustersParams", "{", "p", ":=", "&", "ListDedicatedClustersParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListDedicatedClustersParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListDedicatedClustersParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ClusterService.go#L1028-L1032
train
xanzy/go-cloudstack
cloudstack/ClusterService.go
NewReleaseDedicatedClusterParams
func (s *ClusterService) NewReleaseDedicatedClusterParams(clusterid string) *ReleaseDedicatedClusterParams { p := &ReleaseDedicatedClusterParams{} p.p = make(map[string]interface{}) p.p["clusterid"] = clusterid return p }
go
func (s *ClusterService) NewReleaseDedicatedClusterParams(clusterid string) *ReleaseDedicatedClusterParams { p := &ReleaseDedicatedClusterParams{} p.p = make(map[string]interface{}) p.p["clusterid"] = clusterid return p }
[ "func", "(", "s", "*", "ClusterService", ")", "NewReleaseDedicatedClusterParams", "(", "clusterid", "string", ")", "*", "ReleaseDedicatedClusterParams", "{", "p", ":=", "&", "ReleaseDedicatedClusterParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "clusterid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ReleaseDedicatedClusterParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ReleaseDedicatedClusterParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ClusterService.go#L1088-L1093
train
xanzy/go-cloudstack
cloudstack/ClusterService.go
NewUpdateClusterParams
func (s *ClusterService) NewUpdateClusterParams(id string) *UpdateClusterParams { p := &UpdateClusterParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *ClusterService) NewUpdateClusterParams(id string) *UpdateClusterParams { p := &UpdateClusterParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "ClusterService", ")", "NewUpdateClusterParams", "(", "id", "string", ")", "*", "UpdateClusterParams", "{", "p", ":=", "&", "UpdateClusterParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new UpdateClusterParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "UpdateClusterParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ClusterService.go#L1211-L1216
train
xanzy/go-cloudstack
cloudstack/StoragePoolService.go
NewCancelStorageMaintenanceParams
func (s *StoragePoolService) NewCancelStorageMaintenanceParams(id string) *CancelStorageMaintenanceParams { p := &CancelStorageMaintenanceParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *StoragePoolService) NewCancelStorageMaintenanceParams(id string) *CancelStorageMaintenanceParams { p := &CancelStorageMaintenanceParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "StoragePoolService", ")", "NewCancelStorageMaintenanceParams", "(", "id", "string", ")", "*", "CancelStorageMaintenanceParams", "{", "p", ":=", "&", "CancelStorageMaintenanceParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new CancelStorageMaintenanceParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "CancelStorageMaintenanceParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/StoragePoolService.go#L50-L55
train
xanzy/go-cloudstack
cloudstack/StoragePoolService.go
NewEnableStorageMaintenanceParams
func (s *StoragePoolService) NewEnableStorageMaintenanceParams(id string) *EnableStorageMaintenanceParams { p := &EnableStorageMaintenanceParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *StoragePoolService) NewEnableStorageMaintenanceParams(id string) *EnableStorageMaintenanceParams { p := &EnableStorageMaintenanceParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "StoragePoolService", ")", "NewEnableStorageMaintenanceParams", "(", "id", "string", ")", "*", "EnableStorageMaintenanceParams", "{", "p", ":=", "&", "EnableStorageMaintenanceParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new EnableStorageMaintenanceParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "EnableStorageMaintenanceParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/StoragePoolService.go#L146-L151
train
xanzy/go-cloudstack
cloudstack/StoragePoolService.go
NewListStorageProvidersParams
func (s *StoragePoolService) NewListStorageProvidersParams(storagePoolType string) *ListStorageProvidersParams { p := &ListStorageProvidersParams{} p.p = make(map[string]interface{}) p.p["type"] = storagePoolType return p }
go
func (s *StoragePoolService) NewListStorageProvidersParams(storagePoolType string) *ListStorageProvidersParams { p := &ListStorageProvidersParams{} p.p = make(map[string]interface{}) p.p["type"] = storagePoolType return p }
[ "func", "(", "s", "*", "StoragePoolService", ")", "NewListStorageProvidersParams", "(", "storagePoolType", "string", ")", "*", "ListStorageProvidersParams", "{", "p", ":=", "&", "ListStorageProvidersParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "storagePoolType", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListStorageProvidersParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListStorageProvidersParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/StoragePoolService.go#L277-L282
train
xanzy/go-cloudstack
cloudstack/GuestOSService.go
NewAddGuestOsParams
func (s *GuestOSService) NewAddGuestOsParams(details map[string]string, oscategoryid string, osdisplayname string) *AddGuestOsParams { p := &AddGuestOsParams{} p.p = make(map[string]interface{}) p.p["details"] = details p.p["oscategoryid"] = oscategoryid p.p["osdisplayname"] = osdisplayname return p }
go
func (s *GuestOSService) NewAddGuestOsParams(details map[string]string, oscategoryid string, osdisplayname string) *AddGuestOsParams { p := &AddGuestOsParams{} p.p = make(map[string]interface{}) p.p["details"] = details p.p["oscategoryid"] = oscategoryid p.p["osdisplayname"] = osdisplayname return p }
[ "func", "(", "s", "*", "GuestOSService", ")", "NewAddGuestOsParams", "(", "details", "map", "[", "string", "]", "string", ",", "oscategoryid", "string", ",", "osdisplayname", "string", ")", "*", "AddGuestOsParams", "{", "p", ":=", "&", "AddGuestOsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "details", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "oscategoryid", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "osdisplayname", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new AddGuestOsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "AddGuestOsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/GuestOSService.go#L89-L96
train
xanzy/go-cloudstack
cloudstack/GuestOSService.go
AddGuestOs
func (s *GuestOSService) AddGuestOs(p *AddGuestOsParams) (*AddGuestOsResponse, error) { resp, err := s.cs.newRequest("addGuestOs", p.toURLValues()) if err != nil { return nil, err } var r AddGuestOsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *GuestOSService) AddGuestOs(p *AddGuestOsParams) (*AddGuestOsResponse, error) { resp, err := s.cs.newRequest("addGuestOs", p.toURLValues()) if err != nil { return nil, err } var r AddGuestOsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "GuestOSService", ")", "AddGuestOs", "(", "p", "*", "AddGuestOsParams", ")", "(", "*", "AddGuestOsResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "AddGuestOsResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "b", ",", "err", "=", "getRawValue", "(", "b", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Add a new guest OS type
[ "Add", "a", "new", "guest", "OS", "type" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/GuestOSService.go#L99-L131
train
xanzy/go-cloudstack
cloudstack/GuestOSService.go
NewAddGuestOsMappingParams
func (s *GuestOSService) NewAddGuestOsMappingParams(hypervisor string, hypervisorversion string, osnameforhypervisor string) *AddGuestOsMappingParams { p := &AddGuestOsMappingParams{} p.p = make(map[string]interface{}) p.p["hypervisor"] = hypervisor p.p["hypervisorversion"] = hypervisorversion p.p["osnameforhypervisor"] = osnameforhypervisor return p }
go
func (s *GuestOSService) NewAddGuestOsMappingParams(hypervisor string, hypervisorversion string, osnameforhypervisor string) *AddGuestOsMappingParams { p := &AddGuestOsMappingParams{} p.p = make(map[string]interface{}) p.p["hypervisor"] = hypervisor p.p["hypervisorversion"] = hypervisorversion p.p["osnameforhypervisor"] = osnameforhypervisor return p }
[ "func", "(", "s", "*", "GuestOSService", ")", "NewAddGuestOsMappingParams", "(", "hypervisor", "string", ",", "hypervisorversion", "string", ",", "osnameforhypervisor", "string", ")", "*", "AddGuestOsMappingParams", "{", "p", ":=", "&", "AddGuestOsMappingParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "hypervisor", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "hypervisorversion", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "osnameforhypervisor", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new AddGuestOsMappingParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "AddGuestOsMappingParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/GuestOSService.go#L210-L217
train
xanzy/go-cloudstack
cloudstack/GuestOSService.go
AddGuestOsMapping
func (s *GuestOSService) AddGuestOsMapping(p *AddGuestOsMappingParams) (*AddGuestOsMappingResponse, error) { resp, err := s.cs.newRequest("addGuestOsMapping", p.toURLValues()) if err != nil { return nil, err } var r AddGuestOsMappingResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *GuestOSService) AddGuestOsMapping(p *AddGuestOsMappingParams) (*AddGuestOsMappingResponse, error) { resp, err := s.cs.newRequest("addGuestOsMapping", p.toURLValues()) if err != nil { return nil, err } var r AddGuestOsMappingResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "GuestOSService", ")", "AddGuestOsMapping", "(", "p", "*", "AddGuestOsMappingParams", ")", "(", "*", "AddGuestOsMappingResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "AddGuestOsMappingResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "b", ",", "err", "=", "getRawValue", "(", "b", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Adds a guest OS name to hypervisor OS name mapping
[ "Adds", "a", "guest", "OS", "name", "to", "hypervisor", "OS", "name", "mapping" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/GuestOSService.go#L220-L252
train