Coder Social home page Coder Social logo

Comments (2)

jhorwit2 avatar jhorwit2 commented on June 1, 2024

In order to use VolumeAttachmentDetails I had to copy the private struct into my project.

type AttachVolumeDetails struct {
	InstanceID  *string `mandatory:"true" json:"instanceId,omitempty"`
	VolumeID    *string `mandatory:"true" json:"volumeId,omitempty"`
	DisplayName *string `mandatory:"false" json:"displayName,omitempty"`
	Type        string  `json:"type"`
}

func (m AttachVolumeDetails) GetInstanceID() *string {
	return m.InstanceID
}
func (m AttachVolumeDetails) GetVolumeID() *string {
	return m.VolumeID
}
func (m AttachVolumeDetails) GetDisplayName() *string {
	return m.DisplayName
}

so I could call

coreClient.AttachVolume(ctx, core.AttachVolumeRequest{
	AttachVolumeDetails: AttachVolumeDetails{
		InstanceID:  &instance.Status.ID,
		VolumeID:    &instance.Status.VolumeID,
		DisplayName: &instance.Name,
	},
})

from oci-go-sdk.

eginez avatar eginez commented on June 1, 2024

Hi @jhorwit2, yes the documentation is a little light on this, I apologize.
Per the specificiation of the the service AttachVolumeDetails is polymorphic parameter that should at least contain the values listed in the interface.

Currently the only input parameter that the compute service supports for this call is the AttachIScsiVolumeDetails struct. AttachIScsiVolumeDetails implements the AttachVolumeDetails interface, thus you should not need access to the private structure

Your call could look like this:

core.AttachVolumeRequest(ctx,  core.AttachVolumeRequest{
                AttachVolumeDetails: core.AttachIScsiVolumeDetails{
		        InstanceID:  common.String("id"),
		        VolumeID:    common.String("volume"),
		        DisplayName: common.String("display"),
		        UseChap:     common.Bool(false),
	}
}

from oci-go-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.