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/NATService.go | NewCreateIpForwardingRuleParams | func (s *NATService) NewCreateIpForwardingRuleParams(ipaddressid string, protocol string, startport int) *CreateIpForwardingRuleParams {
p := &CreateIpForwardingRuleParams{}
p.p = make(map[string]interface{})
p.p["ipaddressid"] = ipaddressid
p.p["protocol"] = protocol
p.p["startport"] = startport
return p
} | go | func (s *NATService) NewCreateIpForwardingRuleParams(ipaddressid string, protocol string, startport int) *CreateIpForwardingRuleParams {
p := &CreateIpForwardingRuleParams{}
p.p = make(map[string]interface{})
p.p["ipaddressid"] = ipaddressid
p.p["protocol"] = protocol
p.p["startport"] = startport
return p
} | [
"func",
"(",
"s",
"*",
"NATService",
")",
"NewCreateIpForwardingRuleParams",
"(",
"ipaddressid",
"string",
",",
"protocol",
"string",
",",
"startport",
"int",
")",
"*",
"CreateIpForwardingRuleParams",
"{",
"p",
":=",
"&",
"CreateIpForwardingRuleParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"ipaddressid",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"protocol",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"startport",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new CreateIpForwardingRuleParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"CreateIpForwardingRuleParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L111-L118 | train |
xanzy/go-cloudstack | cloudstack/NATService.go | CreateIpForwardingRule | func (s *NATService) CreateIpForwardingRule(p *CreateIpForwardingRuleParams) (*CreateIpForwardingRuleResponse, error) {
resp, err := s.cs.newRequest("createIpForwardingRule", p.toURLValues())
if err != nil {
return nil, err
}
var r CreateIpForwardingRuleResponse
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 *NATService) CreateIpForwardingRule(p *CreateIpForwardingRuleParams) (*CreateIpForwardingRuleResponse, error) {
resp, err := s.cs.newRequest("createIpForwardingRule", p.toURLValues())
if err != nil {
return nil, err
}
var r CreateIpForwardingRuleResponse
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",
"*",
"NATService",
")",
"CreateIpForwardingRule",
"(",
"p",
"*",
"CreateIpForwardingRuleParams",
")",
"(",
"*",
"CreateIpForwardingRuleResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"CreateIpForwardingRuleResponse",
"\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",
"}"
] | // Creates an IP forwarding rule | [
"Creates",
"an",
"IP",
"forwarding",
"rule"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L121-L153 | train |
xanzy/go-cloudstack | cloudstack/NATService.go | NewDeleteIpForwardingRuleParams | func (s *NATService) NewDeleteIpForwardingRuleParams(id string) *DeleteIpForwardingRuleParams {
p := &DeleteIpForwardingRuleParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *NATService) NewDeleteIpForwardingRuleParams(id string) *DeleteIpForwardingRuleParams {
p := &DeleteIpForwardingRuleParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"NATService",
")",
"NewDeleteIpForwardingRuleParams",
"(",
"id",
"string",
")",
"*",
"DeleteIpForwardingRuleParams",
"{",
"p",
":=",
"&",
"DeleteIpForwardingRuleParams",
"{",
"}",
"\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 DeleteIpForwardingRuleParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"DeleteIpForwardingRuleParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L201-L206 | train |
xanzy/go-cloudstack | cloudstack/NATService.go | DeleteIpForwardingRule | func (s *NATService) DeleteIpForwardingRule(p *DeleteIpForwardingRuleParams) (*DeleteIpForwardingRuleResponse, error) {
resp, err := s.cs.newRequest("deleteIpForwardingRule", p.toURLValues())
if err != nil {
return nil, err
}
var r DeleteIpForwardingRuleResponse
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 *NATService) DeleteIpForwardingRule(p *DeleteIpForwardingRuleParams) (*DeleteIpForwardingRuleResponse, error) {
resp, err := s.cs.newRequest("deleteIpForwardingRule", p.toURLValues())
if err != nil {
return nil, err
}
var r DeleteIpForwardingRuleResponse
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",
"*",
"NATService",
")",
"DeleteIpForwardingRule",
"(",
"p",
"*",
"DeleteIpForwardingRuleParams",
")",
"(",
"*",
"DeleteIpForwardingRuleResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"DeleteIpForwardingRuleResponse",
"\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",
"}"
] | // Deletes an IP forwarding rule | [
"Deletes",
"an",
"IP",
"forwarding",
"rule"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L209-L236 | train |
xanzy/go-cloudstack | cloudstack/NATService.go | NewDisableStaticNatParams | func (s *NATService) NewDisableStaticNatParams(ipaddressid string) *DisableStaticNatParams {
p := &DisableStaticNatParams{}
p.p = make(map[string]interface{})
p.p["ipaddressid"] = ipaddressid
return p
} | go | func (s *NATService) NewDisableStaticNatParams(ipaddressid string) *DisableStaticNatParams {
p := &DisableStaticNatParams{}
p.p = make(map[string]interface{})
p.p["ipaddressid"] = ipaddressid
return p
} | [
"func",
"(",
"s",
"*",
"NATService",
")",
"NewDisableStaticNatParams",
"(",
"ipaddressid",
"string",
")",
"*",
"DisableStaticNatParams",
"{",
"p",
":=",
"&",
"DisableStaticNatParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"ipaddressid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new DisableStaticNatParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"DisableStaticNatParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L269-L274 | train |
xanzy/go-cloudstack | cloudstack/NATService.go | DisableStaticNat | func (s *NATService) DisableStaticNat(p *DisableStaticNatParams) (*DisableStaticNatResponse, error) {
resp, err := s.cs.newRequest("disableStaticNat", p.toURLValues())
if err != nil {
return nil, err
}
var r DisableStaticNatResponse
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 *NATService) DisableStaticNat(p *DisableStaticNatParams) (*DisableStaticNatResponse, error) {
resp, err := s.cs.newRequest("disableStaticNat", p.toURLValues())
if err != nil {
return nil, err
}
var r DisableStaticNatResponse
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",
"*",
"NATService",
")",
"DisableStaticNat",
"(",
"p",
"*",
"DisableStaticNatParams",
")",
"(",
"*",
"DisableStaticNatResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"DisableStaticNatResponse",
"\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",
"}"
] | // Disables static rule for given IP address | [
"Disables",
"static",
"rule",
"for",
"given",
"IP",
"address"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L277-L304 | train |
xanzy/go-cloudstack | cloudstack/NATService.go | NewEnableStaticNatParams | func (s *NATService) NewEnableStaticNatParams(ipaddressid string, virtualmachineid string) *EnableStaticNatParams {
p := &EnableStaticNatParams{}
p.p = make(map[string]interface{})
p.p["ipaddressid"] = ipaddressid
p.p["virtualmachineid"] = virtualmachineid
return p
} | go | func (s *NATService) NewEnableStaticNatParams(ipaddressid string, virtualmachineid string) *EnableStaticNatParams {
p := &EnableStaticNatParams{}
p.p = make(map[string]interface{})
p.p["ipaddressid"] = ipaddressid
p.p["virtualmachineid"] = virtualmachineid
return p
} | [
"func",
"(",
"s",
"*",
"NATService",
")",
"NewEnableStaticNatParams",
"(",
"ipaddressid",
"string",
",",
"virtualmachineid",
"string",
")",
"*",
"EnableStaticNatParams",
"{",
"p",
":=",
"&",
"EnableStaticNatParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"ipaddressid",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"virtualmachineid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new EnableStaticNatParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"EnableStaticNatParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L370-L376 | train |
xanzy/go-cloudstack | cloudstack/NATService.go | EnableStaticNat | func (s *NATService) EnableStaticNat(p *EnableStaticNatParams) (*EnableStaticNatResponse, error) {
resp, err := s.cs.newRequest("enableStaticNat", p.toURLValues())
if err != nil {
return nil, err
}
var r EnableStaticNatResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | go | func (s *NATService) EnableStaticNat(p *EnableStaticNatParams) (*EnableStaticNatResponse, error) {
resp, err := s.cs.newRequest("enableStaticNat", p.toURLValues())
if err != nil {
return nil, err
}
var r EnableStaticNatResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | [
"func",
"(",
"s",
"*",
"NATService",
")",
"EnableStaticNat",
"(",
"p",
"*",
"EnableStaticNatParams",
")",
"(",
"*",
"EnableStaticNatResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"EnableStaticNatResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"resp",
",",
"&",
"r",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"r",
",",
"nil",
"\n",
"}"
] | // Enables static NAT for given IP address | [
"Enables",
"static",
"NAT",
"for",
"given",
"IP",
"address"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L379-L391 | train |
xanzy/go-cloudstack | cloudstack/NATService.go | NewListIpForwardingRulesParams | func (s *NATService) NewListIpForwardingRulesParams() *ListIpForwardingRulesParams {
p := &ListIpForwardingRulesParams{}
p.p = make(map[string]interface{})
return p
} | go | func (s *NATService) NewListIpForwardingRulesParams() *ListIpForwardingRulesParams {
p := &ListIpForwardingRulesParams{}
p.p = make(map[string]interface{})
return p
} | [
"func",
"(",
"s",
"*",
"NATService",
")",
"NewListIpForwardingRulesParams",
"(",
")",
"*",
"ListIpForwardingRulesParams",
"{",
"p",
":=",
"&",
"ListIpForwardingRulesParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new ListIpForwardingRulesParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"ListIpForwardingRulesParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L556-L560 | train |
xanzy/go-cloudstack | cloudstack/NATService.go | ListIpForwardingRules | func (s *NATService) ListIpForwardingRules(p *ListIpForwardingRulesParams) (*ListIpForwardingRulesResponse, error) {
resp, err := s.cs.newRequest("listIpForwardingRules", p.toURLValues())
if err != nil {
return nil, err
}
var r ListIpForwardingRulesResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | go | func (s *NATService) ListIpForwardingRules(p *ListIpForwardingRulesParams) (*ListIpForwardingRulesResponse, error) {
resp, err := s.cs.newRequest("listIpForwardingRules", p.toURLValues())
if err != nil {
return nil, err
}
var r ListIpForwardingRulesResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | [
"func",
"(",
"s",
"*",
"NATService",
")",
"ListIpForwardingRules",
"(",
"p",
"*",
"ListIpForwardingRulesParams",
")",
"(",
"*",
"ListIpForwardingRulesResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"ListIpForwardingRulesResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"resp",
",",
"&",
"r",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"r",
",",
"nil",
"\n",
"}"
] | // List the IP forwarding rules | [
"List",
"the",
"IP",
"forwarding",
"rules"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L596-L608 | train |
xanzy/go-cloudstack | cloudstack/NuageVSPService.go | NewAddNuageVspDeviceParams | func (s *NuageVSPService) NewAddNuageVspDeviceParams(hostname string, password string, physicalnetworkid string, port int, username string) *AddNuageVspDeviceParams {
p := &AddNuageVspDeviceParams{}
p.p = make(map[string]interface{})
p.p["hostname"] = hostname
p.p["password"] = password
p.p["physicalnetworkid"] = physicalnetworkid
p.p["port"] = port
p.p["username"] = username
return p
} | go | func (s *NuageVSPService) NewAddNuageVspDeviceParams(hostname string, password string, physicalnetworkid string, port int, username string) *AddNuageVspDeviceParams {
p := &AddNuageVspDeviceParams{}
p.p = make(map[string]interface{})
p.p["hostname"] = hostname
p.p["password"] = password
p.p["physicalnetworkid"] = physicalnetworkid
p.p["port"] = port
p.p["username"] = username
return p
} | [
"func",
"(",
"s",
"*",
"NuageVSPService",
")",
"NewAddNuageVspDeviceParams",
"(",
"hostname",
"string",
",",
"password",
"string",
",",
"physicalnetworkid",
"string",
",",
"port",
"int",
",",
"username",
"string",
")",
"*",
"AddNuageVspDeviceParams",
"{",
"p",
":=",
"&",
"AddNuageVspDeviceParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"hostname",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"password",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"physicalnetworkid",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"port",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"username",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new AddNuageVspDeviceParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"AddNuageVspDeviceParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NuageVSPService.go#L130-L139 | train |
xanzy/go-cloudstack | cloudstack/NuageVSPService.go | AddNuageVspDevice | func (s *NuageVSPService) AddNuageVspDevice(p *AddNuageVspDeviceParams) (*AddNuageVspDeviceResponse, error) {
resp, err := s.cs.newRequest("addNuageVspDevice", p.toURLValues())
if err != nil {
return nil, err
}
var r AddNuageVspDeviceResponse
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 *NuageVSPService) AddNuageVspDevice(p *AddNuageVspDeviceParams) (*AddNuageVspDeviceResponse, error) {
resp, err := s.cs.newRequest("addNuageVspDevice", p.toURLValues())
if err != nil {
return nil, err
}
var r AddNuageVspDeviceResponse
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",
"*",
"NuageVSPService",
")",
"AddNuageVspDevice",
"(",
"p",
"*",
"AddNuageVspDeviceParams",
")",
"(",
"*",
"AddNuageVspDeviceResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"AddNuageVspDeviceResponse",
"\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 Nuage VSP device | [
"Adds",
"a",
"Nuage",
"VSP",
"device"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NuageVSPService.go#L142-L174 | train |
xanzy/go-cloudstack | cloudstack/NuageVSPService.go | NewDeleteNuageVspDeviceParams | func (s *NuageVSPService) NewDeleteNuageVspDeviceParams(vspdeviceid string) *DeleteNuageVspDeviceParams {
p := &DeleteNuageVspDeviceParams{}
p.p = make(map[string]interface{})
p.p["vspdeviceid"] = vspdeviceid
return p
} | go | func (s *NuageVSPService) NewDeleteNuageVspDeviceParams(vspdeviceid string) *DeleteNuageVspDeviceParams {
p := &DeleteNuageVspDeviceParams{}
p.p = make(map[string]interface{})
p.p["vspdeviceid"] = vspdeviceid
return p
} | [
"func",
"(",
"s",
"*",
"NuageVSPService",
")",
"NewDeleteNuageVspDeviceParams",
"(",
"vspdeviceid",
"string",
")",
"*",
"DeleteNuageVspDeviceParams",
"{",
"p",
":=",
"&",
"DeleteNuageVspDeviceParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"vspdeviceid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new DeleteNuageVspDeviceParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"DeleteNuageVspDeviceParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NuageVSPService.go#L215-L220 | train |
xanzy/go-cloudstack | cloudstack/NuageVSPService.go | DeleteNuageVspDevice | func (s *NuageVSPService) DeleteNuageVspDevice(p *DeleteNuageVspDeviceParams) (*DeleteNuageVspDeviceResponse, error) {
resp, err := s.cs.newRequest("deleteNuageVspDevice", p.toURLValues())
if err != nil {
return nil, err
}
var r DeleteNuageVspDeviceResponse
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 *NuageVSPService) DeleteNuageVspDevice(p *DeleteNuageVspDeviceParams) (*DeleteNuageVspDeviceResponse, error) {
resp, err := s.cs.newRequest("deleteNuageVspDevice", p.toURLValues())
if err != nil {
return nil, err
}
var r DeleteNuageVspDeviceResponse
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",
"*",
"NuageVSPService",
")",
"DeleteNuageVspDevice",
"(",
"p",
"*",
"DeleteNuageVspDeviceParams",
")",
"(",
"*",
"DeleteNuageVspDeviceResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"DeleteNuageVspDeviceResponse",
"\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 nuage vsp device | [
"delete",
"a",
"nuage",
"vsp",
"device"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NuageVSPService.go#L223-L250 | train |
xanzy/go-cloudstack | cloudstack/NuageVSPService.go | NewListNuageVspDevicesParams | func (s *NuageVSPService) NewListNuageVspDevicesParams() *ListNuageVspDevicesParams {
p := &ListNuageVspDevicesParams{}
p.p = make(map[string]interface{})
return p
} | go | func (s *NuageVSPService) NewListNuageVspDevicesParams() *ListNuageVspDevicesParams {
p := &ListNuageVspDevicesParams{}
p.p = make(map[string]interface{})
return p
} | [
"func",
"(",
"s",
"*",
"NuageVSPService",
")",
"NewListNuageVspDevicesParams",
"(",
")",
"*",
"ListNuageVspDevicesParams",
"{",
"p",
":=",
"&",
"ListNuageVspDevicesParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new ListNuageVspDevicesParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"ListNuageVspDevicesParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NuageVSPService.go#L329-L333 | train |
xanzy/go-cloudstack | cloudstack/NuageVSPService.go | ListNuageVspDevices | func (s *NuageVSPService) ListNuageVspDevices(p *ListNuageVspDevicesParams) (*ListNuageVspDevicesResponse, error) {
resp, err := s.cs.newRequest("listNuageVspDevices", p.toURLValues())
if err != nil {
return nil, err
}
var r ListNuageVspDevicesResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | go | func (s *NuageVSPService) ListNuageVspDevices(p *ListNuageVspDevicesParams) (*ListNuageVspDevicesResponse, error) {
resp, err := s.cs.newRequest("listNuageVspDevices", p.toURLValues())
if err != nil {
return nil, err
}
var r ListNuageVspDevicesResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | [
"func",
"(",
"s",
"*",
"NuageVSPService",
")",
"ListNuageVspDevices",
"(",
"p",
"*",
"ListNuageVspDevicesParams",
")",
"(",
"*",
"ListNuageVspDevicesResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"ListNuageVspDevicesResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"resp",
",",
"&",
"r",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"r",
",",
"nil",
"\n",
"}"
] | // Lists Nuage VSP devices | [
"Lists",
"Nuage",
"VSP",
"devices"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NuageVSPService.go#L336-L348 | train |
xanzy/go-cloudstack | cloudstack/NuageVSPService.go | NewUpdateNuageVspDeviceParams | func (s *NuageVSPService) NewUpdateNuageVspDeviceParams(physicalnetworkid string) *UpdateNuageVspDeviceParams {
p := &UpdateNuageVspDeviceParams{}
p.p = make(map[string]interface{})
p.p["physicalnetworkid"] = physicalnetworkid
return p
} | go | func (s *NuageVSPService) NewUpdateNuageVspDeviceParams(physicalnetworkid string) *UpdateNuageVspDeviceParams {
p := &UpdateNuageVspDeviceParams{}
p.p = make(map[string]interface{})
p.p["physicalnetworkid"] = physicalnetworkid
return p
} | [
"func",
"(",
"s",
"*",
"NuageVSPService",
")",
"NewUpdateNuageVspDeviceParams",
"(",
"physicalnetworkid",
"string",
")",
"*",
"UpdateNuageVspDeviceParams",
"{",
"p",
":=",
"&",
"UpdateNuageVspDeviceParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"physicalnetworkid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new UpdateNuageVspDeviceParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"UpdateNuageVspDeviceParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NuageVSPService.go#L473-L478 | train |
xanzy/go-cloudstack | cloudstack/NuageVSPService.go | UpdateNuageVspDevice | func (s *NuageVSPService) UpdateNuageVspDevice(p *UpdateNuageVspDeviceParams) (*UpdateNuageVspDeviceResponse, error) {
resp, err := s.cs.newRequest("updateNuageVspDevice", p.toURLValues())
if err != nil {
return nil, err
}
var r UpdateNuageVspDeviceResponse
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 *NuageVSPService) UpdateNuageVspDevice(p *UpdateNuageVspDeviceParams) (*UpdateNuageVspDeviceResponse, error) {
resp, err := s.cs.newRequest("updateNuageVspDevice", p.toURLValues())
if err != nil {
return nil, err
}
var r UpdateNuageVspDeviceResponse
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",
"*",
"NuageVSPService",
")",
"UpdateNuageVspDevice",
"(",
"p",
"*",
"UpdateNuageVspDeviceParams",
")",
"(",
"*",
"UpdateNuageVspDeviceResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"UpdateNuageVspDeviceResponse",
"\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 a Nuage VSP device | [
"Update",
"a",
"Nuage",
"VSP",
"device"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NuageVSPService.go#L481-L513 | train |
xanzy/go-cloudstack | cloudstack/SecurityGroupService.go | NewAuthorizeSecurityGroupEgressParams | func (s *SecurityGroupService) NewAuthorizeSecurityGroupEgressParams() *AuthorizeSecurityGroupEgressParams {
p := &AuthorizeSecurityGroupEgressParams{}
p.p = make(map[string]interface{})
return p
} | go | func (s *SecurityGroupService) NewAuthorizeSecurityGroupEgressParams() *AuthorizeSecurityGroupEgressParams {
p := &AuthorizeSecurityGroupEgressParams{}
p.p = make(map[string]interface{})
return p
} | [
"func",
"(",
"s",
"*",
"SecurityGroupService",
")",
"NewAuthorizeSecurityGroupEgressParams",
"(",
")",
"*",
"AuthorizeSecurityGroupEgressParams",
"{",
"p",
":=",
"&",
"AuthorizeSecurityGroupEgressParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new AuthorizeSecurityGroupEgressParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"AuthorizeSecurityGroupEgressParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SecurityGroupService.go#L215-L219 | train |
xanzy/go-cloudstack | cloudstack/SecurityGroupService.go | NewAuthorizeSecurityGroupIngressParams | func (s *SecurityGroupService) NewAuthorizeSecurityGroupIngressParams() *AuthorizeSecurityGroupIngressParams {
p := &AuthorizeSecurityGroupIngressParams{}
p.p = make(map[string]interface{})
return p
} | go | func (s *SecurityGroupService) NewAuthorizeSecurityGroupIngressParams() *AuthorizeSecurityGroupIngressParams {
p := &AuthorizeSecurityGroupIngressParams{}
p.p = make(map[string]interface{})
return p
} | [
"func",
"(",
"s",
"*",
"SecurityGroupService",
")",
"NewAuthorizeSecurityGroupIngressParams",
"(",
")",
"*",
"AuthorizeSecurityGroupIngressParams",
"{",
"p",
":=",
"&",
"AuthorizeSecurityGroupIngressParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new AuthorizeSecurityGroupIngressParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"AuthorizeSecurityGroupIngressParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SecurityGroupService.go#L431-L435 | train |
xanzy/go-cloudstack | cloudstack/SecurityGroupService.go | NewCreateSecurityGroupParams | func (s *SecurityGroupService) NewCreateSecurityGroupParams(name string) *CreateSecurityGroupParams {
p := &CreateSecurityGroupParams{}
p.p = make(map[string]interface{})
p.p["name"] = name
return p
} | go | func (s *SecurityGroupService) NewCreateSecurityGroupParams(name string) *CreateSecurityGroupParams {
p := &CreateSecurityGroupParams{}
p.p = make(map[string]interface{})
p.p["name"] = name
return p
} | [
"func",
"(",
"s",
"*",
"SecurityGroupService",
")",
"NewCreateSecurityGroupParams",
"(",
"name",
"string",
")",
"*",
"CreateSecurityGroupParams",
"{",
"p",
":=",
"&",
"CreateSecurityGroupParams",
"{",
"}",
"\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 CreateSecurityGroupParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"CreateSecurityGroupParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SecurityGroupService.go#L560-L565 | train |
xanzy/go-cloudstack | cloudstack/SecurityGroupService.go | NewDeleteSecurityGroupParams | func (s *SecurityGroupService) NewDeleteSecurityGroupParams() *DeleteSecurityGroupParams {
p := &DeleteSecurityGroupParams{}
p.p = make(map[string]interface{})
return p
} | go | func (s *SecurityGroupService) NewDeleteSecurityGroupParams() *DeleteSecurityGroupParams {
p := &DeleteSecurityGroupParams{}
p.p = make(map[string]interface{})
return p
} | [
"func",
"(",
"s",
"*",
"SecurityGroupService",
")",
"NewDeleteSecurityGroupParams",
"(",
")",
"*",
"DeleteSecurityGroupParams",
"{",
"p",
":=",
"&",
"DeleteSecurityGroupParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new DeleteSecurityGroupParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"DeleteSecurityGroupParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SecurityGroupService.go#L684-L688 | train |
xanzy/go-cloudstack | cloudstack/SecurityGroupService.go | NewListSecurityGroupsParams | func (s *SecurityGroupService) NewListSecurityGroupsParams() *ListSecurityGroupsParams {
p := &ListSecurityGroupsParams{}
p.p = make(map[string]interface{})
return p
} | go | func (s *SecurityGroupService) NewListSecurityGroupsParams() *ListSecurityGroupsParams {
p := &ListSecurityGroupsParams{}
p.p = make(map[string]interface{})
return p
} | [
"func",
"(",
"s",
"*",
"SecurityGroupService",
")",
"NewListSecurityGroupsParams",
"(",
")",
"*",
"ListSecurityGroupsParams",
"{",
"p",
":=",
"&",
"ListSecurityGroupsParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new ListSecurityGroupsParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"ListSecurityGroupsParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SecurityGroupService.go#L884-L888 | train |
xanzy/go-cloudstack | cloudstack/SecurityGroupService.go | NewRevokeSecurityGroupEgressParams | func (s *SecurityGroupService) NewRevokeSecurityGroupEgressParams(id string) *RevokeSecurityGroupEgressParams {
p := &RevokeSecurityGroupEgressParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *SecurityGroupService) NewRevokeSecurityGroupEgressParams(id string) *RevokeSecurityGroupEgressParams {
p := &RevokeSecurityGroupEgressParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"SecurityGroupService",
")",
"NewRevokeSecurityGroupEgressParams",
"(",
"id",
"string",
")",
"*",
"RevokeSecurityGroupEgressParams",
"{",
"p",
":=",
"&",
"RevokeSecurityGroupEgressParams",
"{",
"}",
"\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 RevokeSecurityGroupEgressParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"RevokeSecurityGroupEgressParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SecurityGroupService.go#L1047-L1052 | train |
xanzy/go-cloudstack | cloudstack/SecurityGroupService.go | NewRevokeSecurityGroupIngressParams | func (s *SecurityGroupService) NewRevokeSecurityGroupIngressParams(id string) *RevokeSecurityGroupIngressParams {
p := &RevokeSecurityGroupIngressParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *SecurityGroupService) NewRevokeSecurityGroupIngressParams(id string) *RevokeSecurityGroupIngressParams {
p := &RevokeSecurityGroupIngressParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"SecurityGroupService",
")",
"NewRevokeSecurityGroupIngressParams",
"(",
"id",
"string",
")",
"*",
"RevokeSecurityGroupIngressParams",
"{",
"p",
":=",
"&",
"RevokeSecurityGroupIngressParams",
"{",
"}",
"\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 RevokeSecurityGroupIngressParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"RevokeSecurityGroupIngressParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SecurityGroupService.go#L1115-L1120 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | NewAddTrafficMonitorParams | func (s *UsageService) NewAddTrafficMonitorParams(url string, zoneid string) *AddTrafficMonitorParams {
p := &AddTrafficMonitorParams{}
p.p = make(map[string]interface{})
p.p["url"] = url
p.p["zoneid"] = zoneid
return p
} | go | func (s *UsageService) NewAddTrafficMonitorParams(url string, zoneid string) *AddTrafficMonitorParams {
p := &AddTrafficMonitorParams{}
p.p = make(map[string]interface{})
p.p["url"] = url
p.p["zoneid"] = zoneid
return p
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"NewAddTrafficMonitorParams",
"(",
"url",
"string",
",",
"zoneid",
"string",
")",
"*",
"AddTrafficMonitorParams",
"{",
"p",
":=",
"&",
"AddTrafficMonitorParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"url",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"zoneid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new AddTrafficMonitorParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"AddTrafficMonitorParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L84-L90 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | AddTrafficMonitor | func (s *UsageService) AddTrafficMonitor(p *AddTrafficMonitorParams) (*AddTrafficMonitorResponse, error) {
resp, err := s.cs.newRequest("addTrafficMonitor", p.toURLValues())
if err != nil {
return nil, err
}
var r AddTrafficMonitorResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | go | func (s *UsageService) AddTrafficMonitor(p *AddTrafficMonitorParams) (*AddTrafficMonitorResponse, error) {
resp, err := s.cs.newRequest("addTrafficMonitor", p.toURLValues())
if err != nil {
return nil, err
}
var r AddTrafficMonitorResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"AddTrafficMonitor",
"(",
"p",
"*",
"AddTrafficMonitorParams",
")",
"(",
"*",
"AddTrafficMonitorResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"AddTrafficMonitorResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"resp",
",",
"&",
"r",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"r",
",",
"nil",
"\n",
"}"
] | // Adds Traffic Monitor Host for Direct Network Usage | [
"Adds",
"Traffic",
"Monitor",
"Host",
"for",
"Direct",
"Network",
"Usage"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L93-L105 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | NewAddTrafficTypeParams | func (s *UsageService) NewAddTrafficTypeParams(physicalnetworkid string, traffictype string) *AddTrafficTypeParams {
p := &AddTrafficTypeParams{}
p.p = make(map[string]interface{})
p.p["physicalnetworkid"] = physicalnetworkid
p.p["traffictype"] = traffictype
return p
} | go | func (s *UsageService) NewAddTrafficTypeParams(physicalnetworkid string, traffictype string) *AddTrafficTypeParams {
p := &AddTrafficTypeParams{}
p.p = make(map[string]interface{})
p.p["physicalnetworkid"] = physicalnetworkid
p.p["traffictype"] = traffictype
return p
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"NewAddTrafficTypeParams",
"(",
"physicalnetworkid",
"string",
",",
"traffictype",
"string",
")",
"*",
"AddTrafficTypeParams",
"{",
"p",
":=",
"&",
"AddTrafficTypeParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"physicalnetworkid",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"traffictype",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new AddTrafficTypeParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"AddTrafficTypeParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L228-L234 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | AddTrafficType | func (s *UsageService) AddTrafficType(p *AddTrafficTypeParams) (*AddTrafficTypeResponse, error) {
resp, err := s.cs.newRequest("addTrafficType", p.toURLValues())
if err != nil {
return nil, err
}
var r AddTrafficTypeResponse
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 *UsageService) AddTrafficType(p *AddTrafficTypeParams) (*AddTrafficTypeResponse, error) {
resp, err := s.cs.newRequest("addTrafficType", p.toURLValues())
if err != nil {
return nil, err
}
var r AddTrafficTypeResponse
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",
"*",
"UsageService",
")",
"AddTrafficType",
"(",
"p",
"*",
"AddTrafficTypeParams",
")",
"(",
"*",
"AddTrafficTypeResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"AddTrafficTypeResponse",
"\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 traffic type to a physical network | [
"Adds",
"traffic",
"type",
"to",
"a",
"physical",
"network"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L237-L269 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | NewDeleteTrafficMonitorParams | func (s *UsageService) NewDeleteTrafficMonitorParams(id string) *DeleteTrafficMonitorParams {
p := &DeleteTrafficMonitorParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *UsageService) NewDeleteTrafficMonitorParams(id string) *DeleteTrafficMonitorParams {
p := &DeleteTrafficMonitorParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"NewDeleteTrafficMonitorParams",
"(",
"id",
"string",
")",
"*",
"DeleteTrafficMonitorParams",
"{",
"p",
":=",
"&",
"DeleteTrafficMonitorParams",
"{",
"}",
"\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 DeleteTrafficMonitorParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"DeleteTrafficMonitorParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L308-L313 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | DeleteTrafficMonitor | func (s *UsageService) DeleteTrafficMonitor(p *DeleteTrafficMonitorParams) (*DeleteTrafficMonitorResponse, error) {
resp, err := s.cs.newRequest("deleteTrafficMonitor", p.toURLValues())
if err != nil {
return nil, err
}
var r DeleteTrafficMonitorResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | go | func (s *UsageService) DeleteTrafficMonitor(p *DeleteTrafficMonitorParams) (*DeleteTrafficMonitorResponse, error) {
resp, err := s.cs.newRequest("deleteTrafficMonitor", p.toURLValues())
if err != nil {
return nil, err
}
var r DeleteTrafficMonitorResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"DeleteTrafficMonitor",
"(",
"p",
"*",
"DeleteTrafficMonitorParams",
")",
"(",
"*",
"DeleteTrafficMonitorResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"DeleteTrafficMonitorResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"resp",
",",
"&",
"r",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"r",
",",
"nil",
"\n",
"}"
] | // Deletes an traffic monitor host. | [
"Deletes",
"an",
"traffic",
"monitor",
"host",
"."
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L316-L328 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | NewDeleteTrafficTypeParams | func (s *UsageService) NewDeleteTrafficTypeParams(id string) *DeleteTrafficTypeParams {
p := &DeleteTrafficTypeParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *UsageService) NewDeleteTrafficTypeParams(id string) *DeleteTrafficTypeParams {
p := &DeleteTrafficTypeParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"NewDeleteTrafficTypeParams",
"(",
"id",
"string",
")",
"*",
"DeleteTrafficTypeParams",
"{",
"p",
":=",
"&",
"DeleteTrafficTypeParams",
"{",
"}",
"\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 DeleteTrafficTypeParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"DeleteTrafficTypeParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L379-L384 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | DeleteTrafficType | func (s *UsageService) DeleteTrafficType(p *DeleteTrafficTypeParams) (*DeleteTrafficTypeResponse, error) {
resp, err := s.cs.newRequest("deleteTrafficType", p.toURLValues())
if err != nil {
return nil, err
}
var r DeleteTrafficTypeResponse
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 *UsageService) DeleteTrafficType(p *DeleteTrafficTypeParams) (*DeleteTrafficTypeResponse, error) {
resp, err := s.cs.newRequest("deleteTrafficType", p.toURLValues())
if err != nil {
return nil, err
}
var r DeleteTrafficTypeResponse
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",
"*",
"UsageService",
")",
"DeleteTrafficType",
"(",
"p",
"*",
"DeleteTrafficTypeParams",
")",
"(",
"*",
"DeleteTrafficTypeResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"DeleteTrafficTypeResponse",
"\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",
"}"
] | // Deletes traffic type of a physical network | [
"Deletes",
"traffic",
"type",
"of",
"a",
"physical",
"network"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L387-L414 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | NewGenerateUsageRecordsParams | func (s *UsageService) NewGenerateUsageRecordsParams(enddate string, startdate string) *GenerateUsageRecordsParams {
p := &GenerateUsageRecordsParams{}
p.p = make(map[string]interface{})
p.p["enddate"] = enddate
p.p["startdate"] = startdate
return p
} | go | func (s *UsageService) NewGenerateUsageRecordsParams(enddate string, startdate string) *GenerateUsageRecordsParams {
p := &GenerateUsageRecordsParams{}
p.p = make(map[string]interface{})
p.p["enddate"] = enddate
p.p["startdate"] = startdate
return p
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"NewGenerateUsageRecordsParams",
"(",
"enddate",
"string",
",",
"startdate",
"string",
")",
"*",
"GenerateUsageRecordsParams",
"{",
"p",
":=",
"&",
"GenerateUsageRecordsParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"enddate",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"startdate",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new GenerateUsageRecordsParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"GenerateUsageRecordsParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L469-L475 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | GenerateUsageRecords | func (s *UsageService) GenerateUsageRecords(p *GenerateUsageRecordsParams) (*GenerateUsageRecordsResponse, error) {
resp, err := s.cs.newRequest("generateUsageRecords", p.toURLValues())
if err != nil {
return nil, err
}
var r GenerateUsageRecordsResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | go | func (s *UsageService) GenerateUsageRecords(p *GenerateUsageRecordsParams) (*GenerateUsageRecordsResponse, error) {
resp, err := s.cs.newRequest("generateUsageRecords", p.toURLValues())
if err != nil {
return nil, err
}
var r GenerateUsageRecordsResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"GenerateUsageRecords",
"(",
"p",
"*",
"GenerateUsageRecordsParams",
")",
"(",
"*",
"GenerateUsageRecordsResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"GenerateUsageRecordsResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"resp",
",",
"&",
"r",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"r",
",",
"nil",
"\n",
"}"
] | // Generates usage records. This will generate records only if there any records to be generated, i.e if the scheduled usage job was not run or failed | [
"Generates",
"usage",
"records",
".",
"This",
"will",
"generate",
"records",
"only",
"if",
"there",
"any",
"records",
"to",
"be",
"generated",
"i",
".",
"e",
"if",
"the",
"scheduled",
"usage",
"job",
"was",
"not",
"run",
"or",
"failed"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L478-L490 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | NewListTrafficMonitorsParams | func (s *UsageService) NewListTrafficMonitorsParams(zoneid string) *ListTrafficMonitorsParams {
p := &ListTrafficMonitorsParams{}
p.p = make(map[string]interface{})
p.p["zoneid"] = zoneid
return p
} | go | func (s *UsageService) NewListTrafficMonitorsParams(zoneid string) *ListTrafficMonitorsParams {
p := &ListTrafficMonitorsParams{}
p.p = make(map[string]interface{})
p.p["zoneid"] = zoneid
return p
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"NewListTrafficMonitorsParams",
"(",
"zoneid",
"string",
")",
"*",
"ListTrafficMonitorsParams",
"{",
"p",
":=",
"&",
"ListTrafficMonitorsParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"zoneid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new ListTrafficMonitorsParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"ListTrafficMonitorsParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L576-L581 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | ListTrafficMonitors | func (s *UsageService) ListTrafficMonitors(p *ListTrafficMonitorsParams) (*ListTrafficMonitorsResponse, error) {
resp, err := s.cs.newRequest("listTrafficMonitors", p.toURLValues())
if err != nil {
return nil, err
}
var r ListTrafficMonitorsResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | go | func (s *UsageService) ListTrafficMonitors(p *ListTrafficMonitorsParams) (*ListTrafficMonitorsResponse, error) {
resp, err := s.cs.newRequest("listTrafficMonitors", p.toURLValues())
if err != nil {
return nil, err
}
var r ListTrafficMonitorsResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"ListTrafficMonitors",
"(",
"p",
"*",
"ListTrafficMonitorsParams",
")",
"(",
"*",
"ListTrafficMonitorsResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"ListTrafficMonitorsResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"resp",
",",
"&",
"r",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"r",
",",
"nil",
"\n",
"}"
] | // List traffic monitor Hosts. | [
"List",
"traffic",
"monitor",
"Hosts",
"."
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L584-L596 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | NewListTrafficTypeImplementorsParams | func (s *UsageService) NewListTrafficTypeImplementorsParams() *ListTrafficTypeImplementorsParams {
p := &ListTrafficTypeImplementorsParams{}
p.p = make(map[string]interface{})
return p
} | go | func (s *UsageService) NewListTrafficTypeImplementorsParams() *ListTrafficTypeImplementorsParams {
p := &ListTrafficTypeImplementorsParams{}
p.p = make(map[string]interface{})
return p
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"NewListTrafficTypeImplementorsParams",
"(",
")",
"*",
"ListTrafficTypeImplementorsParams",
"{",
"p",
":=",
"&",
"ListTrafficTypeImplementorsParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new ListTrafficTypeImplementorsParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"ListTrafficTypeImplementorsParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L671-L675 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | ListTrafficTypeImplementors | func (s *UsageService) ListTrafficTypeImplementors(p *ListTrafficTypeImplementorsParams) (*ListTrafficTypeImplementorsResponse, error) {
resp, err := s.cs.newRequest("listTrafficTypeImplementors", p.toURLValues())
if err != nil {
return nil, err
}
var r ListTrafficTypeImplementorsResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | go | func (s *UsageService) ListTrafficTypeImplementors(p *ListTrafficTypeImplementorsParams) (*ListTrafficTypeImplementorsResponse, error) {
resp, err := s.cs.newRequest("listTrafficTypeImplementors", p.toURLValues())
if err != nil {
return nil, err
}
var r ListTrafficTypeImplementorsResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"ListTrafficTypeImplementors",
"(",
"p",
"*",
"ListTrafficTypeImplementorsParams",
")",
"(",
"*",
"ListTrafficTypeImplementorsResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"ListTrafficTypeImplementorsResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"resp",
",",
"&",
"r",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"r",
",",
"nil",
"\n",
"}"
] | // Lists implementors of implementor of a network traffic type or implementors of all network traffic types | [
"Lists",
"implementors",
"of",
"implementor",
"of",
"a",
"network",
"traffic",
"type",
"or",
"implementors",
"of",
"all",
"network",
"traffic",
"types"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L678-L690 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | NewListTrafficTypesParams | func (s *UsageService) NewListTrafficTypesParams(physicalnetworkid string) *ListTrafficTypesParams {
p := &ListTrafficTypesParams{}
p.p = make(map[string]interface{})
p.p["physicalnetworkid"] = physicalnetworkid
return p
} | go | func (s *UsageService) NewListTrafficTypesParams(physicalnetworkid string) *ListTrafficTypesParams {
p := &ListTrafficTypesParams{}
p.p = make(map[string]interface{})
p.p["physicalnetworkid"] = physicalnetworkid
return p
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"NewListTrafficTypesParams",
"(",
"physicalnetworkid",
"string",
")",
"*",
"ListTrafficTypesParams",
"{",
"p",
":=",
"&",
"ListTrafficTypesParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"physicalnetworkid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new ListTrafficTypesParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"ListTrafficTypesParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L762-L767 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | ListTrafficTypes | func (s *UsageService) ListTrafficTypes(p *ListTrafficTypesParams) (*ListTrafficTypesResponse, error) {
resp, err := s.cs.newRequest("listTrafficTypes", p.toURLValues())
if err != nil {
return nil, err
}
var r ListTrafficTypesResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | go | func (s *UsageService) ListTrafficTypes(p *ListTrafficTypesParams) (*ListTrafficTypesResponse, error) {
resp, err := s.cs.newRequest("listTrafficTypes", p.toURLValues())
if err != nil {
return nil, err
}
var r ListTrafficTypesResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"ListTrafficTypes",
"(",
"p",
"*",
"ListTrafficTypesParams",
")",
"(",
"*",
"ListTrafficTypesResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"ListTrafficTypesResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"resp",
",",
"&",
"r",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"r",
",",
"nil",
"\n",
"}"
] | // Lists traffic types of a given physical network. | [
"Lists",
"traffic",
"types",
"of",
"a",
"given",
"physical",
"network",
"."
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L807-L819 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | NewListUsageRecordsParams | func (s *UsageService) NewListUsageRecordsParams(enddate string, startdate string) *ListUsageRecordsParams {
p := &ListUsageRecordsParams{}
p.p = make(map[string]interface{})
p.p["enddate"] = enddate
p.p["startdate"] = startdate
return p
} | go | func (s *UsageService) NewListUsageRecordsParams(enddate string, startdate string) *ListUsageRecordsParams {
p := &ListUsageRecordsParams{}
p.p = make(map[string]interface{})
p.p["enddate"] = enddate
p.p["startdate"] = startdate
return p
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"NewListUsageRecordsParams",
"(",
"enddate",
"string",
",",
"startdate",
"string",
")",
"*",
"ListUsageRecordsParams",
"{",
"p",
":=",
"&",
"ListUsageRecordsParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"enddate",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"startdate",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new ListUsageRecordsParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"ListUsageRecordsParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L986-L992 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | ListUsageRecords | func (s *UsageService) ListUsageRecords(p *ListUsageRecordsParams) (*ListUsageRecordsResponse, error) {
resp, err := s.cs.newRequest("listUsageRecords", p.toURLValues())
if err != nil {
return nil, err
}
var r ListUsageRecordsResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | go | func (s *UsageService) ListUsageRecords(p *ListUsageRecordsParams) (*ListUsageRecordsResponse, error) {
resp, err := s.cs.newRequest("listUsageRecords", p.toURLValues())
if err != nil {
return nil, err
}
var r ListUsageRecordsResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"ListUsageRecords",
"(",
"p",
"*",
"ListUsageRecordsParams",
")",
"(",
"*",
"ListUsageRecordsResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"ListUsageRecordsResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"resp",
",",
"&",
"r",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"r",
",",
"nil",
"\n",
"}"
] | // Lists usage records for accounts | [
"Lists",
"usage",
"records",
"for",
"accounts"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L995-L1007 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | NewListUsageTypesParams | func (s *UsageService) NewListUsageTypesParams() *ListUsageTypesParams {
p := &ListUsageTypesParams{}
p.p = make(map[string]interface{})
return p
} | go | func (s *UsageService) NewListUsageTypesParams() *ListUsageTypesParams {
p := &ListUsageTypesParams{}
p.p = make(map[string]interface{})
return p
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"NewListUsageTypesParams",
"(",
")",
"*",
"ListUsageTypesParams",
"{",
"p",
":=",
"&",
"ListUsageTypesParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new ListUsageTypesParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"ListUsageTypesParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L1059-L1063 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | ListUsageTypes | func (s *UsageService) ListUsageTypes(p *ListUsageTypesParams) (*ListUsageTypesResponse, error) {
resp, err := s.cs.newRequest("listUsageTypes", p.toURLValues())
if err != nil {
return nil, err
}
var r ListUsageTypesResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | go | func (s *UsageService) ListUsageTypes(p *ListUsageTypesParams) (*ListUsageTypesResponse, error) {
resp, err := s.cs.newRequest("listUsageTypes", p.toURLValues())
if err != nil {
return nil, err
}
var r ListUsageTypesResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"ListUsageTypes",
"(",
"p",
"*",
"ListUsageTypesParams",
")",
"(",
"*",
"ListUsageTypesResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"ListUsageTypesResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"resp",
",",
"&",
"r",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"r",
",",
"nil",
"\n",
"}"
] | // List Usage Types | [
"List",
"Usage",
"Types"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L1066-L1078 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | NewRemoveRawUsageRecordsParams | func (s *UsageService) NewRemoveRawUsageRecordsParams(interval int) *RemoveRawUsageRecordsParams {
p := &RemoveRawUsageRecordsParams{}
p.p = make(map[string]interface{})
p.p["interval"] = interval
return p
} | go | func (s *UsageService) NewRemoveRawUsageRecordsParams(interval int) *RemoveRawUsageRecordsParams {
p := &RemoveRawUsageRecordsParams{}
p.p = make(map[string]interface{})
p.p["interval"] = interval
return p
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"NewRemoveRawUsageRecordsParams",
"(",
"interval",
"int",
")",
"*",
"RemoveRawUsageRecordsParams",
"{",
"p",
":=",
"&",
"RemoveRawUsageRecordsParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"interval",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new RemoveRawUsageRecordsParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"RemoveRawUsageRecordsParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L1116-L1121 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | RemoveRawUsageRecords | func (s *UsageService) RemoveRawUsageRecords(p *RemoveRawUsageRecordsParams) (*RemoveRawUsageRecordsResponse, error) {
resp, err := s.cs.newRequest("removeRawUsageRecords", p.toURLValues())
if err != nil {
return nil, err
}
var r RemoveRawUsageRecordsResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | go | func (s *UsageService) RemoveRawUsageRecords(p *RemoveRawUsageRecordsParams) (*RemoveRawUsageRecordsResponse, error) {
resp, err := s.cs.newRequest("removeRawUsageRecords", p.toURLValues())
if err != nil {
return nil, err
}
var r RemoveRawUsageRecordsResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"RemoveRawUsageRecords",
"(",
"p",
"*",
"RemoveRawUsageRecordsParams",
")",
"(",
"*",
"RemoveRawUsageRecordsResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"RemoveRawUsageRecordsResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"resp",
",",
"&",
"r",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"r",
",",
"nil",
"\n",
"}"
] | // Safely removes raw records from cloud_usage table | [
"Safely",
"removes",
"raw",
"records",
"from",
"cloud_usage",
"table"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L1124-L1136 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | NewUpdateTrafficTypeParams | func (s *UsageService) NewUpdateTrafficTypeParams(id string) *UpdateTrafficTypeParams {
p := &UpdateTrafficTypeParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *UsageService) NewUpdateTrafficTypeParams(id string) *UpdateTrafficTypeParams {
p := &UpdateTrafficTypeParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"UsageService",
")",
"NewUpdateTrafficTypeParams",
"(",
"id",
"string",
")",
"*",
"UpdateTrafficTypeParams",
"{",
"p",
":=",
"&",
"UpdateTrafficTypeParams",
"{",
"}",
"\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 UpdateTrafficTypeParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"UpdateTrafficTypeParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L1242-L1247 | train |
xanzy/go-cloudstack | cloudstack/UsageService.go | UpdateTrafficType | func (s *UsageService) UpdateTrafficType(p *UpdateTrafficTypeParams) (*UpdateTrafficTypeResponse, error) {
resp, err := s.cs.newRequest("updateTrafficType", p.toURLValues())
if err != nil {
return nil, err
}
var r UpdateTrafficTypeResponse
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 *UsageService) UpdateTrafficType(p *UpdateTrafficTypeParams) (*UpdateTrafficTypeResponse, error) {
resp, err := s.cs.newRequest("updateTrafficType", p.toURLValues())
if err != nil {
return nil, err
}
var r UpdateTrafficTypeResponse
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",
"*",
"UsageService",
")",
"UpdateTrafficType",
"(",
"p",
"*",
"UpdateTrafficTypeParams",
")",
"(",
"*",
"UpdateTrafficTypeResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"UpdateTrafficTypeResponse",
"\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 traffic type of a physical network | [
"Updates",
"traffic",
"type",
"of",
"a",
"physical",
"network"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L1250-L1282 | train |
xanzy/go-cloudstack | cloudstack/DiskOfferingService.go | NewCreateDiskOfferingParams | func (s *DiskOfferingService) NewCreateDiskOfferingParams(displaytext string, name string) *CreateDiskOfferingParams {
p := &CreateDiskOfferingParams{}
p.p = make(map[string]interface{})
p.p["displaytext"] = displaytext
p.p["name"] = name
return p
} | go | func (s *DiskOfferingService) NewCreateDiskOfferingParams(displaytext string, name string) *CreateDiskOfferingParams {
p := &CreateDiskOfferingParams{}
p.p = make(map[string]interface{})
p.p["displaytext"] = displaytext
p.p["name"] = name
return p
} | [
"func",
"(",
"s",
"*",
"DiskOfferingService",
")",
"NewCreateDiskOfferingParams",
"(",
"displaytext",
"string",
",",
"name",
"string",
")",
"*",
"CreateDiskOfferingParams",
"{",
"p",
":=",
"&",
"CreateDiskOfferingParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"displaytext",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"name",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new CreateDiskOfferingParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"CreateDiskOfferingParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/DiskOfferingService.go#L239-L245 | train |
xanzy/go-cloudstack | cloudstack/DiskOfferingService.go | NewDeleteDiskOfferingParams | func (s *DiskOfferingService) NewDeleteDiskOfferingParams(id string) *DeleteDiskOfferingParams {
p := &DeleteDiskOfferingParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *DiskOfferingService) NewDeleteDiskOfferingParams(id string) *DeleteDiskOfferingParams {
p := &DeleteDiskOfferingParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"DiskOfferingService",
")",
"NewDeleteDiskOfferingParams",
"(",
"id",
"string",
")",
"*",
"DeleteDiskOfferingParams",
"{",
"p",
":=",
"&",
"DeleteDiskOfferingParams",
"{",
"}",
"\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 DeleteDiskOfferingParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"DeleteDiskOfferingParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/DiskOfferingService.go#L311-L316 | train |
xanzy/go-cloudstack | cloudstack/DiskOfferingService.go | NewListDiskOfferingsParams | func (s *DiskOfferingService) NewListDiskOfferingsParams() *ListDiskOfferingsParams {
p := &ListDiskOfferingsParams{}
p.p = make(map[string]interface{})
return p
} | go | func (s *DiskOfferingService) NewListDiskOfferingsParams() *ListDiskOfferingsParams {
p := &ListDiskOfferingsParams{}
p.p = make(map[string]interface{})
return p
} | [
"func",
"(",
"s",
"*",
"DiskOfferingService",
")",
"NewListDiskOfferingsParams",
"(",
")",
"*",
"ListDiskOfferingsParams",
"{",
"p",
":=",
"&",
"ListDiskOfferingsParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new ListDiskOfferingsParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"ListDiskOfferingsParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/DiskOfferingService.go#L463-L467 | train |
xanzy/go-cloudstack | cloudstack/DiskOfferingService.go | NewUpdateDiskOfferingParams | func (s *DiskOfferingService) NewUpdateDiskOfferingParams(id string) *UpdateDiskOfferingParams {
p := &UpdateDiskOfferingParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *DiskOfferingService) NewUpdateDiskOfferingParams(id string) *UpdateDiskOfferingParams {
p := &UpdateDiskOfferingParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"DiskOfferingService",
")",
"NewUpdateDiskOfferingParams",
"(",
"id",
"string",
")",
"*",
"UpdateDiskOfferingParams",
"{",
"p",
":=",
"&",
"UpdateDiskOfferingParams",
"{",
"}",
"\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 UpdateDiskOfferingParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"UpdateDiskOfferingParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/DiskOfferingService.go#L667-L672 | train |
xanzy/go-cloudstack | cloudstack/ResourcemetadataService.go | NewAddResourceDetailParams | func (s *ResourcemetadataService) NewAddResourceDetailParams(details map[string]string, resourceid string, resourcetype string) *AddResourceDetailParams {
p := &AddResourceDetailParams{}
p.p = make(map[string]interface{})
p.p["details"] = details
p.p["resourceid"] = resourceid
p.p["resourcetype"] = resourcetype
return p
} | go | func (s *ResourcemetadataService) NewAddResourceDetailParams(details map[string]string, resourceid string, resourcetype string) *AddResourceDetailParams {
p := &AddResourceDetailParams{}
p.p = make(map[string]interface{})
p.p["details"] = details
p.p["resourceid"] = resourceid
p.p["resourcetype"] = resourcetype
return p
} | [
"func",
"(",
"s",
"*",
"ResourcemetadataService",
")",
"NewAddResourceDetailParams",
"(",
"details",
"map",
"[",
"string",
"]",
"string",
",",
"resourceid",
"string",
",",
"resourcetype",
"string",
")",
"*",
"AddResourceDetailParams",
"{",
"p",
":=",
"&",
"AddResourceDetailParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"details",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"resourceid",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"resourcetype",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new AddResourceDetailParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"AddResourceDetailParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ResourcemetadataService.go#L89-L96 | train |
xanzy/go-cloudstack | cloudstack/ResourcemetadataService.go | AddResourceDetail | func (s *ResourcemetadataService) AddResourceDetail(p *AddResourceDetailParams) (*AddResourceDetailResponse, error) {
resp, err := s.cs.newRequest("addResourceDetail", p.toURLValues())
if err != nil {
return nil, err
}
var r AddResourceDetailResponse
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 *ResourcemetadataService) AddResourceDetail(p *AddResourceDetailParams) (*AddResourceDetailResponse, error) {
resp, err := s.cs.newRequest("addResourceDetail", p.toURLValues())
if err != nil {
return nil, err
}
var r AddResourceDetailResponse
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",
"*",
"ResourcemetadataService",
")",
"AddResourceDetail",
"(",
"p",
"*",
"AddResourceDetailParams",
")",
"(",
"*",
"AddResourceDetailResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"AddResourceDetailResponse",
"\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",
"}"
] | // Adds detail for the Resource. | [
"Adds",
"detail",
"for",
"the",
"Resource",
"."
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ResourcemetadataService.go#L99-L126 | train |
xanzy/go-cloudstack | cloudstack/ResourcemetadataService.go | NewGetVolumeSnapshotDetailsParams | func (s *ResourcemetadataService) NewGetVolumeSnapshotDetailsParams(snapshotid string) *GetVolumeSnapshotDetailsParams {
p := &GetVolumeSnapshotDetailsParams{}
p.p = make(map[string]interface{})
p.p["snapshotid"] = snapshotid
return p
} | go | func (s *ResourcemetadataService) NewGetVolumeSnapshotDetailsParams(snapshotid string) *GetVolumeSnapshotDetailsParams {
p := &GetVolumeSnapshotDetailsParams{}
p.p = make(map[string]interface{})
p.p["snapshotid"] = snapshotid
return p
} | [
"func",
"(",
"s",
"*",
"ResourcemetadataService",
")",
"NewGetVolumeSnapshotDetailsParams",
"(",
"snapshotid",
"string",
")",
"*",
"GetVolumeSnapshotDetailsParams",
"{",
"p",
":=",
"&",
"GetVolumeSnapshotDetailsParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"snapshotid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new GetVolumeSnapshotDetailsParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"GetVolumeSnapshotDetailsParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ResourcemetadataService.go#L159-L164 | train |
xanzy/go-cloudstack | cloudstack/ResourcemetadataService.go | GetVolumeSnapshotDetails | func (s *ResourcemetadataService) GetVolumeSnapshotDetails(p *GetVolumeSnapshotDetailsParams) (*GetVolumeSnapshotDetailsResponse, error) {
resp, err := s.cs.newRequest("getVolumeSnapshotDetails", p.toURLValues())
if err != nil {
return nil, err
}
var r GetVolumeSnapshotDetailsResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | go | func (s *ResourcemetadataService) GetVolumeSnapshotDetails(p *GetVolumeSnapshotDetailsParams) (*GetVolumeSnapshotDetailsResponse, error) {
resp, err := s.cs.newRequest("getVolumeSnapshotDetails", p.toURLValues())
if err != nil {
return nil, err
}
var r GetVolumeSnapshotDetailsResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | [
"func",
"(",
"s",
"*",
"ResourcemetadataService",
")",
"GetVolumeSnapshotDetails",
"(",
"p",
"*",
"GetVolumeSnapshotDetailsParams",
")",
"(",
"*",
"GetVolumeSnapshotDetailsResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"GetVolumeSnapshotDetailsResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"resp",
",",
"&",
"r",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"r",
",",
"nil",
"\n",
"}"
] | // Get Volume Snapshot Details | [
"Get",
"Volume",
"Snapshot",
"Details"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ResourcemetadataService.go#L167-L179 | train |
xanzy/go-cloudstack | cloudstack/ResourcemetadataService.go | NewListResourceDetailsParams | func (s *ResourcemetadataService) NewListResourceDetailsParams(resourcetype string) *ListResourceDetailsParams {
p := &ListResourceDetailsParams{}
p.p = make(map[string]interface{})
p.p["resourcetype"] = resourcetype
return p
} | go | func (s *ResourcemetadataService) NewListResourceDetailsParams(resourcetype string) *ListResourceDetailsParams {
p := &ListResourceDetailsParams{}
p.p = make(map[string]interface{})
p.p["resourcetype"] = resourcetype
return p
} | [
"func",
"(",
"s",
"*",
"ResourcemetadataService",
")",
"NewListResourceDetailsParams",
"(",
"resourcetype",
"string",
")",
"*",
"ListResourceDetailsParams",
"{",
"p",
":=",
"&",
"ListResourceDetailsParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"resourcetype",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new ListResourceDetailsParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"ListResourceDetailsParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ResourcemetadataService.go#L347-L352 | train |
xanzy/go-cloudstack | cloudstack/ResourcemetadataService.go | NewRemoveResourceDetailParams | func (s *ResourcemetadataService) NewRemoveResourceDetailParams(resourceid string, resourcetype string) *RemoveResourceDetailParams {
p := &RemoveResourceDetailParams{}
p.p = make(map[string]interface{})
p.p["resourceid"] = resourceid
p.p["resourcetype"] = resourcetype
return p
} | go | func (s *ResourcemetadataService) NewRemoveResourceDetailParams(resourceid string, resourcetype string) *RemoveResourceDetailParams {
p := &RemoveResourceDetailParams{}
p.p = make(map[string]interface{})
p.p["resourceid"] = resourceid
p.p["resourcetype"] = resourcetype
return p
} | [
"func",
"(",
"s",
"*",
"ResourcemetadataService",
")",
"NewRemoveResourceDetailParams",
"(",
"resourceid",
"string",
",",
"resourcetype",
"string",
")",
"*",
"RemoveResourceDetailParams",
"{",
"p",
":=",
"&",
"RemoveResourceDetailParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"resourceid",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"resourcetype",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new RemoveResourceDetailParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"RemoveResourceDetailParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ResourcemetadataService.go#L434-L440 | train |
xanzy/go-cloudstack | cloudstack/ResourcemetadataService.go | RemoveResourceDetail | func (s *ResourcemetadataService) RemoveResourceDetail(p *RemoveResourceDetailParams) (*RemoveResourceDetailResponse, error) {
resp, err := s.cs.newRequest("removeResourceDetail", p.toURLValues())
if err != nil {
return nil, err
}
var r RemoveResourceDetailResponse
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 *ResourcemetadataService) RemoveResourceDetail(p *RemoveResourceDetailParams) (*RemoveResourceDetailResponse, error) {
resp, err := s.cs.newRequest("removeResourceDetail", p.toURLValues())
if err != nil {
return nil, err
}
var r RemoveResourceDetailResponse
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",
"*",
"ResourcemetadataService",
")",
"RemoveResourceDetail",
"(",
"p",
"*",
"RemoveResourceDetailParams",
")",
"(",
"*",
"RemoveResourceDetailResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"RemoveResourceDetailResponse",
"\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 detail for the Resource. | [
"Removes",
"detail",
"for",
"the",
"Resource",
"."
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ResourcemetadataService.go#L443-L470 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewAddNicToVirtualMachineParams | func (s *VirtualMachineService) NewAddNicToVirtualMachineParams(networkid string, virtualmachineid string) *AddNicToVirtualMachineParams {
p := &AddNicToVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["networkid"] = networkid
p.p["virtualmachineid"] = virtualmachineid
return p
} | go | func (s *VirtualMachineService) NewAddNicToVirtualMachineParams(networkid string, virtualmachineid string) *AddNicToVirtualMachineParams {
p := &AddNicToVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["networkid"] = networkid
p.p["virtualmachineid"] = virtualmachineid
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewAddNicToVirtualMachineParams",
"(",
"networkid",
"string",
",",
"virtualmachineid",
"string",
")",
"*",
"AddNicToVirtualMachineParams",
"{",
"p",
":=",
"&",
"AddNicToVirtualMachineParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"networkid",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"virtualmachineid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new AddNicToVirtualMachineParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"AddNicToVirtualMachineParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L101-L107 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewAssignVirtualMachineParams | func (s *VirtualMachineService) NewAssignVirtualMachineParams(virtualmachineid string) *AssignVirtualMachineParams {
p := &AssignVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["virtualmachineid"] = virtualmachineid
return p
} | go | func (s *VirtualMachineService) NewAssignVirtualMachineParams(virtualmachineid string) *AssignVirtualMachineParams {
p := &AssignVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["virtualmachineid"] = virtualmachineid
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewAssignVirtualMachineParams",
"(",
"virtualmachineid",
"string",
")",
"*",
"AssignVirtualMachineParams",
"{",
"p",
":=",
"&",
"AssignVirtualMachineParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"virtualmachineid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new AssignVirtualMachineParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"AssignVirtualMachineParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L334-L339 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewChangeServiceForVirtualMachineParams | func (s *VirtualMachineService) NewChangeServiceForVirtualMachineParams(id string, serviceofferingid string) *ChangeServiceForVirtualMachineParams {
p := &ChangeServiceForVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
p.p["serviceofferingid"] = serviceofferingid
return p
} | go | func (s *VirtualMachineService) NewChangeServiceForVirtualMachineParams(id string, serviceofferingid string) *ChangeServiceForVirtualMachineParams {
p := &ChangeServiceForVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
p.p["serviceofferingid"] = serviceofferingid
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewChangeServiceForVirtualMachineParams",
"(",
"id",
"string",
",",
"serviceofferingid",
"string",
")",
"*",
"ChangeServiceForVirtualMachineParams",
"{",
"p",
":=",
"&",
"ChangeServiceForVirtualMachineParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"id",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"serviceofferingid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new ChangeServiceForVirtualMachineParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"ChangeServiceForVirtualMachineParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L514-L520 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewCleanVMReservationsParams | func (s *VirtualMachineService) NewCleanVMReservationsParams() *CleanVMReservationsParams {
p := &CleanVMReservationsParams{}
p.p = make(map[string]interface{})
return p
} | go | func (s *VirtualMachineService) NewCleanVMReservationsParams() *CleanVMReservationsParams {
p := &CleanVMReservationsParams{}
p.p = make(map[string]interface{})
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewCleanVMReservationsParams",
"(",
")",
"*",
"CleanVMReservationsParams",
"{",
"p",
":=",
"&",
"CleanVMReservationsParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new CleanVMReservationsParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"CleanVMReservationsParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L658-L662 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewDeployVirtualMachineParams | func (s *VirtualMachineService) NewDeployVirtualMachineParams(serviceofferingid string, templateid string, zoneid string) *DeployVirtualMachineParams {
p := &DeployVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["serviceofferingid"] = serviceofferingid
p.p["templateid"] = templateid
p.p["zoneid"] = zoneid
return p
} | go | func (s *VirtualMachineService) NewDeployVirtualMachineParams(serviceofferingid string, templateid string, zoneid string) *DeployVirtualMachineParams {
p := &DeployVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["serviceofferingid"] = serviceofferingid
p.p["templateid"] = templateid
p.p["zoneid"] = zoneid
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewDeployVirtualMachineParams",
"(",
"serviceofferingid",
"string",
",",
"templateid",
"string",
",",
"zoneid",
"string",
")",
"*",
"DeployVirtualMachineParams",
"{",
"p",
":=",
"&",
"DeployVirtualMachineParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"serviceofferingid",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"templateid",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"zoneid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new DeployVirtualMachineParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"DeployVirtualMachineParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L1105-L1112 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewDestroyVirtualMachineParams | func (s *VirtualMachineService) NewDestroyVirtualMachineParams(id string) *DestroyVirtualMachineParams {
p := &DestroyVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *VirtualMachineService) NewDestroyVirtualMachineParams(id string) *DestroyVirtualMachineParams {
p := &DestroyVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewDestroyVirtualMachineParams",
"(",
"id",
"string",
")",
"*",
"DestroyVirtualMachineParams",
"{",
"p",
":=",
"&",
"DestroyVirtualMachineParams",
"{",
"}",
"\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 DestroyVirtualMachineParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"DestroyVirtualMachineParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L1294-L1299 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | DestroyVirtualMachine | func (s *VirtualMachineService) DestroyVirtualMachine(p *DestroyVirtualMachineParams) (*DestroyVirtualMachineResponse, error) {
resp, err := s.cs.newRequest("destroyVirtualMachine", p.toURLValues())
if err != nil {
return nil, err
}
var r DestroyVirtualMachineResponse
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 *VirtualMachineService) DestroyVirtualMachine(p *DestroyVirtualMachineParams) (*DestroyVirtualMachineResponse, error) {
resp, err := s.cs.newRequest("destroyVirtualMachine", p.toURLValues())
if err != nil {
return nil, err
}
var r DestroyVirtualMachineResponse
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",
"*",
"VirtualMachineService",
")",
"DestroyVirtualMachine",
"(",
"p",
"*",
"DestroyVirtualMachineParams",
")",
"(",
"*",
"DestroyVirtualMachineResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"DestroyVirtualMachineResponse",
"\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",
"}"
] | // Destroys a virtual machine. | [
"Destroys",
"a",
"virtual",
"machine",
"."
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L1302-L1334 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewExpungeVirtualMachineParams | func (s *VirtualMachineService) NewExpungeVirtualMachineParams(id string) *ExpungeVirtualMachineParams {
p := &ExpungeVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *VirtualMachineService) NewExpungeVirtualMachineParams(id string) *ExpungeVirtualMachineParams {
p := &ExpungeVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewExpungeVirtualMachineParams",
"(",
"id",
"string",
")",
"*",
"ExpungeVirtualMachineParams",
"{",
"p",
":=",
"&",
"ExpungeVirtualMachineParams",
"{",
"}",
"\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 ExpungeVirtualMachineParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"ExpungeVirtualMachineParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L1469-L1474 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewGetVMPasswordParams | func (s *VirtualMachineService) NewGetVMPasswordParams(id string) *GetVMPasswordParams {
p := &GetVMPasswordParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *VirtualMachineService) NewGetVMPasswordParams(id string) *GetVMPasswordParams {
p := &GetVMPasswordParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewGetVMPasswordParams",
"(",
"id",
"string",
")",
"*",
"GetVMPasswordParams",
"{",
"p",
":=",
"&",
"GetVMPasswordParams",
"{",
"}",
"\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 GetVMPasswordParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"GetVMPasswordParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L1537-L1542 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewListVirtualMachinesParams | func (s *VirtualMachineService) NewListVirtualMachinesParams() *ListVirtualMachinesParams {
p := &ListVirtualMachinesParams{}
p.p = make(map[string]interface{})
return p
} | go | func (s *VirtualMachineService) NewListVirtualMachinesParams() *ListVirtualMachinesParams {
p := &ListVirtualMachinesParams{}
p.p = make(map[string]interface{})
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewListVirtualMachinesParams",
"(",
")",
"*",
"ListVirtualMachinesParams",
"{",
"p",
":=",
"&",
"ListVirtualMachinesParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new ListVirtualMachinesParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"ListVirtualMachinesParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L1920-L1924 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewMigrateVirtualMachineParams | func (s *VirtualMachineService) NewMigrateVirtualMachineParams(virtualmachineid string) *MigrateVirtualMachineParams {
p := &MigrateVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["virtualmachineid"] = virtualmachineid
return p
} | go | func (s *VirtualMachineService) NewMigrateVirtualMachineParams(virtualmachineid string) *MigrateVirtualMachineParams {
p := &MigrateVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["virtualmachineid"] = virtualmachineid
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewMigrateVirtualMachineParams",
"(",
"virtualmachineid",
"string",
")",
"*",
"MigrateVirtualMachineParams",
"{",
"p",
":=",
"&",
"MigrateVirtualMachineParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"virtualmachineid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new MigrateVirtualMachineParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"MigrateVirtualMachineParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L2183-L2188 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewMigrateVirtualMachineWithVolumeParams | func (s *VirtualMachineService) NewMigrateVirtualMachineWithVolumeParams(hostid string, virtualmachineid string) *MigrateVirtualMachineWithVolumeParams {
p := &MigrateVirtualMachineWithVolumeParams{}
p.p = make(map[string]interface{})
p.p["hostid"] = hostid
p.p["virtualmachineid"] = virtualmachineid
return p
} | go | func (s *VirtualMachineService) NewMigrateVirtualMachineWithVolumeParams(hostid string, virtualmachineid string) *MigrateVirtualMachineWithVolumeParams {
p := &MigrateVirtualMachineWithVolumeParams{}
p.p = make(map[string]interface{})
p.p["hostid"] = hostid
p.p["virtualmachineid"] = virtualmachineid
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewMigrateVirtualMachineWithVolumeParams",
"(",
"hostid",
"string",
",",
"virtualmachineid",
"string",
")",
"*",
"MigrateVirtualMachineWithVolumeParams",
"{",
"p",
":=",
"&",
"MigrateVirtualMachineWithVolumeParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"hostid",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"virtualmachineid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new MigrateVirtualMachineWithVolumeParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"MigrateVirtualMachineWithVolumeParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L2385-L2391 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewRebootVirtualMachineParams | func (s *VirtualMachineService) NewRebootVirtualMachineParams(id string) *RebootVirtualMachineParams {
p := &RebootVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *VirtualMachineService) NewRebootVirtualMachineParams(id string) *RebootVirtualMachineParams {
p := &RebootVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewRebootVirtualMachineParams",
"(",
"id",
"string",
")",
"*",
"RebootVirtualMachineParams",
"{",
"p",
":=",
"&",
"RebootVirtualMachineParams",
"{",
"}",
"\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 RebootVirtualMachineParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"RebootVirtualMachineParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L2561-L2566 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewRecoverVirtualMachineParams | func (s *VirtualMachineService) NewRecoverVirtualMachineParams(id string) *RecoverVirtualMachineParams {
p := &RecoverVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *VirtualMachineService) NewRecoverVirtualMachineParams(id string) *RecoverVirtualMachineParams {
p := &RecoverVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewRecoverVirtualMachineParams",
"(",
"id",
"string",
")",
"*",
"RecoverVirtualMachineParams",
"{",
"p",
":=",
"&",
"RecoverVirtualMachineParams",
"{",
"}",
"\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 RecoverVirtualMachineParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"RecoverVirtualMachineParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L2736-L2741 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewRemoveNicFromVirtualMachineParams | func (s *VirtualMachineService) NewRemoveNicFromVirtualMachineParams(nicid string, virtualmachineid string) *RemoveNicFromVirtualMachineParams {
p := &RemoveNicFromVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["nicid"] = nicid
p.p["virtualmachineid"] = virtualmachineid
return p
} | go | func (s *VirtualMachineService) NewRemoveNicFromVirtualMachineParams(nicid string, virtualmachineid string) *RemoveNicFromVirtualMachineParams {
p := &RemoveNicFromVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["nicid"] = nicid
p.p["virtualmachineid"] = virtualmachineid
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewRemoveNicFromVirtualMachineParams",
"(",
"nicid",
"string",
",",
"virtualmachineid",
"string",
")",
"*",
"RemoveNicFromVirtualMachineParams",
"{",
"p",
":=",
"&",
"RemoveNicFromVirtualMachineParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"nicid",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"virtualmachineid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new RemoveNicFromVirtualMachineParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"RemoveNicFromVirtualMachineParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L2901-L2907 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewResetPasswordForVirtualMachineParams | func (s *VirtualMachineService) NewResetPasswordForVirtualMachineParams(id string) *ResetPasswordForVirtualMachineParams {
p := &ResetPasswordForVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *VirtualMachineService) NewResetPasswordForVirtualMachineParams(id string) *ResetPasswordForVirtualMachineParams {
p := &ResetPasswordForVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewResetPasswordForVirtualMachineParams",
"(",
"id",
"string",
")",
"*",
"ResetPasswordForVirtualMachineParams",
"{",
"p",
":=",
"&",
"ResetPasswordForVirtualMachineParams",
"{",
"}",
"\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 ResetPasswordForVirtualMachineParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"ResetPasswordForVirtualMachineParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L3077-L3082 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewRestoreVirtualMachineParams | func (s *VirtualMachineService) NewRestoreVirtualMachineParams(virtualmachineid string) *RestoreVirtualMachineParams {
p := &RestoreVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["virtualmachineid"] = virtualmachineid
return p
} | go | func (s *VirtualMachineService) NewRestoreVirtualMachineParams(virtualmachineid string) *RestoreVirtualMachineParams {
p := &RestoreVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["virtualmachineid"] = virtualmachineid
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewRestoreVirtualMachineParams",
"(",
"virtualmachineid",
"string",
")",
"*",
"RestoreVirtualMachineParams",
"{",
"p",
":=",
"&",
"RestoreVirtualMachineParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"virtualmachineid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new RestoreVirtualMachineParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"RestoreVirtualMachineParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L3263-L3268 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewScaleVirtualMachineParams | func (s *VirtualMachineService) NewScaleVirtualMachineParams(id string, serviceofferingid string) *ScaleVirtualMachineParams {
p := &ScaleVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
p.p["serviceofferingid"] = serviceofferingid
return p
} | go | func (s *VirtualMachineService) NewScaleVirtualMachineParams(id string, serviceofferingid string) *ScaleVirtualMachineParams {
p := &ScaleVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
p.p["serviceofferingid"] = serviceofferingid
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewScaleVirtualMachineParams",
"(",
"id",
"string",
",",
"serviceofferingid",
"string",
")",
"*",
"ScaleVirtualMachineParams",
"{",
"p",
":=",
"&",
"ScaleVirtualMachineParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"id",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"serviceofferingid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new ScaleVirtualMachineParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"ScaleVirtualMachineParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L3464-L3470 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewStartVirtualMachineParams | func (s *VirtualMachineService) NewStartVirtualMachineParams(id string) *StartVirtualMachineParams {
p := &StartVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *VirtualMachineService) NewStartVirtualMachineParams(id string) *StartVirtualMachineParams {
p := &StartVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewStartVirtualMachineParams",
"(",
"id",
"string",
")",
"*",
"StartVirtualMachineParams",
"{",
"p",
":=",
"&",
"StartVirtualMachineParams",
"{",
"}",
"\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 StartVirtualMachineParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"StartVirtualMachineParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L3555-L3560 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewStopVirtualMachineParams | func (s *VirtualMachineService) NewStopVirtualMachineParams(id string) *StopVirtualMachineParams {
p := &StopVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *VirtualMachineService) NewStopVirtualMachineParams(id string) *StopVirtualMachineParams {
p := &StopVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewStopVirtualMachineParams",
"(",
"id",
"string",
")",
"*",
"StopVirtualMachineParams",
"{",
"p",
":=",
"&",
"StopVirtualMachineParams",
"{",
"}",
"\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 StopVirtualMachineParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"StopVirtualMachineParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L3742-L3747 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewUpdateDefaultNicForVirtualMachineParams | func (s *VirtualMachineService) NewUpdateDefaultNicForVirtualMachineParams(nicid string, virtualmachineid string) *UpdateDefaultNicForVirtualMachineParams {
p := &UpdateDefaultNicForVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["nicid"] = nicid
p.p["virtualmachineid"] = virtualmachineid
return p
} | go | func (s *VirtualMachineService) NewUpdateDefaultNicForVirtualMachineParams(nicid string, virtualmachineid string) *UpdateDefaultNicForVirtualMachineParams {
p := &UpdateDefaultNicForVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["nicid"] = nicid
p.p["virtualmachineid"] = virtualmachineid
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewUpdateDefaultNicForVirtualMachineParams",
"(",
"nicid",
"string",
",",
"virtualmachineid",
"string",
")",
"*",
"UpdateDefaultNicForVirtualMachineParams",
"{",
"p",
":=",
"&",
"UpdateDefaultNicForVirtualMachineParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"nicid",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"virtualmachineid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new UpdateDefaultNicForVirtualMachineParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"UpdateDefaultNicForVirtualMachineParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L3928-L3934 | train |
xanzy/go-cloudstack | cloudstack/VirtualMachineService.go | NewUpdateVirtualMachineParams | func (s *VirtualMachineService) NewUpdateVirtualMachineParams(id string) *UpdateVirtualMachineParams {
p := &UpdateVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *VirtualMachineService) NewUpdateVirtualMachineParams(id string) *UpdateVirtualMachineParams {
p := &UpdateVirtualMachineParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"VirtualMachineService",
")",
"NewUpdateVirtualMachineParams",
"(",
"id",
"string",
")",
"*",
"UpdateVirtualMachineParams",
"{",
"p",
":=",
"&",
"UpdateVirtualMachineParams",
"{",
"}",
"\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 UpdateVirtualMachineParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"UpdateVirtualMachineParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VirtualMachineService.go#L4284-L4289 | train |
xanzy/go-cloudstack | cloudstack/ISOService.go | NewAttachIsoParams | func (s *ISOService) NewAttachIsoParams(id string, virtualmachineid string) *AttachIsoParams {
p := &AttachIsoParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
p.p["virtualmachineid"] = virtualmachineid
return p
} | go | func (s *ISOService) NewAttachIsoParams(id string, virtualmachineid string) *AttachIsoParams {
p := &AttachIsoParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
p.p["virtualmachineid"] = virtualmachineid
return p
} | [
"func",
"(",
"s",
"*",
"ISOService",
")",
"NewAttachIsoParams",
"(",
"id",
"string",
",",
"virtualmachineid",
"string",
")",
"*",
"AttachIsoParams",
"{",
"p",
":=",
"&",
"AttachIsoParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"id",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"virtualmachineid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new AttachIsoParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"AttachIsoParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ISOService.go#L63-L69 | train |
xanzy/go-cloudstack | cloudstack/ISOService.go | AttachIso | func (s *ISOService) AttachIso(p *AttachIsoParams) (*AttachIsoResponse, error) {
resp, err := s.cs.newRequest("attachIso", p.toURLValues())
if err != nil {
return nil, err
}
var r AttachIsoResponse
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 *ISOService) AttachIso(p *AttachIsoParams) (*AttachIsoResponse, error) {
resp, err := s.cs.newRequest("attachIso", p.toURLValues())
if err != nil {
return nil, err
}
var r AttachIsoResponse
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",
"*",
"ISOService",
")",
"AttachIso",
"(",
"p",
"*",
"AttachIsoParams",
")",
"(",
"*",
"AttachIsoResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"AttachIsoResponse",
"\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",
"}"
] | // Attaches an ISO to a virtual machine. | [
"Attaches",
"an",
"ISO",
"to",
"a",
"virtual",
"machine",
"."
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ISOService.go#L72-L104 | train |
xanzy/go-cloudstack | cloudstack/ISOService.go | NewCopyIsoParams | func (s *ISOService) NewCopyIsoParams(id string) *CopyIsoParams {
p := &CopyIsoParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *ISOService) NewCopyIsoParams(id string) *CopyIsoParams {
p := &CopyIsoParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"ISOService",
")",
"NewCopyIsoParams",
"(",
"id",
"string",
")",
"*",
"CopyIsoParams",
"{",
"p",
":=",
"&",
"CopyIsoParams",
"{",
"}",
"\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 CopyIsoParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"CopyIsoParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ISOService.go#L273-L278 | train |
xanzy/go-cloudstack | cloudstack/ISOService.go | CopyIso | func (s *ISOService) CopyIso(p *CopyIsoParams) (*CopyIsoResponse, error) {
resp, err := s.cs.newRequest("copyIso", p.toURLValues())
if err != nil {
return nil, err
}
var r CopyIsoResponse
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 *ISOService) CopyIso(p *CopyIsoParams) (*CopyIsoResponse, error) {
resp, err := s.cs.newRequest("copyIso", p.toURLValues())
if err != nil {
return nil, err
}
var r CopyIsoResponse
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",
"*",
"ISOService",
")",
"CopyIso",
"(",
"p",
"*",
"CopyIsoParams",
")",
"(",
"*",
"CopyIsoResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"CopyIsoResponse",
"\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",
"}"
] | // Copies an iso from one zone to another. | [
"Copies",
"an",
"iso",
"from",
"one",
"zone",
"to",
"another",
"."
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ISOService.go#L281-L313 | train |
xanzy/go-cloudstack | cloudstack/ISOService.go | NewDeleteIsoParams | func (s *ISOService) NewDeleteIsoParams(id string) *DeleteIsoParams {
p := &DeleteIsoParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *ISOService) NewDeleteIsoParams(id string) *DeleteIsoParams {
p := &DeleteIsoParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"ISOService",
")",
"NewDeleteIsoParams",
"(",
"id",
"string",
")",
"*",
"DeleteIsoParams",
"{",
"p",
":=",
"&",
"DeleteIsoParams",
"{",
"}",
"\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 DeleteIsoParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"DeleteIsoParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ISOService.go#L395-L400 | train |
xanzy/go-cloudstack | cloudstack/ISOService.go | DeleteIso | func (s *ISOService) DeleteIso(p *DeleteIsoParams) (*DeleteIsoResponse, error) {
resp, err := s.cs.newRequest("deleteIso", p.toURLValues())
if err != nil {
return nil, err
}
var r DeleteIsoResponse
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 *ISOService) DeleteIso(p *DeleteIsoParams) (*DeleteIsoResponse, error) {
resp, err := s.cs.newRequest("deleteIso", p.toURLValues())
if err != nil {
return nil, err
}
var r DeleteIsoResponse
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",
"*",
"ISOService",
")",
"DeleteIso",
"(",
"p",
"*",
"DeleteIsoParams",
")",
"(",
"*",
"DeleteIsoResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"DeleteIsoResponse",
"\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",
"}"
] | // Deletes an ISO file. | [
"Deletes",
"an",
"ISO",
"file",
"."
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ISOService.go#L403-L430 | train |
xanzy/go-cloudstack | cloudstack/ISOService.go | NewDetachIsoParams | func (s *ISOService) NewDetachIsoParams(virtualmachineid string) *DetachIsoParams {
p := &DetachIsoParams{}
p.p = make(map[string]interface{})
p.p["virtualmachineid"] = virtualmachineid
return p
} | go | func (s *ISOService) NewDetachIsoParams(virtualmachineid string) *DetachIsoParams {
p := &DetachIsoParams{}
p.p = make(map[string]interface{})
p.p["virtualmachineid"] = virtualmachineid
return p
} | [
"func",
"(",
"s",
"*",
"ISOService",
")",
"NewDetachIsoParams",
"(",
"virtualmachineid",
"string",
")",
"*",
"DetachIsoParams",
"{",
"p",
":=",
"&",
"DetachIsoParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"virtualmachineid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new DetachIsoParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"DetachIsoParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ISOService.go#L463-L468 | train |
xanzy/go-cloudstack | cloudstack/ISOService.go | NewExtractIsoParams | func (s *ISOService) NewExtractIsoParams(id string, mode string) *ExtractIsoParams {
p := &ExtractIsoParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
p.p["mode"] = mode
return p
} | go | func (s *ISOService) NewExtractIsoParams(id string, mode string) *ExtractIsoParams {
p := &ExtractIsoParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
p.p["mode"] = mode
return p
} | [
"func",
"(",
"s",
"*",
"ISOService",
")",
"NewExtractIsoParams",
"(",
"id",
"string",
",",
"mode",
"string",
")",
"*",
"ExtractIsoParams",
"{",
"p",
":=",
"&",
"ExtractIsoParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"id",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"mode",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new ExtractIsoParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"ExtractIsoParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ISOService.go#L671-L677 | train |
xanzy/go-cloudstack | cloudstack/ISOService.go | ExtractIso | func (s *ISOService) ExtractIso(p *ExtractIsoParams) (*ExtractIsoResponse, error) {
resp, err := s.cs.newRequest("extractIso", p.toURLValues())
if err != nil {
return nil, err
}
var r ExtractIsoResponse
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 *ISOService) ExtractIso(p *ExtractIsoParams) (*ExtractIsoResponse, error) {
resp, err := s.cs.newRequest("extractIso", p.toURLValues())
if err != nil {
return nil, err
}
var r ExtractIsoResponse
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",
"*",
"ISOService",
")",
"ExtractIso",
"(",
"p",
"*",
"ExtractIsoParams",
")",
"(",
"*",
"ExtractIsoResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"ExtractIsoResponse",
"\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",
"}"
] | // Extracts an ISO | [
"Extracts",
"an",
"ISO"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ISOService.go#L680-L712 | train |
xanzy/go-cloudstack | cloudstack/ISOService.go | NewListIsoPermissionsParams | func (s *ISOService) NewListIsoPermissionsParams(id string) *ListIsoPermissionsParams {
p := &ListIsoPermissionsParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *ISOService) NewListIsoPermissionsParams(id string) *ListIsoPermissionsParams {
p := &ListIsoPermissionsParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"ISOService",
")",
"NewListIsoPermissionsParams",
"(",
"id",
"string",
")",
"*",
"ListIsoPermissionsParams",
"{",
"p",
":=",
"&",
"ListIsoPermissionsParams",
"{",
"}",
"\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 ListIsoPermissionsParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"ListIsoPermissionsParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ISOService.go#L757-L762 | train |
xanzy/go-cloudstack | cloudstack/ISOService.go | ListIsoPermissions | func (s *ISOService) ListIsoPermissions(p *ListIsoPermissionsParams) (*ListIsoPermissionsResponse, error) {
resp, err := s.cs.newRequest("listIsoPermissions", p.toURLValues())
if err != nil {
return nil, err
}
var r ListIsoPermissionsResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | go | func (s *ISOService) ListIsoPermissions(p *ListIsoPermissionsParams) (*ListIsoPermissionsResponse, error) {
resp, err := s.cs.newRequest("listIsoPermissions", p.toURLValues())
if err != nil {
return nil, err
}
var r ListIsoPermissionsResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | [
"func",
"(",
"s",
"*",
"ISOService",
")",
"ListIsoPermissions",
"(",
"p",
"*",
"ListIsoPermissionsParams",
")",
"(",
"*",
"ListIsoPermissionsResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"ListIsoPermissionsResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"resp",
",",
"&",
"r",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"r",
",",
"nil",
"\n",
"}"
] | // List iso visibility and all accounts that have permissions to view this iso. | [
"List",
"iso",
"visibility",
"and",
"all",
"accounts",
"that",
"have",
"permissions",
"to",
"view",
"this",
"iso",
"."
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ISOService.go#L798-L810 | train |
xanzy/go-cloudstack | cloudstack/ISOService.go | NewListIsosParams | func (s *ISOService) NewListIsosParams() *ListIsosParams {
p := &ListIsosParams{}
p.p = make(map[string]interface{})
return p
} | go | func (s *ISOService) NewListIsosParams() *ListIsosParams {
p := &ListIsosParams{}
p.p = make(map[string]interface{})
return p
} | [
"func",
"(",
"s",
"*",
"ISOService",
")",
"NewListIsosParams",
"(",
")",
"*",
"ListIsosParams",
"{",
"p",
":=",
"&",
"ListIsosParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new ListIsosParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"ListIsosParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ISOService.go#L1050-L1054 | train |
xanzy/go-cloudstack | cloudstack/ISOService.go | ListIsos | func (s *ISOService) ListIsos(p *ListIsosParams) (*ListIsosResponse, error) {
resp, err := s.cs.newRequest("listIsos", p.toURLValues())
if err != nil {
return nil, err
}
var r ListIsosResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | go | func (s *ISOService) ListIsos(p *ListIsosParams) (*ListIsosResponse, error) {
resp, err := s.cs.newRequest("listIsos", p.toURLValues())
if err != nil {
return nil, err
}
var r ListIsosResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | [
"func",
"(",
"s",
"*",
"ISOService",
")",
"ListIsos",
"(",
"p",
"*",
"ListIsosParams",
")",
"(",
"*",
"ListIsosResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"ListIsosResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"resp",
",",
"&",
"r",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"r",
",",
"nil",
"\n",
"}"
] | // Lists all available ISO files. | [
"Lists",
"all",
"available",
"ISO",
"files",
"."
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ISOService.go#L1142-L1154 | train |
xanzy/go-cloudstack | cloudstack/ISOService.go | NewRegisterIsoParams | func (s *ISOService) NewRegisterIsoParams(displaytext string, name string, url string, zoneid string) *RegisterIsoParams {
p := &RegisterIsoParams{}
p.p = make(map[string]interface{})
p.p["displaytext"] = displaytext
p.p["name"] = name
p.p["url"] = url
p.p["zoneid"] = zoneid
return p
} | go | func (s *ISOService) NewRegisterIsoParams(displaytext string, name string, url string, zoneid string) *RegisterIsoParams {
p := &RegisterIsoParams{}
p.p = make(map[string]interface{})
p.p["displaytext"] = displaytext
p.p["name"] = name
p.p["url"] = url
p.p["zoneid"] = zoneid
return p
} | [
"func",
"(",
"s",
"*",
"ISOService",
")",
"NewRegisterIsoParams",
"(",
"displaytext",
"string",
",",
"name",
"string",
",",
"url",
"string",
",",
"zoneid",
"string",
")",
"*",
"RegisterIsoParams",
"{",
"p",
":=",
"&",
"RegisterIsoParams",
"{",
"}",
"\n",
"p",
".",
"p",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
")",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"displaytext",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"name",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"url",
"\n",
"p",
".",
"p",
"[",
"\"",
"\"",
"]",
"=",
"zoneid",
"\n",
"return",
"p",
"\n",
"}"
] | // You should always use this function to get a new RegisterIsoParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"RegisterIsoParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ISOService.go#L1400-L1408 | train |
xanzy/go-cloudstack | cloudstack/ISOService.go | RegisterIso | func (s *ISOService) RegisterIso(p *RegisterIsoParams) (*RegisterIsoResponse, error) {
resp, err := s.cs.newRequest("registerIso", p.toURLValues())
if err != nil {
return nil, err
}
var r RegisterIsoResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | go | func (s *ISOService) RegisterIso(p *RegisterIsoParams) (*RegisterIsoResponse, error) {
resp, err := s.cs.newRequest("registerIso", p.toURLValues())
if err != nil {
return nil, err
}
var r RegisterIsoResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | [
"func",
"(",
"s",
"*",
"ISOService",
")",
"RegisterIso",
"(",
"p",
"*",
"RegisterIsoParams",
")",
"(",
"*",
"RegisterIsoResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"RegisterIsoResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"resp",
",",
"&",
"r",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"r",
",",
"nil",
"\n",
"}"
] | // Registers an existing ISO into the CloudStack Cloud. | [
"Registers",
"an",
"existing",
"ISO",
"into",
"the",
"CloudStack",
"Cloud",
"."
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ISOService.go#L1411-L1423 | train |
xanzy/go-cloudstack | cloudstack/ISOService.go | NewUpdateIsoParams | func (s *ISOService) NewUpdateIsoParams(id string) *UpdateIsoParams {
p := &UpdateIsoParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *ISOService) NewUpdateIsoParams(id string) *UpdateIsoParams {
p := &UpdateIsoParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"ISOService",
")",
"NewUpdateIsoParams",
"(",
"id",
"string",
")",
"*",
"UpdateIsoParams",
"{",
"p",
":=",
"&",
"UpdateIsoParams",
"{",
"}",
"\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 UpdateIsoParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"UpdateIsoParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ISOService.go#L1636-L1641 | train |
xanzy/go-cloudstack | cloudstack/ISOService.go | UpdateIso | func (s *ISOService) UpdateIso(p *UpdateIsoParams) (*UpdateIsoResponse, error) {
resp, err := s.cs.newRequest("updateIso", p.toURLValues())
if err != nil {
return nil, err
}
var r UpdateIsoResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | go | func (s *ISOService) UpdateIso(p *UpdateIsoParams) (*UpdateIsoResponse, error) {
resp, err := s.cs.newRequest("updateIso", p.toURLValues())
if err != nil {
return nil, err
}
var r UpdateIsoResponse
if err := json.Unmarshal(resp, &r); err != nil {
return nil, err
}
return &r, nil
} | [
"func",
"(",
"s",
"*",
"ISOService",
")",
"UpdateIso",
"(",
"p",
"*",
"UpdateIsoParams",
")",
"(",
"*",
"UpdateIsoResponse",
",",
"error",
")",
"{",
"resp",
",",
"err",
":=",
"s",
".",
"cs",
".",
"newRequest",
"(",
"\"",
"\"",
",",
"p",
".",
"toURLValues",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"var",
"r",
"UpdateIsoResponse",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"resp",
",",
"&",
"r",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"&",
"r",
",",
"nil",
"\n",
"}"
] | // Updates an ISO file. | [
"Updates",
"an",
"ISO",
"file",
"."
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ISOService.go#L1644-L1656 | train |
xanzy/go-cloudstack | cloudstack/ISOService.go | NewUpdateIsoPermissionsParams | func (s *ISOService) NewUpdateIsoPermissionsParams(id string) *UpdateIsoPermissionsParams {
p := &UpdateIsoPermissionsParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | go | func (s *ISOService) NewUpdateIsoPermissionsParams(id string) *UpdateIsoPermissionsParams {
p := &UpdateIsoPermissionsParams{}
p.p = make(map[string]interface{})
p.p["id"] = id
return p
} | [
"func",
"(",
"s",
"*",
"ISOService",
")",
"NewUpdateIsoPermissionsParams",
"(",
"id",
"string",
")",
"*",
"UpdateIsoPermissionsParams",
"{",
"p",
":=",
"&",
"UpdateIsoPermissionsParams",
"{",
"}",
"\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 UpdateIsoPermissionsParams instance,
// as then you are sure you have configured all required params | [
"You",
"should",
"always",
"use",
"this",
"function",
"to",
"get",
"a",
"new",
"UpdateIsoPermissionsParams",
"instance",
"as",
"then",
"you",
"are",
"sure",
"you",
"have",
"configured",
"all",
"required",
"params"
] | b6f53ed3282d22b6446422879587b0a78e1b0f11 | https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ISOService.go#L1797-L1802 | train |
Subsets and Splits
SQL Console for semeru/code-text-go
Retrieves a limited set of code samples with their languages, with a specific case adjustment for 'Go' language.