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/GuestOSService.go
NewListGuestOsMappingParams
func (s *GuestOSService) NewListGuestOsMappingParams() *ListGuestOsMappingParams { p := &ListGuestOsMappingParams{} p.p = make(map[string]interface{}) return p }
go
func (s *GuestOSService) NewListGuestOsMappingParams() *ListGuestOsMappingParams { p := &ListGuestOsMappingParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "GuestOSService", ")", "NewListGuestOsMappingParams", "(", ")", "*", "ListGuestOsMappingParams", "{", "p", ":=", "&", "ListGuestOsMappingParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListGuestOsMappingParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListGuestOsMappingParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/GuestOSService.go#L358-L362
train
xanzy/go-cloudstack
cloudstack/GuestOSService.go
ListGuestOsMapping
func (s *GuestOSService) ListGuestOsMapping(p *ListGuestOsMappingParams) (*ListGuestOsMappingResponse, error) { resp, err := s.cs.newRequest("listGuestOsMapping", p.toURLValues()) if err != nil { return nil, err } var r ListGuestOsMappingResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *GuestOSService) ListGuestOsMapping(p *ListGuestOsMappingParams) (*ListGuestOsMappingResponse, error) { resp, err := s.cs.newRequest("listGuestOsMapping", p.toURLValues()) if err != nil { return nil, err } var r ListGuestOsMappingResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "GuestOSService", ")", "ListGuestOsMapping", "(", "p", "*", "ListGuestOsMappingParams", ")", "(", "*", "ListGuestOsMappingResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListGuestOsMappingResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Lists all available OS mappings for given hypervisor
[ "Lists", "all", "available", "OS", "mappings", "for", "given", "hypervisor" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/GuestOSService.go#L398-L410
train
xanzy/go-cloudstack
cloudstack/GuestOSService.go
NewListOsCategoriesParams
func (s *GuestOSService) NewListOsCategoriesParams() *ListOsCategoriesParams { p := &ListOsCategoriesParams{} p.p = make(map[string]interface{}) return p }
go
func (s *GuestOSService) NewListOsCategoriesParams() *ListOsCategoriesParams { p := &ListOsCategoriesParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "GuestOSService", ")", "NewListOsCategoriesParams", "(", ")", "*", "ListOsCategoriesParams", "{", "p", ":=", "&", "ListOsCategoriesParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListOsCategoriesParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListOsCategoriesParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/GuestOSService.go#L498-L502
train
xanzy/go-cloudstack
cloudstack/GuestOSService.go
ListOsCategories
func (s *GuestOSService) ListOsCategories(p *ListOsCategoriesParams) (*ListOsCategoriesResponse, error) { resp, err := s.cs.newRequest("listOsCategories", p.toURLValues()) if err != nil { return nil, err } var r ListOsCategoriesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *GuestOSService) ListOsCategories(p *ListOsCategoriesParams) (*ListOsCategoriesResponse, error) { resp, err := s.cs.newRequest("listOsCategories", p.toURLValues()) if err != nil { return nil, err } var r ListOsCategoriesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "GuestOSService", ")", "ListOsCategories", "(", "p", "*", "ListOsCategoriesParams", ")", "(", "*", "ListOsCategoriesResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListOsCategoriesResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Lists all supported OS categories for this cloud.
[ "Lists", "all", "supported", "OS", "categories", "for", "this", "cloud", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/GuestOSService.go#L588-L600
train
xanzy/go-cloudstack
cloudstack/GuestOSService.go
NewListOsTypesParams
func (s *GuestOSService) NewListOsTypesParams() *ListOsTypesParams { p := &ListOsTypesParams{} p.p = make(map[string]interface{}) return p }
go
func (s *GuestOSService) NewListOsTypesParams() *ListOsTypesParams { p := &ListOsTypesParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "GuestOSService", ")", "NewListOsTypesParams", "(", ")", "*", "ListOsTypesParams", "{", "p", ":=", "&", "ListOsTypesParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListOsTypesParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListOsTypesParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/GuestOSService.go#L694-L698
train
xanzy/go-cloudstack
cloudstack/GuestOSService.go
ListOsTypes
func (s *GuestOSService) ListOsTypes(p *ListOsTypesParams) (*ListOsTypesResponse, error) { resp, err := s.cs.newRequest("listOsTypes", p.toURLValues()) if err != nil { return nil, err } var r ListOsTypesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *GuestOSService) ListOsTypes(p *ListOsTypesParams) (*ListOsTypesResponse, error) { resp, err := s.cs.newRequest("listOsTypes", p.toURLValues()) if err != nil { return nil, err } var r ListOsTypesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "GuestOSService", ")", "ListOsTypes", "(", "p", "*", "ListOsTypesParams", ")", "(", "*", "ListOsTypesResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListOsTypesResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Lists all supported OS types for this cloud.
[ "Lists", "all", "supported", "OS", "types", "for", "this", "cloud", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/GuestOSService.go#L734-L746
train
xanzy/go-cloudstack
cloudstack/GuestOSService.go
NewRemoveGuestOsParams
func (s *GuestOSService) NewRemoveGuestOsParams(id string) *RemoveGuestOsParams { p := &RemoveGuestOsParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *GuestOSService) NewRemoveGuestOsParams(id string) *RemoveGuestOsParams { p := &RemoveGuestOsParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "GuestOSService", ")", "NewRemoveGuestOsParams", "(", "id", "string", ")", "*", "RemoveGuestOsParams", "{", "p", ":=", "&", "RemoveGuestOsParams", "{", "}", "\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 RemoveGuestOsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "RemoveGuestOsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/GuestOSService.go#L785-L790
train
xanzy/go-cloudstack
cloudstack/GuestOSService.go
RemoveGuestOs
func (s *GuestOSService) RemoveGuestOs(p *RemoveGuestOsParams) (*RemoveGuestOsResponse, error) { resp, err := s.cs.newRequest("removeGuestOs", p.toURLValues()) if err != nil { return nil, err } var r RemoveGuestOsResponse 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 *GuestOSService) RemoveGuestOs(p *RemoveGuestOsParams) (*RemoveGuestOsResponse, error) { resp, err := s.cs.newRequest("removeGuestOs", p.toURLValues()) if err != nil { return nil, err } var r RemoveGuestOsResponse 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", "*", "GuestOSService", ")", "RemoveGuestOs", "(", "p", "*", "RemoveGuestOsParams", ")", "(", "*", "RemoveGuestOsResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "RemoveGuestOsResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Removes a Guest OS from listing.
[ "Removes", "a", "Guest", "OS", "from", "listing", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/GuestOSService.go#L793-L820
train
xanzy/go-cloudstack
cloudstack/GuestOSService.go
NewRemoveGuestOsMappingParams
func (s *GuestOSService) NewRemoveGuestOsMappingParams(id string) *RemoveGuestOsMappingParams { p := &RemoveGuestOsMappingParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *GuestOSService) NewRemoveGuestOsMappingParams(id string) *RemoveGuestOsMappingParams { p := &RemoveGuestOsMappingParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "GuestOSService", ")", "NewRemoveGuestOsMappingParams", "(", "id", "string", ")", "*", "RemoveGuestOsMappingParams", "{", "p", ":=", "&", "RemoveGuestOsMappingParams", "{", "}", "\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 RemoveGuestOsMappingParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "RemoveGuestOsMappingParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/GuestOSService.go#L853-L858
train
xanzy/go-cloudstack
cloudstack/GuestOSService.go
RemoveGuestOsMapping
func (s *GuestOSService) RemoveGuestOsMapping(p *RemoveGuestOsMappingParams) (*RemoveGuestOsMappingResponse, error) { resp, err := s.cs.newRequest("removeGuestOsMapping", p.toURLValues()) if err != nil { return nil, err } var r RemoveGuestOsMappingResponse 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 *GuestOSService) RemoveGuestOsMapping(p *RemoveGuestOsMappingParams) (*RemoveGuestOsMappingResponse, error) { resp, err := s.cs.newRequest("removeGuestOsMapping", p.toURLValues()) if err != nil { return nil, err } var r RemoveGuestOsMappingResponse 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", "*", "GuestOSService", ")", "RemoveGuestOsMapping", "(", "p", "*", "RemoveGuestOsMappingParams", ")", "(", "*", "RemoveGuestOsMappingResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "RemoveGuestOsMappingResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Removes a Guest OS Mapping.
[ "Removes", "a", "Guest", "OS", "Mapping", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/GuestOSService.go#L861-L888
train
xanzy/go-cloudstack
cloudstack/GuestOSService.go
NewUpdateGuestOsParams
func (s *GuestOSService) NewUpdateGuestOsParams(details map[string]string, id string, osdisplayname string) *UpdateGuestOsParams { p := &UpdateGuestOsParams{} p.p = make(map[string]interface{}) p.p["details"] = details p.p["id"] = id p.p["osdisplayname"] = osdisplayname return p }
go
func (s *GuestOSService) NewUpdateGuestOsParams(details map[string]string, id string, osdisplayname string) *UpdateGuestOsParams { p := &UpdateGuestOsParams{} p.p = make(map[string]interface{}) p.p["details"] = details p.p["id"] = id p.p["osdisplayname"] = osdisplayname return p }
[ "func", "(", "s", "*", "GuestOSService", ")", "NewUpdateGuestOsParams", "(", "details", "map", "[", "string", "]", "string", ",", "id", "string", ",", "osdisplayname", "string", ")", "*", "UpdateGuestOsParams", "{", "p", ":=", "&", "UpdateGuestOsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "details", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "osdisplayname", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new UpdateGuestOsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "UpdateGuestOsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/GuestOSService.go#L947-L954
train
xanzy/go-cloudstack
cloudstack/GuestOSService.go
UpdateGuestOs
func (s *GuestOSService) UpdateGuestOs(p *UpdateGuestOsParams) (*UpdateGuestOsResponse, error) { resp, err := s.cs.newRequest("updateGuestOs", p.toURLValues()) if err != nil { return nil, err } var r UpdateGuestOsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *GuestOSService) UpdateGuestOs(p *UpdateGuestOsParams) (*UpdateGuestOsResponse, error) { resp, err := s.cs.newRequest("updateGuestOs", p.toURLValues()) if err != nil { return nil, err } var r UpdateGuestOsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "GuestOSService", ")", "UpdateGuestOs", "(", "p", "*", "UpdateGuestOsParams", ")", "(", "*", "UpdateGuestOsResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "UpdateGuestOsResponse", "\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 the information about Guest OS
[ "Updates", "the", "information", "about", "Guest", "OS" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/GuestOSService.go#L957-L989
train
xanzy/go-cloudstack
cloudstack/GuestOSService.go
NewUpdateGuestOsMappingParams
func (s *GuestOSService) NewUpdateGuestOsMappingParams(id string, osnameforhypervisor string) *UpdateGuestOsMappingParams { p := &UpdateGuestOsMappingParams{} p.p = make(map[string]interface{}) p.p["id"] = id p.p["osnameforhypervisor"] = osnameforhypervisor return p }
go
func (s *GuestOSService) NewUpdateGuestOsMappingParams(id string, osnameforhypervisor string) *UpdateGuestOsMappingParams { p := &UpdateGuestOsMappingParams{} p.p = make(map[string]interface{}) p.p["id"] = id p.p["osnameforhypervisor"] = osnameforhypervisor return p }
[ "func", "(", "s", "*", "GuestOSService", ")", "NewUpdateGuestOsMappingParams", "(", "id", "string", ",", "osnameforhypervisor", "string", ")", "*", "UpdateGuestOsMappingParams", "{", "p", ":=", "&", "UpdateGuestOsMappingParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "osnameforhypervisor", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new UpdateGuestOsMappingParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "UpdateGuestOsMappingParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/GuestOSService.go#L1035-L1041
train
xanzy/go-cloudstack
cloudstack/GuestOSService.go
UpdateGuestOsMapping
func (s *GuestOSService) UpdateGuestOsMapping(p *UpdateGuestOsMappingParams) (*UpdateGuestOsMappingResponse, error) { resp, err := s.cs.newRequest("updateGuestOsMapping", p.toURLValues()) if err != nil { return nil, err } var r UpdateGuestOsMappingResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *GuestOSService) UpdateGuestOsMapping(p *UpdateGuestOsMappingParams) (*UpdateGuestOsMappingResponse, error) { resp, err := s.cs.newRequest("updateGuestOsMapping", p.toURLValues()) if err != nil { return nil, err } var r UpdateGuestOsMappingResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "GuestOSService", ")", "UpdateGuestOsMapping", "(", "p", "*", "UpdateGuestOsMappingParams", ")", "(", "*", "UpdateGuestOsMappingResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "UpdateGuestOsMappingResponse", "\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 the information about Guest OS to Hypervisor specific name mapping
[ "Updates", "the", "information", "about", "Guest", "OS", "to", "Hypervisor", "specific", "name", "mapping" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/GuestOSService.go#L1044-L1076
train
xanzy/go-cloudstack
cloudstack/BaremetalService.go
NewAddBaremetalDhcpParams
func (s *BaremetalService) NewAddBaremetalDhcpParams(dhcpservertype string, password string, physicalnetworkid string, url string, username string) *AddBaremetalDhcpParams { p := &AddBaremetalDhcpParams{} p.p = make(map[string]interface{}) p.p["dhcpservertype"] = dhcpservertype p.p["password"] = password p.p["physicalnetworkid"] = physicalnetworkid p.p["url"] = url p.p["username"] = username return p }
go
func (s *BaremetalService) NewAddBaremetalDhcpParams(dhcpservertype string, password string, physicalnetworkid string, url string, username string) *AddBaremetalDhcpParams { p := &AddBaremetalDhcpParams{} p.p = make(map[string]interface{}) p.p["dhcpservertype"] = dhcpservertype p.p["password"] = password p.p["physicalnetworkid"] = physicalnetworkid p.p["url"] = url p.p["username"] = username return p }
[ "func", "(", "s", "*", "BaremetalService", ")", "NewAddBaremetalDhcpParams", "(", "dhcpservertype", "string", ",", "password", "string", ",", "physicalnetworkid", "string", ",", "url", "string", ",", "username", "string", ")", "*", "AddBaremetalDhcpParams", "{", "p", ":=", "&", "AddBaremetalDhcpParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "dhcpservertype", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "password", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "physicalnetworkid", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "url", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "username", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new AddBaremetalDhcpParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "AddBaremetalDhcpParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BaremetalService.go#L94-L103
train
xanzy/go-cloudstack
cloudstack/BaremetalService.go
AddBaremetalDhcp
func (s *BaremetalService) AddBaremetalDhcp(p *AddBaremetalDhcpParams) (*AddBaremetalDhcpResponse, error) { resp, err := s.cs.newRequest("addBaremetalDhcp", p.toURLValues()) if err != nil { return nil, err } var r AddBaremetalDhcpResponse 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 *BaremetalService) AddBaremetalDhcp(p *AddBaremetalDhcpParams) (*AddBaremetalDhcpResponse, error) { resp, err := s.cs.newRequest("addBaremetalDhcp", p.toURLValues()) if err != nil { return nil, err } var r AddBaremetalDhcpResponse 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", "*", "BaremetalService", ")", "AddBaremetalDhcp", "(", "p", "*", "AddBaremetalDhcpParams", ")", "(", "*", "AddBaremetalDhcpResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "AddBaremetalDhcpResponse", "\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 baremetal dhcp server
[ "adds", "a", "baremetal", "dhcp", "server" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BaremetalService.go#L106-L138
train
xanzy/go-cloudstack
cloudstack/BaremetalService.go
NewAddBaremetalPxeKickStartServerParams
func (s *BaremetalService) NewAddBaremetalPxeKickStartServerParams(password string, physicalnetworkid string, pxeservertype string, tftpdir string, url string, username string) *AddBaremetalPxeKickStartServerParams { p := &AddBaremetalPxeKickStartServerParams{} p.p = make(map[string]interface{}) p.p["password"] = password p.p["physicalnetworkid"] = physicalnetworkid p.p["pxeservertype"] = pxeservertype p.p["tftpdir"] = tftpdir p.p["url"] = url p.p["username"] = username return p }
go
func (s *BaremetalService) NewAddBaremetalPxeKickStartServerParams(password string, physicalnetworkid string, pxeservertype string, tftpdir string, url string, username string) *AddBaremetalPxeKickStartServerParams { p := &AddBaremetalPxeKickStartServerParams{} p.p = make(map[string]interface{}) p.p["password"] = password p.p["physicalnetworkid"] = physicalnetworkid p.p["pxeservertype"] = pxeservertype p.p["tftpdir"] = tftpdir p.p["url"] = url p.p["username"] = username return p }
[ "func", "(", "s", "*", "BaremetalService", ")", "NewAddBaremetalPxeKickStartServerParams", "(", "password", "string", ",", "physicalnetworkid", "string", ",", "pxeservertype", "string", ",", "tftpdir", "string", ",", "url", "string", ",", "username", "string", ")", "*", "AddBaremetalPxeKickStartServerParams", "{", "p", ":=", "&", "AddBaremetalPxeKickStartServerParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "password", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "physicalnetworkid", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "pxeservertype", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "tftpdir", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "url", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "username", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new AddBaremetalPxeKickStartServerParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "AddBaremetalPxeKickStartServerParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BaremetalService.go#L240-L250
train
xanzy/go-cloudstack
cloudstack/BaremetalService.go
AddBaremetalPxeKickStartServer
func (s *BaremetalService) AddBaremetalPxeKickStartServer(p *AddBaremetalPxeKickStartServerParams) (*AddBaremetalPxeKickStartServerResponse, error) { resp, err := s.cs.newRequest("addBaremetalPxeKickStartServer", p.toURLValues()) if err != nil { return nil, err } var r AddBaremetalPxeKickStartServerResponse 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 *BaremetalService) AddBaremetalPxeKickStartServer(p *AddBaremetalPxeKickStartServerParams) (*AddBaremetalPxeKickStartServerResponse, error) { resp, err := s.cs.newRequest("addBaremetalPxeKickStartServer", p.toURLValues()) if err != nil { return nil, err } var r AddBaremetalPxeKickStartServerResponse 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", "*", "BaremetalService", ")", "AddBaremetalPxeKickStartServer", "(", "p", "*", "AddBaremetalPxeKickStartServerParams", ")", "(", "*", "AddBaremetalPxeKickStartServerResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "AddBaremetalPxeKickStartServerResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "b", ",", "err", "=", "getRawValue", "(", "b", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// add a baremetal pxe server
[ "add", "a", "baremetal", "pxe", "server" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BaremetalService.go#L253-L285
train
xanzy/go-cloudstack
cloudstack/BaremetalService.go
NewAddBaremetalPxePingServerParams
func (s *BaremetalService) NewAddBaremetalPxePingServerParams(password string, physicalnetworkid string, pingdir string, pingstorageserverip string, pxeservertype string, tftpdir string, url string, username string) *AddBaremetalPxePingServerParams { p := &AddBaremetalPxePingServerParams{} p.p = make(map[string]interface{}) p.p["password"] = password p.p["physicalnetworkid"] = physicalnetworkid p.p["pingdir"] = pingdir p.p["pingstorageserverip"] = pingstorageserverip p.p["pxeservertype"] = pxeservertype p.p["tftpdir"] = tftpdir p.p["url"] = url p.p["username"] = username return p }
go
func (s *BaremetalService) NewAddBaremetalPxePingServerParams(password string, physicalnetworkid string, pingdir string, pingstorageserverip string, pxeservertype string, tftpdir string, url string, username string) *AddBaremetalPxePingServerParams { p := &AddBaremetalPxePingServerParams{} p.p = make(map[string]interface{}) p.p["password"] = password p.p["physicalnetworkid"] = physicalnetworkid p.p["pingdir"] = pingdir p.p["pingstorageserverip"] = pingstorageserverip p.p["pxeservertype"] = pxeservertype p.p["tftpdir"] = tftpdir p.p["url"] = url p.p["username"] = username return p }
[ "func", "(", "s", "*", "BaremetalService", ")", "NewAddBaremetalPxePingServerParams", "(", "password", "string", ",", "physicalnetworkid", "string", ",", "pingdir", "string", ",", "pingstorageserverip", "string", ",", "pxeservertype", "string", ",", "tftpdir", "string", ",", "url", "string", ",", "username", "string", ")", "*", "AddBaremetalPxePingServerParams", "{", "p", ":=", "&", "AddBaremetalPxePingServerParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "password", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "physicalnetworkid", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "pingdir", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "pingstorageserverip", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "pxeservertype", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "tftpdir", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "url", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "username", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new AddBaremetalPxePingServerParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "AddBaremetalPxePingServerParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BaremetalService.go#L427-L439
train
xanzy/go-cloudstack
cloudstack/BaremetalService.go
AddBaremetalPxePingServer
func (s *BaremetalService) AddBaremetalPxePingServer(p *AddBaremetalPxePingServerParams) (*AddBaremetalPxePingServerResponse, error) { resp, err := s.cs.newRequest("addBaremetalPxePingServer", p.toURLValues()) if err != nil { return nil, err } var r AddBaremetalPxePingServerResponse 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 *BaremetalService) AddBaremetalPxePingServer(p *AddBaremetalPxePingServerParams) (*AddBaremetalPxePingServerResponse, error) { resp, err := s.cs.newRequest("addBaremetalPxePingServer", p.toURLValues()) if err != nil { return nil, err } var r AddBaremetalPxePingServerResponse 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", "*", "BaremetalService", ")", "AddBaremetalPxePingServer", "(", "p", "*", "AddBaremetalPxePingServerParams", ")", "(", "*", "AddBaremetalPxePingServerResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "AddBaremetalPxePingServerResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "b", ",", "err", "=", "getRawValue", "(", "b", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// add a baremetal ping pxe server
[ "add", "a", "baremetal", "ping", "pxe", "server" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BaremetalService.go#L442-L474
train
xanzy/go-cloudstack
cloudstack/BaremetalService.go
NewAddBaremetalRctParams
func (s *BaremetalService) NewAddBaremetalRctParams(baremetalrcturl string) *AddBaremetalRctParams { p := &AddBaremetalRctParams{} p.p = make(map[string]interface{}) p.p["baremetalrcturl"] = baremetalrcturl return p }
go
func (s *BaremetalService) NewAddBaremetalRctParams(baremetalrcturl string) *AddBaremetalRctParams { p := &AddBaremetalRctParams{} p.p = make(map[string]interface{}) p.p["baremetalrcturl"] = baremetalrcturl return p }
[ "func", "(", "s", "*", "BaremetalService", ")", "NewAddBaremetalRctParams", "(", "baremetalrcturl", "string", ")", "*", "AddBaremetalRctParams", "{", "p", ":=", "&", "AddBaremetalRctParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "baremetalrcturl", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new AddBaremetalRctParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "AddBaremetalRctParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BaremetalService.go#L508-L513
train
xanzy/go-cloudstack
cloudstack/BaremetalService.go
AddBaremetalRct
func (s *BaremetalService) AddBaremetalRct(p *AddBaremetalRctParams) (*AddBaremetalRctResponse, error) { resp, err := s.cs.newRequest("addBaremetalRct", p.toURLValues()) if err != nil { return nil, err } var r AddBaremetalRctResponse 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 *BaremetalService) AddBaremetalRct(p *AddBaremetalRctParams) (*AddBaremetalRctResponse, error) { resp, err := s.cs.newRequest("addBaremetalRct", p.toURLValues()) if err != nil { return nil, err } var r AddBaremetalRctResponse 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", "*", "BaremetalService", ")", "AddBaremetalRct", "(", "p", "*", "AddBaremetalRctParams", ")", "(", "*", "AddBaremetalRctResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "AddBaremetalRctResponse", "\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 baremetal rack configuration text
[ "adds", "baremetal", "rack", "configuration", "text" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BaremetalService.go#L516-L548
train
xanzy/go-cloudstack
cloudstack/BaremetalService.go
NewDeleteBaremetalRctParams
func (s *BaremetalService) NewDeleteBaremetalRctParams(id string) *DeleteBaremetalRctParams { p := &DeleteBaremetalRctParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *BaremetalService) NewDeleteBaremetalRctParams(id string) *DeleteBaremetalRctParams { p := &DeleteBaremetalRctParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "BaremetalService", ")", "NewDeleteBaremetalRctParams", "(", "id", "string", ")", "*", "DeleteBaremetalRctParams", "{", "p", ":=", "&", "DeleteBaremetalRctParams", "{", "}", "\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 DeleteBaremetalRctParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteBaremetalRctParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BaremetalService.go#L581-L586
train
xanzy/go-cloudstack
cloudstack/BaremetalService.go
DeleteBaremetalRct
func (s *BaremetalService) DeleteBaremetalRct(p *DeleteBaremetalRctParams) (*DeleteBaremetalRctResponse, error) { resp, err := s.cs.newRequest("deleteBaremetalRct", p.toURLValues()) if err != nil { return nil, err } var r DeleteBaremetalRctResponse 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 *BaremetalService) DeleteBaremetalRct(p *DeleteBaremetalRctParams) (*DeleteBaremetalRctResponse, error) { resp, err := s.cs.newRequest("deleteBaremetalRct", p.toURLValues()) if err != nil { return nil, err } var r DeleteBaremetalRctResponse 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", "*", "BaremetalService", ")", "DeleteBaremetalRct", "(", "p", "*", "DeleteBaremetalRctParams", ")", "(", "*", "DeleteBaremetalRctResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "DeleteBaremetalRctResponse", "\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 baremetal rack configuration text
[ "deletes", "baremetal", "rack", "configuration", "text" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BaremetalService.go#L589-L616
train
xanzy/go-cloudstack
cloudstack/BaremetalService.go
NewListBaremetalDhcpParams
func (s *BaremetalService) NewListBaremetalDhcpParams(physicalnetworkid string) *ListBaremetalDhcpParams { p := &ListBaremetalDhcpParams{} p.p = make(map[string]interface{}) p.p["physicalnetworkid"] = physicalnetworkid return p }
go
func (s *BaremetalService) NewListBaremetalDhcpParams(physicalnetworkid string) *ListBaremetalDhcpParams { p := &ListBaremetalDhcpParams{} p.p = make(map[string]interface{}) p.p["physicalnetworkid"] = physicalnetworkid return p }
[ "func", "(", "s", "*", "BaremetalService", ")", "NewListBaremetalDhcpParams", "(", "physicalnetworkid", "string", ")", "*", "ListBaremetalDhcpParams", "{", "p", ":=", "&", "ListBaremetalDhcpParams", "{", "}", "\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 ListBaremetalDhcpParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListBaremetalDhcpParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BaremetalService.go#L707-L712
train
xanzy/go-cloudstack
cloudstack/BaremetalService.go
ListBaremetalDhcp
func (s *BaremetalService) ListBaremetalDhcp(p *ListBaremetalDhcpParams) (*ListBaremetalDhcpResponse, error) { resp, err := s.cs.newRequest("listBaremetalDhcp", p.toURLValues()) if err != nil { return nil, err } var r ListBaremetalDhcpResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *BaremetalService) ListBaremetalDhcp(p *ListBaremetalDhcpParams) (*ListBaremetalDhcpResponse, error) { resp, err := s.cs.newRequest("listBaremetalDhcp", p.toURLValues()) if err != nil { return nil, err } var r ListBaremetalDhcpResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "BaremetalService", ")", "ListBaremetalDhcp", "(", "p", "*", "ListBaremetalDhcpParams", ")", "(", "*", "ListBaremetalDhcpResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListBaremetalDhcpResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// list baremetal dhcp servers
[ "list", "baremetal", "dhcp", "servers" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BaremetalService.go#L715-L727
train
xanzy/go-cloudstack
cloudstack/BaremetalService.go
NewListBaremetalPxeServersParams
func (s *BaremetalService) NewListBaremetalPxeServersParams(physicalnetworkid string) *ListBaremetalPxeServersParams { p := &ListBaremetalPxeServersParams{} p.p = make(map[string]interface{}) p.p["physicalnetworkid"] = physicalnetworkid return p }
go
func (s *BaremetalService) NewListBaremetalPxeServersParams(physicalnetworkid string) *ListBaremetalPxeServersParams { p := &ListBaremetalPxeServersParams{} p.p = make(map[string]interface{}) p.p["physicalnetworkid"] = physicalnetworkid return p }
[ "func", "(", "s", "*", "BaremetalService", ")", "NewListBaremetalPxeServersParams", "(", "physicalnetworkid", "string", ")", "*", "ListBaremetalPxeServersParams", "{", "p", ":=", "&", "ListBaremetalPxeServersParams", "{", "}", "\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 ListBaremetalPxeServersParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListBaremetalPxeServersParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BaremetalService.go#L814-L819
train
xanzy/go-cloudstack
cloudstack/BaremetalService.go
ListBaremetalPxeServers
func (s *BaremetalService) ListBaremetalPxeServers(p *ListBaremetalPxeServersParams) (*ListBaremetalPxeServersResponse, error) { resp, err := s.cs.newRequest("listBaremetalPxeServers", p.toURLValues()) if err != nil { return nil, err } var r ListBaremetalPxeServersResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *BaremetalService) ListBaremetalPxeServers(p *ListBaremetalPxeServersParams) (*ListBaremetalPxeServersResponse, error) { resp, err := s.cs.newRequest("listBaremetalPxeServers", p.toURLValues()) if err != nil { return nil, err } var r ListBaremetalPxeServersResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "BaremetalService", ")", "ListBaremetalPxeServers", "(", "p", "*", "ListBaremetalPxeServersParams", ")", "(", "*", "ListBaremetalPxeServersResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListBaremetalPxeServersResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// list baremetal pxe server
[ "list", "baremetal", "pxe", "server" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BaremetalService.go#L822-L834
train
xanzy/go-cloudstack
cloudstack/BaremetalService.go
NewListBaremetalRctParams
func (s *BaremetalService) NewListBaremetalRctParams() *ListBaremetalRctParams { p := &ListBaremetalRctParams{} p.p = make(map[string]interface{}) return p }
go
func (s *BaremetalService) NewListBaremetalRctParams() *ListBaremetalRctParams { p := &ListBaremetalRctParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "BaremetalService", ")", "NewListBaremetalRctParams", "(", ")", "*", "ListBaremetalRctParams", "{", "p", ":=", "&", "ListBaremetalRctParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListBaremetalRctParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListBaremetalRctParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BaremetalService.go#L897-L901
train
xanzy/go-cloudstack
cloudstack/BaremetalService.go
ListBaremetalRct
func (s *BaremetalService) ListBaremetalRct(p *ListBaremetalRctParams) (*ListBaremetalRctResponse, error) { resp, err := s.cs.newRequest("listBaremetalRct", p.toURLValues()) if err != nil { return nil, err } var r ListBaremetalRctResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *BaremetalService) ListBaremetalRct(p *ListBaremetalRctParams) (*ListBaremetalRctResponse, error) { resp, err := s.cs.newRequest("listBaremetalRct", p.toURLValues()) if err != nil { return nil, err } var r ListBaremetalRctResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "BaremetalService", ")", "ListBaremetalRct", "(", "p", "*", "ListBaremetalRctParams", ")", "(", "*", "ListBaremetalRctResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListBaremetalRctResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// list baremetal rack configuration
[ "list", "baremetal", "rack", "configuration" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BaremetalService.go#L904-L916
train
xanzy/go-cloudstack
cloudstack/BaremetalService.go
NewNotifyBaremetalProvisionDoneParams
func (s *BaremetalService) NewNotifyBaremetalProvisionDoneParams(mac string) *NotifyBaremetalProvisionDoneParams { p := &NotifyBaremetalProvisionDoneParams{} p.p = make(map[string]interface{}) p.p["mac"] = mac return p }
go
func (s *BaremetalService) NewNotifyBaremetalProvisionDoneParams(mac string) *NotifyBaremetalProvisionDoneParams { p := &NotifyBaremetalProvisionDoneParams{} p.p = make(map[string]interface{}) p.p["mac"] = mac return p }
[ "func", "(", "s", "*", "BaremetalService", ")", "NewNotifyBaremetalProvisionDoneParams", "(", "mac", "string", ")", "*", "NotifyBaremetalProvisionDoneParams", "{", "p", ":=", "&", "NotifyBaremetalProvisionDoneParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "mac", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new NotifyBaremetalProvisionDoneParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "NotifyBaremetalProvisionDoneParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BaremetalService.go#L953-L958
train
xanzy/go-cloudstack
cloudstack/BaremetalService.go
NotifyBaremetalProvisionDone
func (s *BaremetalService) NotifyBaremetalProvisionDone(p *NotifyBaremetalProvisionDoneParams) (*NotifyBaremetalProvisionDoneResponse, error) { resp, err := s.cs.newRequest("notifyBaremetalProvisionDone", p.toURLValues()) if err != nil { return nil, err } var r NotifyBaremetalProvisionDoneResponse 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 *BaremetalService) NotifyBaremetalProvisionDone(p *NotifyBaremetalProvisionDoneParams) (*NotifyBaremetalProvisionDoneResponse, error) { resp, err := s.cs.newRequest("notifyBaremetalProvisionDone", p.toURLValues()) if err != nil { return nil, err } var r NotifyBaremetalProvisionDoneResponse 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", "*", "BaremetalService", ")", "NotifyBaremetalProvisionDone", "(", "p", "*", "NotifyBaremetalProvisionDoneParams", ")", "(", "*", "NotifyBaremetalProvisionDoneResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "NotifyBaremetalProvisionDoneResponse", "\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", "}" ]
// Notify provision has been done on a host. This api is for baremetal virtual router service, not for end user
[ "Notify", "provision", "has", "been", "done", "on", "a", "host", ".", "This", "api", "is", "for", "baremetal", "virtual", "router", "service", "not", "for", "end", "user" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BaremetalService.go#L961-L988
train
xanzy/go-cloudstack
cloudstack/PortableIPService.go
NewCreatePortableIpRangeParams
func (s *PortableIPService) NewCreatePortableIpRangeParams(endip string, gateway string, netmask string, regionid int, startip string) *CreatePortableIpRangeParams { p := &CreatePortableIpRangeParams{} p.p = make(map[string]interface{}) p.p["endip"] = endip p.p["gateway"] = gateway p.p["netmask"] = netmask p.p["regionid"] = regionid p.p["startip"] = startip return p }
go
func (s *PortableIPService) NewCreatePortableIpRangeParams(endip string, gateway string, netmask string, regionid int, startip string) *CreatePortableIpRangeParams { p := &CreatePortableIpRangeParams{} p.p = make(map[string]interface{}) p.p["endip"] = endip p.p["gateway"] = gateway p.p["netmask"] = netmask p.p["regionid"] = regionid p.p["startip"] = startip return p }
[ "func", "(", "s", "*", "PortableIPService", ")", "NewCreatePortableIpRangeParams", "(", "endip", "string", ",", "gateway", "string", ",", "netmask", "string", ",", "regionid", "int", ",", "startip", "string", ")", "*", "CreatePortableIpRangeParams", "{", "p", ":=", "&", "CreatePortableIpRangeParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "endip", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "gateway", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "netmask", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "regionid", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "startip", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new CreatePortableIpRangeParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "CreatePortableIpRangeParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/PortableIPService.go#L108-L117
train
xanzy/go-cloudstack
cloudstack/PortableIPService.go
CreatePortableIpRange
func (s *PortableIPService) CreatePortableIpRange(p *CreatePortableIpRangeParams) (*CreatePortableIpRangeResponse, error) { resp, err := s.cs.newRequest("createPortableIpRange", p.toURLValues()) if err != nil { return nil, err } var r CreatePortableIpRangeResponse 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 *PortableIPService) CreatePortableIpRange(p *CreatePortableIpRangeParams) (*CreatePortableIpRangeResponse, error) { resp, err := s.cs.newRequest("createPortableIpRange", p.toURLValues()) if err != nil { return nil, err } var r CreatePortableIpRangeResponse 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", "*", "PortableIPService", ")", "CreatePortableIpRange", "(", "p", "*", "CreatePortableIpRangeParams", ")", "(", "*", "CreatePortableIpRangeResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "CreatePortableIpRangeResponse", "\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 range of portable public IP's to a region
[ "adds", "a", "range", "of", "portable", "public", "IP", "s", "to", "a", "region" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/PortableIPService.go#L120-L152
train
xanzy/go-cloudstack
cloudstack/PortableIPService.go
NewDeletePortableIpRangeParams
func (s *PortableIPService) NewDeletePortableIpRangeParams(id string) *DeletePortableIpRangeParams { p := &DeletePortableIpRangeParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *PortableIPService) NewDeletePortableIpRangeParams(id string) *DeletePortableIpRangeParams { p := &DeletePortableIpRangeParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "PortableIPService", ")", "NewDeletePortableIpRangeParams", "(", "id", "string", ")", "*", "DeletePortableIpRangeParams", "{", "p", ":=", "&", "DeletePortableIpRangeParams", "{", "}", "\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 DeletePortableIpRangeParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeletePortableIpRangeParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/PortableIPService.go#L204-L209
train
xanzy/go-cloudstack
cloudstack/PortableIPService.go
DeletePortableIpRange
func (s *PortableIPService) DeletePortableIpRange(p *DeletePortableIpRangeParams) (*DeletePortableIpRangeResponse, error) { resp, err := s.cs.newRequest("deletePortableIpRange", p.toURLValues()) if err != nil { return nil, err } var r DeletePortableIpRangeResponse 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 *PortableIPService) DeletePortableIpRange(p *DeletePortableIpRangeParams) (*DeletePortableIpRangeResponse, error) { resp, err := s.cs.newRequest("deletePortableIpRange", p.toURLValues()) if err != nil { return nil, err } var r DeletePortableIpRangeResponse 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", "*", "PortableIPService", ")", "DeletePortableIpRange", "(", "p", "*", "DeletePortableIpRangeParams", ")", "(", "*", "DeletePortableIpRangeResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "DeletePortableIpRangeResponse", "\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 a range of portable public IP's associated with a region
[ "deletes", "a", "range", "of", "portable", "public", "IP", "s", "associated", "with", "a", "region" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/PortableIPService.go#L212-L239
train
xanzy/go-cloudstack
cloudstack/PortableIPService.go
NewListPortableIpRangesParams
func (s *PortableIPService) NewListPortableIpRangesParams() *ListPortableIpRangesParams { p := &ListPortableIpRangesParams{} p.p = make(map[string]interface{}) return p }
go
func (s *PortableIPService) NewListPortableIpRangesParams() *ListPortableIpRangesParams { p := &ListPortableIpRangesParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "PortableIPService", ")", "NewListPortableIpRangesParams", "(", ")", "*", "ListPortableIpRangesParams", "{", "p", ":=", "&", "ListPortableIpRangesParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListPortableIpRangesParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListPortableIpRangesParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/PortableIPService.go#L319-L323
train
xanzy/go-cloudstack
cloudstack/PortableIPService.go
ListPortableIpRanges
func (s *PortableIPService) ListPortableIpRanges(p *ListPortableIpRangesParams) (*ListPortableIpRangesResponse, error) { resp, err := s.cs.newRequest("listPortableIpRanges", p.toURLValues()) if err != nil { return nil, err } var r ListPortableIpRangesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *PortableIPService) ListPortableIpRanges(p *ListPortableIpRangesParams) (*ListPortableIpRangesResponse, error) { resp, err := s.cs.newRequest("listPortableIpRanges", p.toURLValues()) if err != nil { return nil, err } var r ListPortableIpRangesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "PortableIPService", ")", "ListPortableIpRanges", "(", "p", "*", "ListPortableIpRangesParams", ")", "(", "*", "ListPortableIpRangesResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListPortableIpRangesResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// list portable IP ranges
[ "list", "portable", "IP", "ranges" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/PortableIPService.go#L359-L371
train
xanzy/go-cloudstack
cloudstack/ResourcetagsService.go
NewCreateTagsParams
func (s *ResourcetagsService) NewCreateTagsParams(resourceids []string, resourcetype string, tags map[string]string) *CreateTagsParams { p := &CreateTagsParams{} p.p = make(map[string]interface{}) p.p["resourceids"] = resourceids p.p["resourcetype"] = resourcetype p.p["tags"] = tags return p }
go
func (s *ResourcetagsService) NewCreateTagsParams(resourceids []string, resourcetype string, tags map[string]string) *CreateTagsParams { p := &CreateTagsParams{} p.p = make(map[string]interface{}) p.p["resourceids"] = resourceids p.p["resourcetype"] = resourcetype p.p["tags"] = tags return p }
[ "func", "(", "s", "*", "ResourcetagsService", ")", "NewCreateTagsParams", "(", "resourceids", "[", "]", "string", ",", "resourcetype", "string", ",", "tags", "map", "[", "string", "]", "string", ")", "*", "CreateTagsParams", "{", "p", ":=", "&", "CreateTagsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "resourceids", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "resourcetype", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "tags", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new CreateTagsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "CreateTagsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ResourcetagsService.go#L91-L98
train
xanzy/go-cloudstack
cloudstack/ResourcetagsService.go
NewDeleteTagsParams
func (s *ResourcetagsService) NewDeleteTagsParams(resourceids []string, resourcetype string) *DeleteTagsParams { p := &DeleteTagsParams{} p.p = make(map[string]interface{}) p.p["resourceids"] = resourceids p.p["resourcetype"] = resourcetype return p }
go
func (s *ResourcetagsService) NewDeleteTagsParams(resourceids []string, resourcetype string) *DeleteTagsParams { p := &DeleteTagsParams{} p.p = make(map[string]interface{}) p.p["resourceids"] = resourceids p.p["resourcetype"] = resourcetype return p }
[ "func", "(", "s", "*", "ResourcetagsService", ")", "NewDeleteTagsParams", "(", "resourceids", "[", "]", "string", ",", "resourcetype", "string", ")", "*", "DeleteTagsParams", "{", "p", ":=", "&", "DeleteTagsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "resourceids", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "resourcetype", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteTagsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteTagsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ResourcetagsService.go#L189-L195
train
xanzy/go-cloudstack
cloudstack/ResourcetagsService.go
NewListStorageTagsParams
func (s *ResourcetagsService) NewListStorageTagsParams() *ListStorageTagsParams { p := &ListStorageTagsParams{} p.p = make(map[string]interface{}) return p }
go
func (s *ResourcetagsService) NewListStorageTagsParams() *ListStorageTagsParams { p := &ListStorageTagsParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "ResourcetagsService", ")", "NewListStorageTagsParams", "(", ")", "*", "ListStorageTagsParams", "{", "p", ":=", "&", "ListStorageTagsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListStorageTagsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListStorageTagsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ResourcetagsService.go#L282-L286
train
xanzy/go-cloudstack
cloudstack/ResourcetagsService.go
NewListTagsParams
func (s *ResourcetagsService) NewListTagsParams() *ListTagsParams { p := &ListTagsParams{} p.p = make(map[string]interface{}) return p }
go
func (s *ResourcetagsService) NewListTagsParams() *ListTagsParams { p := &ListTagsParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "ResourcetagsService", ")", "NewListTagsParams", "(", ")", "*", "ListTagsParams", "{", "p", ":=", "&", "ListTagsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListTagsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListTagsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ResourcetagsService.go#L511-L515
train
xanzy/go-cloudstack
cloudstack/NetworkOfferingService.go
NewCreateNetworkOfferingParams
func (s *NetworkOfferingService) NewCreateNetworkOfferingParams(displaytext string, guestiptype string, name string, supportedservices []string, traffictype string) *CreateNetworkOfferingParams { p := &CreateNetworkOfferingParams{} p.p = make(map[string]interface{}) p.p["displaytext"] = displaytext p.p["guestiptype"] = guestiptype p.p["name"] = name p.p["supportedservices"] = supportedservices p.p["traffictype"] = traffictype return p }
go
func (s *NetworkOfferingService) NewCreateNetworkOfferingParams(displaytext string, guestiptype string, name string, supportedservices []string, traffictype string) *CreateNetworkOfferingParams { p := &CreateNetworkOfferingParams{} p.p = make(map[string]interface{}) p.p["displaytext"] = displaytext p.p["guestiptype"] = guestiptype p.p["name"] = name p.p["supportedservices"] = supportedservices p.p["traffictype"] = traffictype return p }
[ "func", "(", "s", "*", "NetworkOfferingService", ")", "NewCreateNetworkOfferingParams", "(", "displaytext", "string", ",", "guestiptype", "string", ",", "name", "string", ",", "supportedservices", "[", "]", "string", ",", "traffictype", "string", ")", "*", "CreateNetworkOfferingParams", "{", "p", ":=", "&", "CreateNetworkOfferingParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "displaytext", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "guestiptype", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "name", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "supportedservices", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "traffictype", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new CreateNetworkOfferingParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "CreateNetworkOfferingParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NetworkOfferingService.go#L285-L294
train
xanzy/go-cloudstack
cloudstack/NetworkOfferingService.go
NewDeleteNetworkOfferingParams
func (s *NetworkOfferingService) NewDeleteNetworkOfferingParams(id string) *DeleteNetworkOfferingParams { p := &DeleteNetworkOfferingParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *NetworkOfferingService) NewDeleteNetworkOfferingParams(id string) *DeleteNetworkOfferingParams { p := &DeleteNetworkOfferingParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "NetworkOfferingService", ")", "NewDeleteNetworkOfferingParams", "(", "id", "string", ")", "*", "DeleteNetworkOfferingParams", "{", "p", ":=", "&", "DeleteNetworkOfferingParams", "{", "}", "\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 DeleteNetworkOfferingParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteNetworkOfferingParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NetworkOfferingService.go#L388-L393
train
xanzy/go-cloudstack
cloudstack/NetworkOfferingService.go
NewListNetworkOfferingsParams
func (s *NetworkOfferingService) NewListNetworkOfferingsParams() *ListNetworkOfferingsParams { p := &ListNetworkOfferingsParams{} p.p = make(map[string]interface{}) return p }
go
func (s *NetworkOfferingService) NewListNetworkOfferingsParams() *ListNetworkOfferingsParams { p := &ListNetworkOfferingsParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "NetworkOfferingService", ")", "NewListNetworkOfferingsParams", "(", ")", "*", "ListNetworkOfferingsParams", "{", "p", ":=", "&", "ListNetworkOfferingsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListNetworkOfferingsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListNetworkOfferingsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NetworkOfferingService.go#L677-L681
train
xanzy/go-cloudstack
cloudstack/NetworkOfferingService.go
NewUpdateNetworkOfferingParams
func (s *NetworkOfferingService) NewUpdateNetworkOfferingParams() *UpdateNetworkOfferingParams { p := &UpdateNetworkOfferingParams{} p.p = make(map[string]interface{}) return p }
go
func (s *NetworkOfferingService) NewUpdateNetworkOfferingParams() *UpdateNetworkOfferingParams { p := &UpdateNetworkOfferingParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "NetworkOfferingService", ")", "NewUpdateNetworkOfferingParams", "(", ")", "*", "UpdateNetworkOfferingParams", "{", "p", ":=", "&", "UpdateNetworkOfferingParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new UpdateNetworkOfferingParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "UpdateNetworkOfferingParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NetworkOfferingService.go#L950-L954
train
xanzy/go-cloudstack
cloudstack/AffinityGroupService.go
NewCreateAffinityGroupParams
func (s *AffinityGroupService) NewCreateAffinityGroupParams(name string, affinityGroupType string) *CreateAffinityGroupParams { p := &CreateAffinityGroupParams{} p.p = make(map[string]interface{}) p.p["name"] = name p.p["type"] = affinityGroupType return p }
go
func (s *AffinityGroupService) NewCreateAffinityGroupParams(name string, affinityGroupType string) *CreateAffinityGroupParams { p := &CreateAffinityGroupParams{} p.p = make(map[string]interface{}) p.p["name"] = name p.p["type"] = affinityGroupType return p }
[ "func", "(", "s", "*", "AffinityGroupService", ")", "NewCreateAffinityGroupParams", "(", "name", "string", ",", "affinityGroupType", "string", ")", "*", "CreateAffinityGroupParams", "{", "p", ":=", "&", "CreateAffinityGroupParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "name", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "affinityGroupType", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new CreateAffinityGroupParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "CreateAffinityGroupParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/AffinityGroupService.go#L107-L113
train
xanzy/go-cloudstack
cloudstack/AffinityGroupService.go
NewDeleteAffinityGroupParams
func (s *AffinityGroupService) NewDeleteAffinityGroupParams() *DeleteAffinityGroupParams { p := &DeleteAffinityGroupParams{} p.p = make(map[string]interface{}) return p }
go
func (s *AffinityGroupService) NewDeleteAffinityGroupParams() *DeleteAffinityGroupParams { p := &DeleteAffinityGroupParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "AffinityGroupService", ")", "NewDeleteAffinityGroupParams", "(", ")", "*", "DeleteAffinityGroupParams", "{", "p", ":=", "&", "DeleteAffinityGroupParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteAffinityGroupParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteAffinityGroupParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/AffinityGroupService.go#L233-L237
train
xanzy/go-cloudstack
cloudstack/AffinityGroupService.go
NewListAffinityGroupTypesParams
func (s *AffinityGroupService) NewListAffinityGroupTypesParams() *ListAffinityGroupTypesParams { p := &ListAffinityGroupTypesParams{} p.p = make(map[string]interface{}) return p }
go
func (s *AffinityGroupService) NewListAffinityGroupTypesParams() *ListAffinityGroupTypesParams { p := &ListAffinityGroupTypesParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "AffinityGroupService", ")", "NewListAffinityGroupTypesParams", "(", ")", "*", "ListAffinityGroupTypesParams", "{", "p", ":=", "&", "ListAffinityGroupTypesParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListAffinityGroupTypesParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListAffinityGroupTypesParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/AffinityGroupService.go#L324-L328
train
xanzy/go-cloudstack
cloudstack/AffinityGroupService.go
NewListAffinityGroupsParams
func (s *AffinityGroupService) NewListAffinityGroupsParams() *ListAffinityGroupsParams { p := &ListAffinityGroupsParams{} p.p = make(map[string]interface{}) return p }
go
func (s *AffinityGroupService) NewListAffinityGroupsParams() *ListAffinityGroupsParams { p := &ListAffinityGroupsParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "AffinityGroupService", ")", "NewListAffinityGroupsParams", "(", ")", "*", "ListAffinityGroupsParams", "{", "p", ":=", "&", "ListAffinityGroupsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListAffinityGroupsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListAffinityGroupsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/AffinityGroupService.go#L504-L508
train
xanzy/go-cloudstack
cloudstack/AffinityGroupService.go
NewUpdateVMAffinityGroupParams
func (s *AffinityGroupService) NewUpdateVMAffinityGroupParams(id string) *UpdateVMAffinityGroupParams { p := &UpdateVMAffinityGroupParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *AffinityGroupService) NewUpdateVMAffinityGroupParams(id string) *UpdateVMAffinityGroupParams { p := &UpdateVMAffinityGroupParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "AffinityGroupService", ")", "NewUpdateVMAffinityGroupParams", "(", "id", "string", ")", "*", "UpdateVMAffinityGroupParams", "{", "p", ":=", "&", "UpdateVMAffinityGroupParams", "{", "}", "\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 UpdateVMAffinityGroupParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "UpdateVMAffinityGroupParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/AffinityGroupService.go#L683-L688
train
xanzy/go-cloudstack
cloudstack/StratosphereSSPService.go
NewAddStratosphereSspParams
func (s *StratosphereSSPService) NewAddStratosphereSspParams(name string, url string, zoneid string) *AddStratosphereSspParams { p := &AddStratosphereSspParams{} p.p = make(map[string]interface{}) p.p["name"] = name p.p["url"] = url p.p["zoneid"] = zoneid return p }
go
func (s *StratosphereSSPService) NewAddStratosphereSspParams(name string, url string, zoneid string) *AddStratosphereSspParams { p := &AddStratosphereSspParams{} p.p = make(map[string]interface{}) p.p["name"] = name p.p["url"] = url p.p["zoneid"] = zoneid return p }
[ "func", "(", "s", "*", "StratosphereSSPService", ")", "NewAddStratosphereSspParams", "(", "name", "string", ",", "url", "string", ",", "zoneid", "string", ")", "*", "AddStratosphereSspParams", "{", "p", ":=", "&", "AddStratosphereSspParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\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 AddStratosphereSspParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "AddStratosphereSspParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/StratosphereSSPService.go#L104-L111
train
xanzy/go-cloudstack
cloudstack/StratosphereSSPService.go
AddStratosphereSsp
func (s *StratosphereSSPService) AddStratosphereSsp(p *AddStratosphereSspParams) (*AddStratosphereSspResponse, error) { resp, err := s.cs.newRequest("addStratosphereSsp", p.toURLValues()) if err != nil { return nil, err } var r AddStratosphereSspResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *StratosphereSSPService) AddStratosphereSsp(p *AddStratosphereSspParams) (*AddStratosphereSspResponse, error) { resp, err := s.cs.newRequest("addStratosphereSsp", p.toURLValues()) if err != nil { return nil, err } var r AddStratosphereSspResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "StratosphereSSPService", ")", "AddStratosphereSsp", "(", "p", "*", "AddStratosphereSspParams", ")", "(", "*", "AddStratosphereSspResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "AddStratosphereSspResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Adds stratosphere ssp server
[ "Adds", "stratosphere", "ssp", "server" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/StratosphereSSPService.go#L114-L126
train
xanzy/go-cloudstack
cloudstack/StratosphereSSPService.go
NewDeleteStratosphereSspParams
func (s *StratosphereSSPService) NewDeleteStratosphereSspParams(hostid string) *DeleteStratosphereSspParams { p := &DeleteStratosphereSspParams{} p.p = make(map[string]interface{}) p.p["hostid"] = hostid return p }
go
func (s *StratosphereSSPService) NewDeleteStratosphereSspParams(hostid string) *DeleteStratosphereSspParams { p := &DeleteStratosphereSspParams{} p.p = make(map[string]interface{}) p.p["hostid"] = hostid return p }
[ "func", "(", "s", "*", "StratosphereSSPService", ")", "NewDeleteStratosphereSspParams", "(", "hostid", "string", ")", "*", "DeleteStratosphereSspParams", "{", "p", ":=", "&", "DeleteStratosphereSspParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "hostid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteStratosphereSspParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteStratosphereSspParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/StratosphereSSPService.go#L160-L165
train
xanzy/go-cloudstack
cloudstack/StratosphereSSPService.go
DeleteStratosphereSsp
func (s *StratosphereSSPService) DeleteStratosphereSsp(p *DeleteStratosphereSspParams) (*DeleteStratosphereSspResponse, error) { resp, err := s.cs.newRequest("deleteStratosphereSsp", p.toURLValues()) if err != nil { return nil, err } var r DeleteStratosphereSspResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *StratosphereSSPService) DeleteStratosphereSsp(p *DeleteStratosphereSspParams) (*DeleteStratosphereSspResponse, error) { resp, err := s.cs.newRequest("deleteStratosphereSsp", p.toURLValues()) if err != nil { return nil, err } var r DeleteStratosphereSspResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "StratosphereSSPService", ")", "DeleteStratosphereSsp", "(", "p", "*", "DeleteStratosphereSspParams", ")", "(", "*", "DeleteStratosphereSspResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "DeleteStratosphereSspResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Removes stratosphere ssp server
[ "Removes", "stratosphere", "ssp", "server" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/StratosphereSSPService.go#L168-L180
train
xanzy/go-cloudstack
cloudstack/AlertService.go
NewArchiveAlertsParams
func (s *AlertService) NewArchiveAlertsParams() *ArchiveAlertsParams { p := &ArchiveAlertsParams{} p.p = make(map[string]interface{}) return p }
go
func (s *AlertService) NewArchiveAlertsParams() *ArchiveAlertsParams { p := &ArchiveAlertsParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "AlertService", ")", "NewArchiveAlertsParams", "(", ")", "*", "ArchiveAlertsParams", "{", "p", ":=", "&", "ArchiveAlertsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ArchiveAlertsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ArchiveAlertsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/AlertService.go#L86-L90
train
xanzy/go-cloudstack
cloudstack/AlertService.go
ArchiveAlerts
func (s *AlertService) ArchiveAlerts(p *ArchiveAlertsParams) (*ArchiveAlertsResponse, error) { resp, err := s.cs.newRequest("archiveAlerts", p.toURLValues()) if err != nil { return nil, err } var r ArchiveAlertsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *AlertService) ArchiveAlerts(p *ArchiveAlertsParams) (*ArchiveAlertsResponse, error) { resp, err := s.cs.newRequest("archiveAlerts", p.toURLValues()) if err != nil { return nil, err } var r ArchiveAlertsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "AlertService", ")", "ArchiveAlerts", "(", "p", "*", "ArchiveAlertsParams", ")", "(", "*", "ArchiveAlertsResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ArchiveAlertsResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Archive one or more alerts.
[ "Archive", "one", "or", "more", "alerts", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/AlertService.go#L93-L105
train
xanzy/go-cloudstack
cloudstack/AlertService.go
NewDeleteAlertsParams
func (s *AlertService) NewDeleteAlertsParams() *DeleteAlertsParams { p := &DeleteAlertsParams{} p.p = make(map[string]interface{}) return p }
go
func (s *AlertService) NewDeleteAlertsParams() *DeleteAlertsParams { p := &DeleteAlertsParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "AlertService", ")", "NewDeleteAlertsParams", "(", ")", "*", "DeleteAlertsParams", "{", "p", ":=", "&", "DeleteAlertsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteAlertsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteAlertsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/AlertService.go#L190-L194
train
xanzy/go-cloudstack
cloudstack/AlertService.go
DeleteAlerts
func (s *AlertService) DeleteAlerts(p *DeleteAlertsParams) (*DeleteAlertsResponse, error) { resp, err := s.cs.newRequest("deleteAlerts", p.toURLValues()) if err != nil { return nil, err } var r DeleteAlertsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *AlertService) DeleteAlerts(p *DeleteAlertsParams) (*DeleteAlertsResponse, error) { resp, err := s.cs.newRequest("deleteAlerts", p.toURLValues()) if err != nil { return nil, err } var r DeleteAlertsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "AlertService", ")", "DeleteAlerts", "(", "p", "*", "DeleteAlertsParams", ")", "(", "*", "DeleteAlertsResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "DeleteAlertsResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Delete one or more alerts.
[ "Delete", "one", "or", "more", "alerts", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/AlertService.go#L197-L209
train
xanzy/go-cloudstack
cloudstack/AlertService.go
NewGenerateAlertParams
func (s *AlertService) NewGenerateAlertParams(description string, name string, alertType int) *GenerateAlertParams { p := &GenerateAlertParams{} p.p = make(map[string]interface{}) p.p["description"] = description p.p["name"] = name p.p["type"] = alertType return p }
go
func (s *AlertService) NewGenerateAlertParams(description string, name string, alertType int) *GenerateAlertParams { p := &GenerateAlertParams{} p.p = make(map[string]interface{}) p.p["description"] = description p.p["name"] = name p.p["type"] = alertType return p }
[ "func", "(", "s", "*", "AlertService", ")", "NewGenerateAlertParams", "(", "description", "string", ",", "name", "string", ",", "alertType", "int", ")", "*", "GenerateAlertParams", "{", "p", ":=", "&", "GenerateAlertParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "description", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "name", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "alertType", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new GenerateAlertParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "GenerateAlertParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/AlertService.go#L305-L312
train
xanzy/go-cloudstack
cloudstack/AlertService.go
GenerateAlert
func (s *AlertService) GenerateAlert(p *GenerateAlertParams) (*GenerateAlertResponse, error) { resp, err := s.cs.newRequest("generateAlert", p.toURLValues()) if err != nil { return nil, err } var r GenerateAlertResponse 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 *AlertService) GenerateAlert(p *GenerateAlertParams) (*GenerateAlertResponse, error) { resp, err := s.cs.newRequest("generateAlert", p.toURLValues()) if err != nil { return nil, err } var r GenerateAlertResponse 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", "*", "AlertService", ")", "GenerateAlert", "(", "p", "*", "GenerateAlertParams", ")", "(", "*", "GenerateAlertResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "GenerateAlertResponse", "\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", "}" ]
// Generates an alert
[ "Generates", "an", "alert" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/AlertService.go#L315-L342
train
xanzy/go-cloudstack
cloudstack/AlertService.go
NewListAlertsParams
func (s *AlertService) NewListAlertsParams() *ListAlertsParams { p := &ListAlertsParams{} p.p = make(map[string]interface{}) return p }
go
func (s *AlertService) NewListAlertsParams() *ListAlertsParams { p := &ListAlertsParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "AlertService", ")", "NewListAlertsParams", "(", ")", "*", "ListAlertsParams", "{", "p", ":=", "&", "ListAlertsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListAlertsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListAlertsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/AlertService.go#L432-L436
train
xanzy/go-cloudstack
cloudstack/AlertService.go
ListAlerts
func (s *AlertService) ListAlerts(p *ListAlertsParams) (*ListAlertsResponse, error) { resp, err := s.cs.newRequest("listAlerts", p.toURLValues()) if err != nil { return nil, err } var r ListAlertsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *AlertService) ListAlerts(p *ListAlertsParams) (*ListAlertsResponse, error) { resp, err := s.cs.newRequest("listAlerts", p.toURLValues()) if err != nil { return nil, err } var r ListAlertsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "AlertService", ")", "ListAlerts", "(", "p", "*", "ListAlertsParams", ")", "(", "*", "ListAlertsResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListAlertsResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Lists all alerts.
[ "Lists", "all", "alerts", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/AlertService.go#L522-L534
train
xanzy/go-cloudstack
cloudstack/RouterService.go
NewChangeServiceForRouterParams
func (s *RouterService) NewChangeServiceForRouterParams(id string, serviceofferingid string) *ChangeServiceForRouterParams { p := &ChangeServiceForRouterParams{} p.p = make(map[string]interface{}) p.p["id"] = id p.p["serviceofferingid"] = serviceofferingid return p }
go
func (s *RouterService) NewChangeServiceForRouterParams(id string, serviceofferingid string) *ChangeServiceForRouterParams { p := &ChangeServiceForRouterParams{} p.p = make(map[string]interface{}) p.p["id"] = id p.p["serviceofferingid"] = serviceofferingid return p }
[ "func", "(", "s", "*", "RouterService", ")", "NewChangeServiceForRouterParams", "(", "id", "string", ",", "serviceofferingid", "string", ")", "*", "ChangeServiceForRouterParams", "{", "p", ":=", "&", "ChangeServiceForRouterParams", "{", "}", "\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 ChangeServiceForRouterParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ChangeServiceForRouterParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RouterService.go#L63-L69
train
xanzy/go-cloudstack
cloudstack/RouterService.go
ChangeServiceForRouter
func (s *RouterService) ChangeServiceForRouter(p *ChangeServiceForRouterParams) (*ChangeServiceForRouterResponse, error) { resp, err := s.cs.newRequest("changeServiceForRouter", p.toURLValues()) if err != nil { return nil, err } var r ChangeServiceForRouterResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *RouterService) ChangeServiceForRouter(p *ChangeServiceForRouterParams) (*ChangeServiceForRouterResponse, error) { resp, err := s.cs.newRequest("changeServiceForRouter", p.toURLValues()) if err != nil { return nil, err } var r ChangeServiceForRouterResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "RouterService", ")", "ChangeServiceForRouter", "(", "p", "*", "ChangeServiceForRouterParams", ")", "(", "*", "ChangeServiceForRouterResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ChangeServiceForRouterResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Upgrades domain router to a new service offering
[ "Upgrades", "domain", "router", "to", "a", "new", "service", "offering" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RouterService.go#L72-L84
train
xanzy/go-cloudstack
cloudstack/RouterService.go
NewConfigureVirtualRouterElementParams
func (s *RouterService) NewConfigureVirtualRouterElementParams(enabled bool, id string) *ConfigureVirtualRouterElementParams { p := &ConfigureVirtualRouterElementParams{} p.p = make(map[string]interface{}) p.p["enabled"] = enabled p.p["id"] = id return p }
go
func (s *RouterService) NewConfigureVirtualRouterElementParams(enabled bool, id string) *ConfigureVirtualRouterElementParams { p := &ConfigureVirtualRouterElementParams{} p.p = make(map[string]interface{}) p.p["enabled"] = enabled p.p["id"] = id return p }
[ "func", "(", "s", "*", "RouterService", ")", "NewConfigureVirtualRouterElementParams", "(", "enabled", "bool", ",", "id", "string", ")", "*", "ConfigureVirtualRouterElementParams", "{", "p", ":=", "&", "ConfigureVirtualRouterElementParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "enabled", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ConfigureVirtualRouterElementParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ConfigureVirtualRouterElementParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RouterService.go#L172-L178
train
xanzy/go-cloudstack
cloudstack/RouterService.go
ConfigureVirtualRouterElement
func (s *RouterService) ConfigureVirtualRouterElement(p *ConfigureVirtualRouterElementParams) (*VirtualRouterElementResponse, error) { resp, err := s.cs.newRequest("configureVirtualRouterElement", p.toURLValues()) if err != nil { return nil, err } var r VirtualRouterElementResponse 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 *RouterService) ConfigureVirtualRouterElement(p *ConfigureVirtualRouterElementParams) (*VirtualRouterElementResponse, error) { resp, err := s.cs.newRequest("configureVirtualRouterElement", p.toURLValues()) if err != nil { return nil, err } var r VirtualRouterElementResponse 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", "*", "RouterService", ")", "ConfigureVirtualRouterElement", "(", "p", "*", "ConfigureVirtualRouterElementParams", ")", "(", "*", "VirtualRouterElementResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "VirtualRouterElementResponse", "\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", "}" ]
// Configures a virtual router element.
[ "Configures", "a", "virtual", "router", "element", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RouterService.go#L181-L213
train
xanzy/go-cloudstack
cloudstack/RouterService.go
NewCreateVirtualRouterElementParams
func (s *RouterService) NewCreateVirtualRouterElementParams(nspid string) *CreateVirtualRouterElementParams { p := &CreateVirtualRouterElementParams{} p.p = make(map[string]interface{}) p.p["nspid"] = nspid return p }
go
func (s *RouterService) NewCreateVirtualRouterElementParams(nspid string) *CreateVirtualRouterElementParams { p := &CreateVirtualRouterElementParams{} p.p = make(map[string]interface{}) p.p["nspid"] = nspid return p }
[ "func", "(", "s", "*", "RouterService", ")", "NewCreateVirtualRouterElementParams", "(", "nspid", "string", ")", "*", "CreateVirtualRouterElementParams", "{", "p", ":=", "&", "CreateVirtualRouterElementParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "nspid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new CreateVirtualRouterElementParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "CreateVirtualRouterElementParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RouterService.go#L263-L268
train
xanzy/go-cloudstack
cloudstack/RouterService.go
CreateVirtualRouterElement
func (s *RouterService) CreateVirtualRouterElement(p *CreateVirtualRouterElementParams) (*CreateVirtualRouterElementResponse, error) { resp, err := s.cs.newRequest("createVirtualRouterElement", p.toURLValues()) if err != nil { return nil, err } var r CreateVirtualRouterElementResponse 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 *RouterService) CreateVirtualRouterElement(p *CreateVirtualRouterElementParams) (*CreateVirtualRouterElementResponse, error) { resp, err := s.cs.newRequest("createVirtualRouterElement", p.toURLValues()) if err != nil { return nil, err } var r CreateVirtualRouterElementResponse 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", "*", "RouterService", ")", "CreateVirtualRouterElement", "(", "p", "*", "CreateVirtualRouterElementParams", ")", "(", "*", "CreateVirtualRouterElementResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "CreateVirtualRouterElementResponse", "\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", "}" ]
// Create a virtual router element.
[ "Create", "a", "virtual", "router", "element", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RouterService.go#L271-L303
train
xanzy/go-cloudstack
cloudstack/RouterService.go
NewDestroyRouterParams
func (s *RouterService) NewDestroyRouterParams(id string) *DestroyRouterParams { p := &DestroyRouterParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *RouterService) NewDestroyRouterParams(id string) *DestroyRouterParams { p := &DestroyRouterParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "RouterService", ")", "NewDestroyRouterParams", "(", "id", "string", ")", "*", "DestroyRouterParams", "{", "p", ":=", "&", "DestroyRouterParams", "{", "}", "\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 DestroyRouterParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DestroyRouterParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RouterService.go#L342-L347
train
xanzy/go-cloudstack
cloudstack/RouterService.go
DestroyRouter
func (s *RouterService) DestroyRouter(p *DestroyRouterParams) (*DestroyRouterResponse, error) { resp, err := s.cs.newRequest("destroyRouter", p.toURLValues()) if err != nil { return nil, err } var r DestroyRouterResponse 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 *RouterService) DestroyRouter(p *DestroyRouterParams) (*DestroyRouterResponse, error) { resp, err := s.cs.newRequest("destroyRouter", p.toURLValues()) if err != nil { return nil, err } var r DestroyRouterResponse 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", "*", "RouterService", ")", "DestroyRouter", "(", "p", "*", "DestroyRouterParams", ")", "(", "*", "DestroyRouterResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "DestroyRouterResponse", "\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 router.
[ "Destroys", "a", "router", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RouterService.go#L350-L382
train
xanzy/go-cloudstack
cloudstack/RouterService.go
NewListRoutersParams
func (s *RouterService) NewListRoutersParams() *ListRoutersParams { p := &ListRoutersParams{} p.p = make(map[string]interface{}) return p }
go
func (s *RouterService) NewListRoutersParams() *ListRoutersParams { p := &ListRoutersParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "RouterService", ")", "NewListRoutersParams", "(", ")", "*", "ListRoutersParams", "{", "p", ":=", "&", "ListRoutersParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListRoutersParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListRoutersParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RouterService.go#L662-L666
train
xanzy/go-cloudstack
cloudstack/RouterService.go
ListRouters
func (s *RouterService) ListRouters(p *ListRoutersParams) (*ListRoutersResponse, error) { resp, err := s.cs.newRequest("listRouters", p.toURLValues()) if err != nil { return nil, err } var r ListRoutersResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *RouterService) ListRouters(p *ListRoutersParams) (*ListRoutersResponse, error) { resp, err := s.cs.newRequest("listRouters", p.toURLValues()) if err != nil { return nil, err } var r ListRoutersResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "RouterService", ")", "ListRouters", "(", "p", "*", "ListRoutersParams", ")", "(", "*", "ListRoutersResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListRoutersResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// List routers.
[ "List", "routers", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RouterService.go#L752-L764
train
xanzy/go-cloudstack
cloudstack/RouterService.go
NewListVirtualRouterElementsParams
func (s *RouterService) NewListVirtualRouterElementsParams() *ListVirtualRouterElementsParams { p := &ListVirtualRouterElementsParams{} p.p = make(map[string]interface{}) return p }
go
func (s *RouterService) NewListVirtualRouterElementsParams() *ListVirtualRouterElementsParams { p := &ListVirtualRouterElementsParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "RouterService", ")", "NewListVirtualRouterElementsParams", "(", ")", "*", "ListVirtualRouterElementsParams", "{", "p", ":=", "&", "ListVirtualRouterElementsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListVirtualRouterElementsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListVirtualRouterElementsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RouterService.go#L903-L907
train
xanzy/go-cloudstack
cloudstack/RouterService.go
ListVirtualRouterElements
func (s *RouterService) ListVirtualRouterElements(p *ListVirtualRouterElementsParams) (*ListVirtualRouterElementsResponse, error) { resp, err := s.cs.newRequest("listVirtualRouterElements", p.toURLValues()) if err != nil { return nil, err } var r ListVirtualRouterElementsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *RouterService) ListVirtualRouterElements(p *ListVirtualRouterElementsParams) (*ListVirtualRouterElementsResponse, error) { resp, err := s.cs.newRequest("listVirtualRouterElements", p.toURLValues()) if err != nil { return nil, err } var r ListVirtualRouterElementsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "RouterService", ")", "ListVirtualRouterElements", "(", "p", "*", "ListVirtualRouterElementsParams", ")", "(", "*", "ListVirtualRouterElementsResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListVirtualRouterElementsResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Lists all available virtual router elements.
[ "Lists", "all", "available", "virtual", "router", "elements", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RouterService.go#L943-L955
train
xanzy/go-cloudstack
cloudstack/RouterService.go
NewRebootRouterParams
func (s *RouterService) NewRebootRouterParams(id string) *RebootRouterParams { p := &RebootRouterParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *RouterService) NewRebootRouterParams(id string) *RebootRouterParams { p := &RebootRouterParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "RouterService", ")", "NewRebootRouterParams", "(", "id", "string", ")", "*", "RebootRouterParams", "{", "p", ":=", "&", "RebootRouterParams", "{", "}", "\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 RebootRouterParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "RebootRouterParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RouterService.go#L998-L1003
train
xanzy/go-cloudstack
cloudstack/RouterService.go
NewStartRouterParams
func (s *RouterService) NewStartRouterParams(id string) *StartRouterParams { p := &StartRouterParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *RouterService) NewStartRouterParams(id string) *StartRouterParams { p := &StartRouterParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "RouterService", ")", "NewStartRouterParams", "(", "id", "string", ")", "*", "StartRouterParams", "{", "p", ":=", "&", "StartRouterParams", "{", "}", "\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 StartRouterParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "StartRouterParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RouterService.go#L1115-L1120
train
xanzy/go-cloudstack
cloudstack/RouterService.go
NewStopRouterParams
func (s *RouterService) NewStopRouterParams(id string) *StopRouterParams { p := &StopRouterParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *RouterService) NewStopRouterParams(id string) *StopRouterParams { p := &StopRouterParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "RouterService", ")", "NewStopRouterParams", "(", "id", "string", ")", "*", "StopRouterParams", "{", "p", ":=", "&", "StopRouterParams", "{", "}", "\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 StopRouterParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "StopRouterParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RouterService.go#L1244-L1249
train
xanzy/go-cloudstack
cloudstack/RouterService.go
StopRouter
func (s *RouterService) StopRouter(p *StopRouterParams) (*StopRouterResponse, error) { resp, err := s.cs.newRequest("stopRouter", p.toURLValues()) if err != nil { return nil, err } var r StopRouterResponse 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 *RouterService) StopRouter(p *StopRouterParams) (*StopRouterResponse, error) { resp, err := s.cs.newRequest("stopRouter", p.toURLValues()) if err != nil { return nil, err } var r StopRouterResponse 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", "*", "RouterService", ")", "StopRouter", "(", "p", "*", "StopRouterParams", ")", "(", "*", "StopRouterResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "StopRouterResponse", "\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", "}" ]
// Stops a router.
[ "Stops", "a", "router", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RouterService.go#L1252-L1284
train
hashicorp/go-rootcerts
rootcerts.go
ConfigureTLS
func ConfigureTLS(t *tls.Config, c *Config) error { if t == nil { return nil } pool, err := LoadCACerts(c) if err != nil { return err } t.RootCAs = pool return nil }
go
func ConfigureTLS(t *tls.Config, c *Config) error { if t == nil { return nil } pool, err := LoadCACerts(c) if err != nil { return err } t.RootCAs = pool return nil }
[ "func", "ConfigureTLS", "(", "t", "*", "tls", ".", "Config", ",", "c", "*", "Config", ")", "error", "{", "if", "t", "==", "nil", "{", "return", "nil", "\n", "}", "\n", "pool", ",", "err", ":=", "LoadCACerts", "(", "c", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "t", ".", "RootCAs", "=", "pool", "\n", "return", "nil", "\n", "}" ]
// ConfigureTLS sets up the RootCAs on the provided tls.Config based on the // Config specified.
[ "ConfigureTLS", "sets", "up", "the", "RootCAs", "on", "the", "provided", "tls", ".", "Config", "based", "on", "the", "Config", "specified", "." ]
63503fb4e1eca22f9ae0f90b49c5d5538a0e87eb
https://github.com/hashicorp/go-rootcerts/blob/63503fb4e1eca22f9ae0f90b49c5d5538a0e87eb/rootcerts.go#L27-L37
train
hashicorp/go-rootcerts
rootcerts.go
LoadCACerts
func LoadCACerts(c *Config) (*x509.CertPool, error) { if c == nil { c = &Config{} } if c.CAFile != "" { return LoadCAFile(c.CAFile) } if c.CAPath != "" { return LoadCAPath(c.CAPath) } return LoadSystemCAs() }
go
func LoadCACerts(c *Config) (*x509.CertPool, error) { if c == nil { c = &Config{} } if c.CAFile != "" { return LoadCAFile(c.CAFile) } if c.CAPath != "" { return LoadCAPath(c.CAPath) } return LoadSystemCAs() }
[ "func", "LoadCACerts", "(", "c", "*", "Config", ")", "(", "*", "x509", ".", "CertPool", ",", "error", ")", "{", "if", "c", "==", "nil", "{", "c", "=", "&", "Config", "{", "}", "\n", "}", "\n", "if", "c", ".", "CAFile", "!=", "\"", "\"", "{", "return", "LoadCAFile", "(", "c", ".", "CAFile", ")", "\n", "}", "\n", "if", "c", ".", "CAPath", "!=", "\"", "\"", "{", "return", "LoadCAPath", "(", "c", ".", "CAPath", ")", "\n", "}", "\n\n", "return", "LoadSystemCAs", "(", ")", "\n", "}" ]
// LoadCACerts loads a CertPool based on the Config specified.
[ "LoadCACerts", "loads", "a", "CertPool", "based", "on", "the", "Config", "specified", "." ]
63503fb4e1eca22f9ae0f90b49c5d5538a0e87eb
https://github.com/hashicorp/go-rootcerts/blob/63503fb4e1eca22f9ae0f90b49c5d5538a0e87eb/rootcerts.go#L40-L52
train
hashicorp/go-rootcerts
rootcerts.go
LoadCAFile
func LoadCAFile(caFile string) (*x509.CertPool, error) { pool := x509.NewCertPool() pem, err := ioutil.ReadFile(caFile) if err != nil { return nil, fmt.Errorf("Error loading CA File: %s", err) } ok := pool.AppendCertsFromPEM(pem) if !ok { return nil, fmt.Errorf("Error loading CA File: Couldn't parse PEM in: %s", caFile) } return pool, nil }
go
func LoadCAFile(caFile string) (*x509.CertPool, error) { pool := x509.NewCertPool() pem, err := ioutil.ReadFile(caFile) if err != nil { return nil, fmt.Errorf("Error loading CA File: %s", err) } ok := pool.AppendCertsFromPEM(pem) if !ok { return nil, fmt.Errorf("Error loading CA File: Couldn't parse PEM in: %s", caFile) } return pool, nil }
[ "func", "LoadCAFile", "(", "caFile", "string", ")", "(", "*", "x509", ".", "CertPool", ",", "error", ")", "{", "pool", ":=", "x509", ".", "NewCertPool", "(", ")", "\n\n", "pem", ",", "err", ":=", "ioutil", ".", "ReadFile", "(", "caFile", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n\n", "ok", ":=", "pool", ".", "AppendCertsFromPEM", "(", "pem", ")", "\n", "if", "!", "ok", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "caFile", ")", "\n", "}", "\n\n", "return", "pool", ",", "nil", "\n", "}" ]
// LoadCAFile loads a single PEM-encoded file from the path specified.
[ "LoadCAFile", "loads", "a", "single", "PEM", "-", "encoded", "file", "from", "the", "path", "specified", "." ]
63503fb4e1eca22f9ae0f90b49c5d5538a0e87eb
https://github.com/hashicorp/go-rootcerts/blob/63503fb4e1eca22f9ae0f90b49c5d5538a0e87eb/rootcerts.go#L55-L69
train
hashicorp/go-rootcerts
rootcerts.go
LoadCAPath
func LoadCAPath(caPath string) (*x509.CertPool, error) { pool := x509.NewCertPool() walkFn := func(path string, info os.FileInfo, err error) error { if err != nil { return err } if info.IsDir() { return nil } pem, err := ioutil.ReadFile(path) if err != nil { return fmt.Errorf("Error loading file from CAPath: %s", err) } ok := pool.AppendCertsFromPEM(pem) if !ok { return fmt.Errorf("Error loading CA Path: Couldn't parse PEM in: %s", path) } return nil } err := filepath.Walk(caPath, walkFn) if err != nil { return nil, err } return pool, nil }
go
func LoadCAPath(caPath string) (*x509.CertPool, error) { pool := x509.NewCertPool() walkFn := func(path string, info os.FileInfo, err error) error { if err != nil { return err } if info.IsDir() { return nil } pem, err := ioutil.ReadFile(path) if err != nil { return fmt.Errorf("Error loading file from CAPath: %s", err) } ok := pool.AppendCertsFromPEM(pem) if !ok { return fmt.Errorf("Error loading CA Path: Couldn't parse PEM in: %s", path) } return nil } err := filepath.Walk(caPath, walkFn) if err != nil { return nil, err } return pool, nil }
[ "func", "LoadCAPath", "(", "caPath", "string", ")", "(", "*", "x509", ".", "CertPool", ",", "error", ")", "{", "pool", ":=", "x509", ".", "NewCertPool", "(", ")", "\n", "walkFn", ":=", "func", "(", "path", "string", ",", "info", "os", ".", "FileInfo", ",", "err", "error", ")", "error", "{", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "if", "info", ".", "IsDir", "(", ")", "{", "return", "nil", "\n", "}", "\n\n", "pem", ",", "err", ":=", "ioutil", ".", "ReadFile", "(", "path", ")", "\n", "if", "err", "!=", "nil", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n\n", "ok", ":=", "pool", ".", "AppendCertsFromPEM", "(", "pem", ")", "\n", "if", "!", "ok", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "path", ")", "\n", "}", "\n\n", "return", "nil", "\n", "}", "\n\n", "err", ":=", "filepath", ".", "Walk", "(", "caPath", ",", "walkFn", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "pool", ",", "nil", "\n", "}" ]
// LoadCAPath walks the provided path and loads all certificates encounted into // a pool.
[ "LoadCAPath", "walks", "the", "provided", "path", "and", "loads", "all", "certificates", "encounted", "into", "a", "pool", "." ]
63503fb4e1eca22f9ae0f90b49c5d5538a0e87eb
https://github.com/hashicorp/go-rootcerts/blob/63503fb4e1eca22f9ae0f90b49c5d5538a0e87eb/rootcerts.go#L73-L103
train
hashicorp/go-rootcerts
rootcerts_darwin.go
LoadSystemCAs
func LoadSystemCAs() (*x509.CertPool, error) { pool := x509.NewCertPool() for _, keychain := range certKeychains() { err := addCertsFromKeychain(pool, keychain) if err != nil { return nil, err } } return pool, nil }
go
func LoadSystemCAs() (*x509.CertPool, error) { pool := x509.NewCertPool() for _, keychain := range certKeychains() { err := addCertsFromKeychain(pool, keychain) if err != nil { return nil, err } } return pool, nil }
[ "func", "LoadSystemCAs", "(", ")", "(", "*", "x509", ".", "CertPool", ",", "error", ")", "{", "pool", ":=", "x509", ".", "NewCertPool", "(", ")", "\n\n", "for", "_", ",", "keychain", ":=", "range", "certKeychains", "(", ")", "{", "err", ":=", "addCertsFromKeychain", "(", "pool", ",", "keychain", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "pool", ",", "nil", "\n", "}" ]
// LoadSystemCAs has special behavior on Darwin systems to work around
[ "LoadSystemCAs", "has", "special", "behavior", "on", "Darwin", "systems", "to", "work", "around" ]
63503fb4e1eca22f9ae0f90b49c5d5538a0e87eb
https://github.com/hashicorp/go-rootcerts/blob/63503fb4e1eca22f9ae0f90b49c5d5538a0e87eb/rootcerts_darwin.go#L12-L23
train
beevik/ntp
ntp.go
Duration
func (t ntpTime) Duration() time.Duration { sec := (t >> 32) * nanoPerSec frac := (t & 0xffffffff) * nanoPerSec >> 32 return time.Duration(sec + frac) }
go
func (t ntpTime) Duration() time.Duration { sec := (t >> 32) * nanoPerSec frac := (t & 0xffffffff) * nanoPerSec >> 32 return time.Duration(sec + frac) }
[ "func", "(", "t", "ntpTime", ")", "Duration", "(", ")", "time", ".", "Duration", "{", "sec", ":=", "(", "t", ">>", "32", ")", "*", "nanoPerSec", "\n", "frac", ":=", "(", "t", "&", "0xffffffff", ")", "*", "nanoPerSec", ">>", "32", "\n", "return", "time", ".", "Duration", "(", "sec", "+", "frac", ")", "\n", "}" ]
// Duration interprets the fixed-point ntpTime as a number of elapsed seconds // and returns the corresponding time.Duration value.
[ "Duration", "interprets", "the", "fixed", "-", "point", "ntpTime", "as", "a", "number", "of", "elapsed", "seconds", "and", "returns", "the", "corresponding", "time", ".", "Duration", "value", "." ]
53ffc1864695f04a9261eaaba263b1e85e5795f3
https://github.com/beevik/ntp/blob/53ffc1864695f04a9261eaaba263b1e85e5795f3/ntp.go#L77-L81
train
beevik/ntp
ntp.go
toNtpTime
func toNtpTime(t time.Time) ntpTime { nsec := uint64(t.Sub(ntpEpoch)) sec := nsec / nanoPerSec // Round up the fractional component so that repeated conversions // between time.Time and ntpTime do not yield continually decreasing // results. frac := (((nsec - sec*nanoPerSec) << 32) + nanoPerSec - 1) / nanoPerSec return ntpTime(sec<<32 | frac) }
go
func toNtpTime(t time.Time) ntpTime { nsec := uint64(t.Sub(ntpEpoch)) sec := nsec / nanoPerSec // Round up the fractional component so that repeated conversions // between time.Time and ntpTime do not yield continually decreasing // results. frac := (((nsec - sec*nanoPerSec) << 32) + nanoPerSec - 1) / nanoPerSec return ntpTime(sec<<32 | frac) }
[ "func", "toNtpTime", "(", "t", "time", ".", "Time", ")", "ntpTime", "{", "nsec", ":=", "uint64", "(", "t", ".", "Sub", "(", "ntpEpoch", ")", ")", "\n", "sec", ":=", "nsec", "/", "nanoPerSec", "\n", "// Round up the fractional component so that repeated conversions", "// between time.Time and ntpTime do not yield continually decreasing", "// results.", "frac", ":=", "(", "(", "(", "nsec", "-", "sec", "*", "nanoPerSec", ")", "<<", "32", ")", "+", "nanoPerSec", "-", "1", ")", "/", "nanoPerSec", "\n", "return", "ntpTime", "(", "sec", "<<", "32", "|", "frac", ")", "\n", "}" ]
// toNtpTime converts the time.Time value t into its 64-bit fixed-point // ntpTime representation.
[ "toNtpTime", "converts", "the", "time", ".", "Time", "value", "t", "into", "its", "64", "-", "bit", "fixed", "-", "point", "ntpTime", "representation", "." ]
53ffc1864695f04a9261eaaba263b1e85e5795f3
https://github.com/beevik/ntp/blob/53ffc1864695f04a9261eaaba263b1e85e5795f3/ntp.go#L91-L99
train
beevik/ntp
ntp.go
Duration
func (t ntpTimeShort) Duration() time.Duration { t64 := uint64(t) sec := (t64 >> 16) * nanoPerSec frac := (t64 & 0xffff) * nanoPerSec >> 16 return time.Duration(sec + frac) }
go
func (t ntpTimeShort) Duration() time.Duration { t64 := uint64(t) sec := (t64 >> 16) * nanoPerSec frac := (t64 & 0xffff) * nanoPerSec >> 16 return time.Duration(sec + frac) }
[ "func", "(", "t", "ntpTimeShort", ")", "Duration", "(", ")", "time", ".", "Duration", "{", "t64", ":=", "uint64", "(", "t", ")", "\n", "sec", ":=", "(", "t64", ">>", "16", ")", "*", "nanoPerSec", "\n", "frac", ":=", "(", "t64", "&", "0xffff", ")", "*", "nanoPerSec", ">>", "16", "\n", "return", "time", ".", "Duration", "(", "sec", "+", "frac", ")", "\n", "}" ]
// Duration interprets the fixed-point ntpTimeShort as a number of elapsed // seconds and returns the corresponding time.Duration value.
[ "Duration", "interprets", "the", "fixed", "-", "point", "ntpTimeShort", "as", "a", "number", "of", "elapsed", "seconds", "and", "returns", "the", "corresponding", "time", ".", "Duration", "value", "." ]
53ffc1864695f04a9261eaaba263b1e85e5795f3
https://github.com/beevik/ntp/blob/53ffc1864695f04a9261eaaba263b1e85e5795f3/ntp.go#L107-L112
train
beevik/ntp
ntp.go
setVersion
func (m *msg) setVersion(v int) { m.LiVnMode = (m.LiVnMode & 0xc7) | uint8(v)<<3 }
go
func (m *msg) setVersion(v int) { m.LiVnMode = (m.LiVnMode & 0xc7) | uint8(v)<<3 }
[ "func", "(", "m", "*", "msg", ")", "setVersion", "(", "v", "int", ")", "{", "m", ".", "LiVnMode", "=", "(", "m", ".", "LiVnMode", "&", "0xc7", ")", "|", "uint8", "(", "v", ")", "<<", "3", "\n", "}" ]
// setVersion sets the NTP protocol version on the message.
[ "setVersion", "sets", "the", "NTP", "protocol", "version", "on", "the", "message", "." ]
53ffc1864695f04a9261eaaba263b1e85e5795f3
https://github.com/beevik/ntp/blob/53ffc1864695f04a9261eaaba263b1e85e5795f3/ntp.go#L130-L132
train
beevik/ntp
ntp.go
setMode
func (m *msg) setMode(md mode) { m.LiVnMode = (m.LiVnMode & 0xf8) | uint8(md) }
go
func (m *msg) setMode(md mode) { m.LiVnMode = (m.LiVnMode & 0xf8) | uint8(md) }
[ "func", "(", "m", "*", "msg", ")", "setMode", "(", "md", "mode", ")", "{", "m", ".", "LiVnMode", "=", "(", "m", ".", "LiVnMode", "&", "0xf8", ")", "|", "uint8", "(", "md", ")", "\n", "}" ]
// setMode sets the NTP protocol mode on the message.
[ "setMode", "sets", "the", "NTP", "protocol", "mode", "on", "the", "message", "." ]
53ffc1864695f04a9261eaaba263b1e85e5795f3
https://github.com/beevik/ntp/blob/53ffc1864695f04a9261eaaba263b1e85e5795f3/ntp.go#L135-L137
train
beevik/ntp
ntp.go
setLeap
func (m *msg) setLeap(li LeapIndicator) { m.LiVnMode = (m.LiVnMode & 0x3f) | uint8(li)<<6 }
go
func (m *msg) setLeap(li LeapIndicator) { m.LiVnMode = (m.LiVnMode & 0x3f) | uint8(li)<<6 }
[ "func", "(", "m", "*", "msg", ")", "setLeap", "(", "li", "LeapIndicator", ")", "{", "m", ".", "LiVnMode", "=", "(", "m", ".", "LiVnMode", "&", "0x3f", ")", "|", "uint8", "(", "li", ")", "<<", "6", "\n", "}" ]
// setLeap modifies the leap indicator on the message.
[ "setLeap", "modifies", "the", "leap", "indicator", "on", "the", "message", "." ]
53ffc1864695f04a9261eaaba263b1e85e5795f3
https://github.com/beevik/ntp/blob/53ffc1864695f04a9261eaaba263b1e85e5795f3/ntp.go#L140-L142
train
beevik/ntp
ntp.go
Validate
func (r *Response) Validate() error { // Handle invalid stratum values. if r.Stratum == 0 { return fmt.Errorf("kiss of death received: %s", r.KissCode) } if r.Stratum >= maxStratum { return errors.New("invalid stratum in response") } // Handle invalid leap second indicator. if r.Leap == LeapNotInSync { return errors.New("invalid leap second") } // Estimate the "freshness" of the time. If it exceeds the maximum // polling interval (~36 hours), then it cannot be considered "fresh". freshness := r.Time.Sub(r.ReferenceTime) if freshness > maxPollInterval { return errors.New("server clock not fresh") } // Calculate the peer synchronization distance, lambda: // lambda := RootDelay/2 + RootDispersion // If this value exceeds MAXDISP (16s), then the time is not suitable // for synchronization purposes. // https://tools.ietf.org/html/rfc5905#appendix-A.5.1.1. lambda := r.RootDelay/2 + r.RootDispersion if lambda > maxDispersion { return errors.New("invalid dispersion") } // If the server's transmit time is before its reference time, the // response is invalid. if r.Time.Before(r.ReferenceTime) { return errors.New("invalid time reported") } // nil means the response is valid. return nil }
go
func (r *Response) Validate() error { // Handle invalid stratum values. if r.Stratum == 0 { return fmt.Errorf("kiss of death received: %s", r.KissCode) } if r.Stratum >= maxStratum { return errors.New("invalid stratum in response") } // Handle invalid leap second indicator. if r.Leap == LeapNotInSync { return errors.New("invalid leap second") } // Estimate the "freshness" of the time. If it exceeds the maximum // polling interval (~36 hours), then it cannot be considered "fresh". freshness := r.Time.Sub(r.ReferenceTime) if freshness > maxPollInterval { return errors.New("server clock not fresh") } // Calculate the peer synchronization distance, lambda: // lambda := RootDelay/2 + RootDispersion // If this value exceeds MAXDISP (16s), then the time is not suitable // for synchronization purposes. // https://tools.ietf.org/html/rfc5905#appendix-A.5.1.1. lambda := r.RootDelay/2 + r.RootDispersion if lambda > maxDispersion { return errors.New("invalid dispersion") } // If the server's transmit time is before its reference time, the // response is invalid. if r.Time.Before(r.ReferenceTime) { return errors.New("invalid time reported") } // nil means the response is valid. return nil }
[ "func", "(", "r", "*", "Response", ")", "Validate", "(", ")", "error", "{", "// Handle invalid stratum values.", "if", "r", ".", "Stratum", "==", "0", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "r", ".", "KissCode", ")", "\n", "}", "\n", "if", "r", ".", "Stratum", ">=", "maxStratum", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", "// Handle invalid leap second indicator.", "if", "r", ".", "Leap", "==", "LeapNotInSync", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", "// Estimate the \"freshness\" of the time. If it exceeds the maximum", "// polling interval (~36 hours), then it cannot be considered \"fresh\".", "freshness", ":=", "r", ".", "Time", ".", "Sub", "(", "r", ".", "ReferenceTime", ")", "\n", "if", "freshness", ">", "maxPollInterval", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", "// Calculate the peer synchronization distance, lambda:", "// \tlambda := RootDelay/2 + RootDispersion", "// If this value exceeds MAXDISP (16s), then the time is not suitable", "// for synchronization purposes.", "// https://tools.ietf.org/html/rfc5905#appendix-A.5.1.1.", "lambda", ":=", "r", ".", "RootDelay", "/", "2", "+", "r", ".", "RootDispersion", "\n", "if", "lambda", ">", "maxDispersion", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", "// If the server's transmit time is before its reference time, the", "// response is invalid.", "if", "r", ".", "Time", ".", "Before", "(", "r", ".", "ReferenceTime", ")", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", "// nil means the response is valid.", "return", "nil", "\n", "}" ]
// Validate checks if the response is valid for the purposes of time // synchronization.
[ "Validate", "checks", "if", "the", "response", "is", "valid", "for", "the", "purposes", "of", "time", "synchronization", "." ]
53ffc1864695f04a9261eaaba263b1e85e5795f3
https://github.com/beevik/ntp/blob/53ffc1864695f04a9261eaaba263b1e85e5795f3/ntp.go#L240-L279
train
beevik/ntp
ntp.go
QueryWithOptions
func QueryWithOptions(host string, opt QueryOptions) (*Response, error) { m, now, err := getTime(host, opt) if err != nil { return nil, err } return parseTime(m, now), nil }
go
func QueryWithOptions(host string, opt QueryOptions) (*Response, error) { m, now, err := getTime(host, opt) if err != nil { return nil, err } return parseTime(m, now), nil }
[ "func", "QueryWithOptions", "(", "host", "string", ",", "opt", "QueryOptions", ")", "(", "*", "Response", ",", "error", ")", "{", "m", ",", "now", ",", "err", ":=", "getTime", "(", "host", ",", "opt", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "parseTime", "(", "m", ",", "now", ")", ",", "nil", "\n", "}" ]
// QueryWithOptions performs the same function as Query but allows for the // customization of several query options.
[ "QueryWithOptions", "performs", "the", "same", "function", "as", "Query", "but", "allows", "for", "the", "customization", "of", "several", "query", "options", "." ]
53ffc1864695f04a9261eaaba263b1e85e5795f3
https://github.com/beevik/ntp/blob/53ffc1864695f04a9261eaaba263b1e85e5795f3/ntp.go#L290-L296
train
beevik/ntp
ntp.go
parseTime
func parseTime(m *msg, recvTime ntpTime) *Response { r := &Response{ Time: m.TransmitTime.Time(), ClockOffset: offset(m.OriginTime, m.ReceiveTime, m.TransmitTime, recvTime), RTT: rtt(m.OriginTime, m.ReceiveTime, m.TransmitTime, recvTime), Precision: toInterval(m.Precision), Stratum: m.Stratum, ReferenceID: m.ReferenceID, ReferenceTime: m.ReferenceTime.Time(), RootDelay: m.RootDelay.Duration(), RootDispersion: m.RootDispersion.Duration(), Leap: m.getLeap(), MinError: minError(m.OriginTime, m.ReceiveTime, m.TransmitTime, recvTime), Poll: toInterval(m.Poll), } // Calculate values depending on other calculated values r.RootDistance = rootDistance(r.RTT, r.RootDelay, r.RootDispersion) // If a kiss of death was received, interpret the reference ID as // a kiss code. if r.Stratum == 0 { r.KissCode = kissCode(r.ReferenceID) } return r }
go
func parseTime(m *msg, recvTime ntpTime) *Response { r := &Response{ Time: m.TransmitTime.Time(), ClockOffset: offset(m.OriginTime, m.ReceiveTime, m.TransmitTime, recvTime), RTT: rtt(m.OriginTime, m.ReceiveTime, m.TransmitTime, recvTime), Precision: toInterval(m.Precision), Stratum: m.Stratum, ReferenceID: m.ReferenceID, ReferenceTime: m.ReferenceTime.Time(), RootDelay: m.RootDelay.Duration(), RootDispersion: m.RootDispersion.Duration(), Leap: m.getLeap(), MinError: minError(m.OriginTime, m.ReceiveTime, m.TransmitTime, recvTime), Poll: toInterval(m.Poll), } // Calculate values depending on other calculated values r.RootDistance = rootDistance(r.RTT, r.RootDelay, r.RootDispersion) // If a kiss of death was received, interpret the reference ID as // a kiss code. if r.Stratum == 0 { r.KissCode = kissCode(r.ReferenceID) } return r }
[ "func", "parseTime", "(", "m", "*", "msg", ",", "recvTime", "ntpTime", ")", "*", "Response", "{", "r", ":=", "&", "Response", "{", "Time", ":", "m", ".", "TransmitTime", ".", "Time", "(", ")", ",", "ClockOffset", ":", "offset", "(", "m", ".", "OriginTime", ",", "m", ".", "ReceiveTime", ",", "m", ".", "TransmitTime", ",", "recvTime", ")", ",", "RTT", ":", "rtt", "(", "m", ".", "OriginTime", ",", "m", ".", "ReceiveTime", ",", "m", ".", "TransmitTime", ",", "recvTime", ")", ",", "Precision", ":", "toInterval", "(", "m", ".", "Precision", ")", ",", "Stratum", ":", "m", ".", "Stratum", ",", "ReferenceID", ":", "m", ".", "ReferenceID", ",", "ReferenceTime", ":", "m", ".", "ReferenceTime", ".", "Time", "(", ")", ",", "RootDelay", ":", "m", ".", "RootDelay", ".", "Duration", "(", ")", ",", "RootDispersion", ":", "m", ".", "RootDispersion", ".", "Duration", "(", ")", ",", "Leap", ":", "m", ".", "getLeap", "(", ")", ",", "MinError", ":", "minError", "(", "m", ".", "OriginTime", ",", "m", ".", "ReceiveTime", ",", "m", ".", "TransmitTime", ",", "recvTime", ")", ",", "Poll", ":", "toInterval", "(", "m", ".", "Poll", ")", ",", "}", "\n\n", "// Calculate values depending on other calculated values", "r", ".", "RootDistance", "=", "rootDistance", "(", "r", ".", "RTT", ",", "r", ".", "RootDelay", ",", "r", ".", "RootDispersion", ")", "\n\n", "// If a kiss of death was received, interpret the reference ID as", "// a kiss code.", "if", "r", ".", "Stratum", "==", "0", "{", "r", ".", "KissCode", "=", "kissCode", "(", "r", ".", "ReferenceID", ")", "\n", "}", "\n\n", "return", "r", "\n", "}" ]
// parseTime parses the NTP packet along with the packet receive time to // generate a Response record.
[ "parseTime", "parses", "the", "NTP", "packet", "along", "with", "the", "packet", "receive", "time", "to", "generate", "a", "Response", "record", "." ]
53ffc1864695f04a9261eaaba263b1e85e5795f3
https://github.com/beevik/ntp/blob/53ffc1864695f04a9261eaaba263b1e85e5795f3/ntp.go#L452-L478
train
secsy/goftp
file_system.go
Delete
func (c *Client) Delete(path string) error { pconn, err := c.getIdleConn() if err != nil { return err } defer c.returnConn(pconn) return pconn.sendCommandExpected(replyFileActionOkay, "DELE %s", path) }
go
func (c *Client) Delete(path string) error { pconn, err := c.getIdleConn() if err != nil { return err } defer c.returnConn(pconn) return pconn.sendCommandExpected(replyFileActionOkay, "DELE %s", path) }
[ "func", "(", "c", "*", "Client", ")", "Delete", "(", "path", "string", ")", "error", "{", "pconn", ",", "err", ":=", "c", ".", "getIdleConn", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "defer", "c", ".", "returnConn", "(", "pconn", ")", "\n\n", "return", "pconn", ".", "sendCommandExpected", "(", "replyFileActionOkay", ",", "\"", "\"", ",", "path", ")", "\n", "}" ]
// Delete deletes the file "path".
[ "Delete", "deletes", "the", "file", "path", "." ]
012609e90524f0bfde77100facdc47f807794c27
https://github.com/secsy/goftp/blob/012609e90524f0bfde77100facdc47f807794c27/file_system.go#L22-L31
train
secsy/goftp
file_system.go
Rename
func (c *Client) Rename(from, to string) error { pconn, err := c.getIdleConn() if err != nil { return err } defer c.returnConn(pconn) err = pconn.sendCommandExpected(replyFileActionPending, "RNFR %s", from) if err != nil { return err } return pconn.sendCommandExpected(replyFileActionOkay, "RNTO %s", to) }
go
func (c *Client) Rename(from, to string) error { pconn, err := c.getIdleConn() if err != nil { return err } defer c.returnConn(pconn) err = pconn.sendCommandExpected(replyFileActionPending, "RNFR %s", from) if err != nil { return err } return pconn.sendCommandExpected(replyFileActionOkay, "RNTO %s", to) }
[ "func", "(", "c", "*", "Client", ")", "Rename", "(", "from", ",", "to", "string", ")", "error", "{", "pconn", ",", "err", ":=", "c", ".", "getIdleConn", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "defer", "c", ".", "returnConn", "(", "pconn", ")", "\n\n", "err", "=", "pconn", ".", "sendCommandExpected", "(", "replyFileActionPending", ",", "\"", "\"", ",", "from", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "return", "pconn", ".", "sendCommandExpected", "(", "replyFileActionOkay", ",", "\"", "\"", ",", "to", ")", "\n", "}" ]
// Rename renames file "from" to "to".
[ "Rename", "renames", "file", "from", "to", "to", "." ]
012609e90524f0bfde77100facdc47f807794c27
https://github.com/secsy/goftp/blob/012609e90524f0bfde77100facdc47f807794c27/file_system.go#L34-L48
train
secsy/goftp
file_system.go
Mkdir
func (c *Client) Mkdir(path string) (string, error) { pconn, err := c.getIdleConn() if err != nil { return "", err } defer c.returnConn(pconn) code, msg, err := pconn.sendCommand("MKD %s", path) if err != nil { return "", err } if code != replyDirCreated { return "", ftpError{code: code, msg: msg} } dir, err := extractDirName(msg) if err != nil { return "", err } return dir, nil }
go
func (c *Client) Mkdir(path string) (string, error) { pconn, err := c.getIdleConn() if err != nil { return "", err } defer c.returnConn(pconn) code, msg, err := pconn.sendCommand("MKD %s", path) if err != nil { return "", err } if code != replyDirCreated { return "", ftpError{code: code, msg: msg} } dir, err := extractDirName(msg) if err != nil { return "", err } return dir, nil }
[ "func", "(", "c", "*", "Client", ")", "Mkdir", "(", "path", "string", ")", "(", "string", ",", "error", ")", "{", "pconn", ",", "err", ":=", "c", ".", "getIdleConn", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "err", "\n", "}", "\n\n", "defer", "c", ".", "returnConn", "(", "pconn", ")", "\n\n", "code", ",", "msg", ",", "err", ":=", "pconn", ".", "sendCommand", "(", "\"", "\"", ",", "path", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "err", "\n", "}", "\n\n", "if", "code", "!=", "replyDirCreated", "{", "return", "\"", "\"", ",", "ftpError", "{", "code", ":", "code", ",", "msg", ":", "msg", "}", "\n", "}", "\n\n", "dir", ",", "err", ":=", "extractDirName", "(", "msg", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "err", "\n", "}", "\n\n", "return", "dir", ",", "nil", "\n", "}" ]
// Mkdir creates directory "path". The returned string is how the client // should refer to the created directory.
[ "Mkdir", "creates", "directory", "path", ".", "The", "returned", "string", "is", "how", "the", "client", "should", "refer", "to", "the", "created", "directory", "." ]
012609e90524f0bfde77100facdc47f807794c27
https://github.com/secsy/goftp/blob/012609e90524f0bfde77100facdc47f807794c27/file_system.go#L52-L75
train
secsy/goftp
transfer.go
Retrieve
func (c *Client) Retrieve(path string, dest io.Writer) error { // fetch file size to check against how much we transferred size, err := c.size(path) if err != nil { return err } canResume := c.canResume() var bytesSoFar int64 for { n, err := c.transferFromOffset(path, dest, nil, bytesSoFar) bytesSoFar += n if err == nil { break } else if n == 0 { return err } else if !canResume { return ftpError{ err: fmt.Errorf("%s (can't resume)", err), temporary: true, } } } if size != -1 && bytesSoFar != size { return ftpError{ err: fmt.Errorf("expected %d bytes, got %d", size, bytesSoFar), temporary: true, } } return nil }
go
func (c *Client) Retrieve(path string, dest io.Writer) error { // fetch file size to check against how much we transferred size, err := c.size(path) if err != nil { return err } canResume := c.canResume() var bytesSoFar int64 for { n, err := c.transferFromOffset(path, dest, nil, bytesSoFar) bytesSoFar += n if err == nil { break } else if n == 0 { return err } else if !canResume { return ftpError{ err: fmt.Errorf("%s (can't resume)", err), temporary: true, } } } if size != -1 && bytesSoFar != size { return ftpError{ err: fmt.Errorf("expected %d bytes, got %d", size, bytesSoFar), temporary: true, } } return nil }
[ "func", "(", "c", "*", "Client", ")", "Retrieve", "(", "path", "string", ",", "dest", "io", ".", "Writer", ")", "error", "{", "// fetch file size to check against how much we transferred", "size", ",", "err", ":=", "c", ".", "size", "(", "path", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "canResume", ":=", "c", ".", "canResume", "(", ")", "\n\n", "var", "bytesSoFar", "int64", "\n", "for", "{", "n", ",", "err", ":=", "c", ".", "transferFromOffset", "(", "path", ",", "dest", ",", "nil", ",", "bytesSoFar", ")", "\n\n", "bytesSoFar", "+=", "n", "\n\n", "if", "err", "==", "nil", "{", "break", "\n", "}", "else", "if", "n", "==", "0", "{", "return", "err", "\n", "}", "else", "if", "!", "canResume", "{", "return", "ftpError", "{", "err", ":", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", ",", "temporary", ":", "true", ",", "}", "\n", "}", "\n", "}", "\n\n", "if", "size", "!=", "-", "1", "&&", "bytesSoFar", "!=", "size", "{", "return", "ftpError", "{", "err", ":", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "size", ",", "bytesSoFar", ")", ",", "temporary", ":", "true", ",", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Retrieve file "path" from server and write bytes to "dest". If the // server supports resuming stream transfers, Retrieve will continue // resuming a failed download as long as it continues making progress. // Retrieve will also verify the file's size after the transfer if the // server supports the SIZE command.
[ "Retrieve", "file", "path", "from", "server", "and", "write", "bytes", "to", "dest", ".", "If", "the", "server", "supports", "resuming", "stream", "transfers", "Retrieve", "will", "continue", "resuming", "a", "failed", "download", "as", "long", "as", "it", "continues", "making", "progress", ".", "Retrieve", "will", "also", "verify", "the", "file", "s", "size", "after", "the", "transfer", "if", "the", "server", "supports", "the", "SIZE", "command", "." ]
012609e90524f0bfde77100facdc47f807794c27
https://github.com/secsy/goftp/blob/012609e90524f0bfde77100facdc47f807794c27/transfer.go#L19-L54
train
secsy/goftp
transfer.go
size
func (c *Client) size(path string) (int64, error) { pconn, err := c.getIdleConn() if err != nil { return -1, err } defer c.returnConn(pconn) if !pconn.hasFeature("SIZE") { pconn.debug("server doesn't support SIZE") return -1, nil } if err = pconn.setType("I"); err != nil { return 0, err } code, msg, err := pconn.sendCommand("SIZE %s", path) if err != nil { return -1, err } if code != replyFileStatus { pconn.debug("unexpected SIZE response: %d (%s)", code, msg) return -1, nil } size, err := strconv.ParseInt(msg, 10, 64) if err != nil { pconn.debug(`failed parsing SIZE response "%s": %s`, msg, err) return -1, nil } return size, nil }
go
func (c *Client) size(path string) (int64, error) { pconn, err := c.getIdleConn() if err != nil { return -1, err } defer c.returnConn(pconn) if !pconn.hasFeature("SIZE") { pconn.debug("server doesn't support SIZE") return -1, nil } if err = pconn.setType("I"); err != nil { return 0, err } code, msg, err := pconn.sendCommand("SIZE %s", path) if err != nil { return -1, err } if code != replyFileStatus { pconn.debug("unexpected SIZE response: %d (%s)", code, msg) return -1, nil } size, err := strconv.ParseInt(msg, 10, 64) if err != nil { pconn.debug(`failed parsing SIZE response "%s": %s`, msg, err) return -1, nil } return size, nil }
[ "func", "(", "c", "*", "Client", ")", "size", "(", "path", "string", ")", "(", "int64", ",", "error", ")", "{", "pconn", ",", "err", ":=", "c", ".", "getIdleConn", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "-", "1", ",", "err", "\n", "}", "\n\n", "defer", "c", ".", "returnConn", "(", "pconn", ")", "\n\n", "if", "!", "pconn", ".", "hasFeature", "(", "\"", "\"", ")", "{", "pconn", ".", "debug", "(", "\"", "\"", ")", "\n", "return", "-", "1", ",", "nil", "\n", "}", "\n\n", "if", "err", "=", "pconn", ".", "setType", "(", "\"", "\"", ")", ";", "err", "!=", "nil", "{", "return", "0", ",", "err", "\n", "}", "\n\n", "code", ",", "msg", ",", "err", ":=", "pconn", ".", "sendCommand", "(", "\"", "\"", ",", "path", ")", "\n", "if", "err", "!=", "nil", "{", "return", "-", "1", ",", "err", "\n", "}", "\n\n", "if", "code", "!=", "replyFileStatus", "{", "pconn", ".", "debug", "(", "\"", "\"", ",", "code", ",", "msg", ")", "\n", "return", "-", "1", ",", "nil", "\n", "}", "\n\n", "size", ",", "err", ":=", "strconv", ".", "ParseInt", "(", "msg", ",", "10", ",", "64", ")", "\n", "if", "err", "!=", "nil", "{", "pconn", ".", "debug", "(", "`failed parsing SIZE response \"%s\": %s`", ",", "msg", ",", "err", ")", "\n", "return", "-", "1", ",", "nil", "\n", "}", "\n\n", "return", "size", ",", "nil", "\n", "}" ]
// Fetch SIZE of file. Returns error only on underlying connection error. // If the server doesn't support size, it returns -1 and no error.
[ "Fetch", "SIZE", "of", "file", ".", "Returns", "error", "only", "on", "underlying", "connection", "error", ".", "If", "the", "server", "doesn", "t", "support", "size", "it", "returns", "-", "1", "and", "no", "error", "." ]
012609e90524f0bfde77100facdc47f807794c27
https://github.com/secsy/goftp/blob/012609e90524f0bfde77100facdc47f807794c27/transfer.go#L224-L258
train
secsy/goftp
client.go
newClient
func newClient(config Config, hosts []string) *Client { if config.ConnectionsPerHost <= 0 { config.ConnectionsPerHost = 5 } if config.Timeout <= 0 { config.Timeout = 5 * time.Second } if config.User == "" { config.User = "anonymous" } if config.Password == "" { config.Password = "anonymous" } if config.ServerLocation == nil { config.ServerLocation = time.UTC } if config.ActiveListenAddr == "" { config.ActiveListenAddr = ":0" } return &Client{ config: config, freeConnCh: make(chan *persistentConn, len(hosts)*config.ConnectionsPerHost), t0: time.Now(), hosts: hosts, allCons: make(map[int]*persistentConn), numConnsPerHost: make(map[string]int), } }
go
func newClient(config Config, hosts []string) *Client { if config.ConnectionsPerHost <= 0 { config.ConnectionsPerHost = 5 } if config.Timeout <= 0 { config.Timeout = 5 * time.Second } if config.User == "" { config.User = "anonymous" } if config.Password == "" { config.Password = "anonymous" } if config.ServerLocation == nil { config.ServerLocation = time.UTC } if config.ActiveListenAddr == "" { config.ActiveListenAddr = ":0" } return &Client{ config: config, freeConnCh: make(chan *persistentConn, len(hosts)*config.ConnectionsPerHost), t0: time.Now(), hosts: hosts, allCons: make(map[int]*persistentConn), numConnsPerHost: make(map[string]int), } }
[ "func", "newClient", "(", "config", "Config", ",", "hosts", "[", "]", "string", ")", "*", "Client", "{", "if", "config", ".", "ConnectionsPerHost", "<=", "0", "{", "config", ".", "ConnectionsPerHost", "=", "5", "\n", "}", "\n\n", "if", "config", ".", "Timeout", "<=", "0", "{", "config", ".", "Timeout", "=", "5", "*", "time", ".", "Second", "\n", "}", "\n\n", "if", "config", ".", "User", "==", "\"", "\"", "{", "config", ".", "User", "=", "\"", "\"", "\n", "}", "\n\n", "if", "config", ".", "Password", "==", "\"", "\"", "{", "config", ".", "Password", "=", "\"", "\"", "\n", "}", "\n\n", "if", "config", ".", "ServerLocation", "==", "nil", "{", "config", ".", "ServerLocation", "=", "time", ".", "UTC", "\n", "}", "\n\n", "if", "config", ".", "ActiveListenAddr", "==", "\"", "\"", "{", "config", ".", "ActiveListenAddr", "=", "\"", "\"", "\n", "}", "\n\n", "return", "&", "Client", "{", "config", ":", "config", ",", "freeConnCh", ":", "make", "(", "chan", "*", "persistentConn", ",", "len", "(", "hosts", ")", "*", "config", ".", "ConnectionsPerHost", ")", ",", "t0", ":", "time", ".", "Now", "(", ")", ",", "hosts", ":", "hosts", ",", "allCons", ":", "make", "(", "map", "[", "int", "]", "*", "persistentConn", ")", ",", "numConnsPerHost", ":", "make", "(", "map", "[", "string", "]", "int", ")", ",", "}", "\n", "}" ]
// Construct and return a new client Conn, setting default config // values as necessary.
[ "Construct", "and", "return", "a", "new", "client", "Conn", "setting", "default", "config", "values", "as", "necessary", "." ]
012609e90524f0bfde77100facdc47f807794c27
https://github.com/secsy/goftp/blob/012609e90524f0bfde77100facdc47f807794c27/client.go#L175-L209
train
secsy/goftp
client.go
Close
func (c *Client) Close() error { c.mu.Lock() if c.closed { c.mu.Unlock() return ftpError{err: errors.New("already closed")} } c.closed = true var conns []*persistentConn for _, conn := range c.allCons { conns = append(conns, conn) } c.mu.Unlock() for _, pconn := range conns { c.removeConn(pconn) } return nil }
go
func (c *Client) Close() error { c.mu.Lock() if c.closed { c.mu.Unlock() return ftpError{err: errors.New("already closed")} } c.closed = true var conns []*persistentConn for _, conn := range c.allCons { conns = append(conns, conn) } c.mu.Unlock() for _, pconn := range conns { c.removeConn(pconn) } return nil }
[ "func", "(", "c", "*", "Client", ")", "Close", "(", ")", "error", "{", "c", ".", "mu", ".", "Lock", "(", ")", "\n", "if", "c", ".", "closed", "{", "c", ".", "mu", ".", "Unlock", "(", ")", "\n", "return", "ftpError", "{", "err", ":", "errors", ".", "New", "(", "\"", "\"", ")", "}", "\n", "}", "\n", "c", ".", "closed", "=", "true", "\n\n", "var", "conns", "[", "]", "*", "persistentConn", "\n", "for", "_", ",", "conn", ":=", "range", "c", ".", "allCons", "{", "conns", "=", "append", "(", "conns", ",", "conn", ")", "\n", "}", "\n", "c", ".", "mu", ".", "Unlock", "(", ")", "\n\n", "for", "_", ",", "pconn", ":=", "range", "conns", "{", "c", ".", "removeConn", "(", "pconn", ")", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Close closes all open server connections. Currently this does not attempt // to do any kind of polite FTP connection termination. It will interrupt // all transfers in progress.
[ "Close", "closes", "all", "open", "server", "connections", ".", "Currently", "this", "does", "not", "attempt", "to", "do", "any", "kind", "of", "polite", "FTP", "connection", "termination", ".", "It", "will", "interrupt", "all", "transfers", "in", "progress", "." ]
012609e90524f0bfde77100facdc47f807794c27
https://github.com/secsy/goftp/blob/012609e90524f0bfde77100facdc47f807794c27/client.go#L214-L233
train