virtualmachines

package
v1.6.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package virtualmachines serves Azure ARM Microsoft.Compute/virtualMachines requests against a CloudEmu compute driver. Real azure-sdk-for-go clients configured with a custom endpoint hit this handler the same way they hit management.azure.com.

Supported operations (instance lifecycle parity with AWS EC2):

PUT    .../virtualMachines/{name}        — CreateOrUpdate
GET    .../virtualMachines/{name}        — Get
GET    .../virtualMachines               — List in resource group
GET    .../providers/.../virtualMachines — List in subscription
DELETE .../virtualMachines/{name}        — Delete
POST   .../virtualMachines/{name}/start  — Start
POST   .../virtualMachines/{name}/powerOff — Stop
POST   .../virtualMachines/{name}/restart — Restart

Less-used operations (capture, deallocate, instance view, redeploy, etc.) are not yet wired and will return 501 Not Implemented.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler serves ARM JSON requests for Microsoft.Compute/virtualMachines.

func New

New returns a virtualMachines handler backed by c.

func (*Handler) Matches

func (*Handler) Matches(r *http.Request) bool

Matches returns true for ARM URLs targeting Microsoft.Compute/virtualMachines or our async-operation status endpoints.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP routes the request to the matching operation. Unrecognized combinations of (method, sub-resource) return 501 so misuse is visible rather than swallowed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL