Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

api/v1: support image creation #39

Closed
wants to merge 1 commit into from

Conversation

tormath1
Copy link
Contributor

Hi,

In this PR we add the support for image creation in the V1 API.

Locally tested with:

image, err := client.CreateImage(&brightbox.ImageOptions{
	Arch:              "x86_64",
	CompatibilityMode: true,
	Description:       "test  flatcar",
	MinRam:            2048,
	Name:              "test-flatcar",
	Public:            false,
	Username:          "core",
	HTTPURL:           "https://.../flatcar_production_openstack_image.img",
})
if err != nil {
	fmt.Println(err)
	return
}

fmt.Println(image)

NOTE: I don't know what's the current status of the V1 API as https://api.gb1.brightbox.com/ only proposes V1 ?

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
@NeilW
Copy link
Member

NeilW commented Nov 14, 2023

The V1 major version of the go module is deprecated. Users requiring more features should upgrade to the v2 major version.

v2 still uses Brightbox API v1 but with a more consistent interface.

Create image is at

func (c *Client) CreateImage(ctx context.Context, newImage ImageOptions) (*Image, error) {

@tormath1
Copy link
Contributor Author

Ah perfect thanks. I was thinking that v1 SDK was for v1 API and v2 SDK for an incoming v2 👌

@tormath1 tormath1 closed this Nov 14, 2023
@tormath1 tormath1 deleted the tormath1/create-image branch November 14, 2023 12:07
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants