MCPcopy
hub / github.com/kubernetes/kops / Create

Method Create

pkg/resources/spotinst/aws.go:261–272  ·  view source on GitHub ↗

Create creates a new LaunchSpec and returns its ID.

(ctx context.Context, spec LaunchSpec)

Source from the content-addressed store, hash-verified

259
260// Create creates a new LaunchSpec and returns its ID.
261func (x *awsOceanLaunchSpecService) Create(ctx context.Context, spec LaunchSpec) (string, error) {
262 input := &awsoc.CreateLaunchSpecInput{
263 LaunchSpec: spec.Obj().(*awsoc.LaunchSpec),
264 }
265
266 output, err := x.svc.CreateLaunchSpec(ctx, input)
267 if err != nil {
268 return "", err
269 }
270
271 return fi.ValueOf(output.LaunchSpec.ID), nil
272}
273
274// Read returns an existing LaunchSpec by ID.
275func (x *awsOceanLaunchSpecService) Read(ctx context.Context, specID string) (LaunchSpec, error) {

Callers

nothing calls this directly

Calls 2

ValueOfFunction · 0.92
ObjMethod · 0.65

Tested by

no test coverage detected