armserialconsole

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: MIT Imports: 12 Imported by: 1

README

Azure Serial Console Module for Go

PkgGoDev

The armserialconsole module provides operations for working with Azure Serial Console.

Source code

Getting started

Prerequisites

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Serial Console module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/serialconsole/armserialconsole

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Serial Console. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Clients

Azure Serial Console modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential.

client, err := armserialconsole.NewSerialPortsClient(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
client, err := armserialconsole.NewSerialPortsClient(<subscription ID>, cred, &options)

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Serial Console label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudError

type CloudError struct {
	// Cloud error body.
	Error *CloudErrorBody `json:"error,omitempty"`
}

CloudError - An error response from the service.

type CloudErrorBody

type CloudErrorBody struct {
	// An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
	Code *string `json:"code,omitempty"`

	// A list of additional details about the error.
	Details []*CloudErrorBody `json:"details,omitempty"`

	// A message describing the error, intended to be suitable for display in a user interface.
	Message *string `json:"message,omitempty"`

	// The target of the particular error. For example, the name of the property in error.
	Target *string `json:"target,omitempty"`
}

CloudErrorBody - An error response from the Batch service.

type DisableSerialConsoleResult

type DisableSerialConsoleResult struct {
	// Whether or not Serial Console is disabled.
	Disabled *bool `json:"disabled,omitempty"`
}

DisableSerialConsoleResult - Returns whether or not Serial Console is disabled.

type EnableSerialConsoleResult

type EnableSerialConsoleResult struct {
	// Whether or not Serial Console is disabled (enabled).
	Disabled *bool `json:"disabled,omitempty"`
}

EnableSerialConsoleResult - Returns whether or not Serial Console is disabled (enabled).

type GetSerialConsoleSubscriptionNotFound

type GetSerialConsoleSubscriptionNotFound struct {
	// Error code
	Code *string `json:"code,omitempty"`

	// Subscription not found message
	Message *string `json:"message,omitempty"`
}

GetSerialConsoleSubscriptionNotFound - Error saying that the provided subscription could not be found

type MicrosoftSerialConsoleClient

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

MicrosoftSerialConsoleClient contains the methods for the MicrosoftSerialConsoleClient group. Don't use this type directly, use NewMicrosoftSerialConsoleClient() instead.

func NewMicrosoftSerialConsoleClient

func NewMicrosoftSerialConsoleClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MicrosoftSerialConsoleClient, error)

NewMicrosoftSerialConsoleClient creates a new instance of MicrosoftSerialConsoleClient with the specified values. subscriptionID - Subscription ID which uniquely identifies the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call requiring it. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*MicrosoftSerialConsoleClient) DisableConsole

DisableConsole - Disables the Serial Console service for all VMs and VM scale sets in the provided subscription If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-05-01 defaultParam - Default parameter. Leave the value as "default". options - MicrosoftSerialConsoleClientDisableConsoleOptions contains the optional parameters for the MicrosoftSerialConsoleClient.DisableConsole method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/serialconsole/resource-manager/Microsoft.SerialConsole/stable/2018-05-01/examples/DisableConsoleExamples.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/serialconsole/armserialconsole"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armserialconsole.NewMicrosoftSerialConsoleClient("00000000-00000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.DisableConsole(ctx,
		"default",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*MicrosoftSerialConsoleClient) EnableConsole

EnableConsole - Enables the Serial Console service for all VMs and VM scale sets in the provided subscription If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-05-01 defaultParam - Default parameter. Leave the value as "default". options - MicrosoftSerialConsoleClientEnableConsoleOptions contains the optional parameters for the MicrosoftSerialConsoleClient.EnableConsole method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/serialconsole/resource-manager/Microsoft.SerialConsole/stable/2018-05-01/examples/EnableConsoleExamples.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/serialconsole/armserialconsole"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armserialconsole.NewMicrosoftSerialConsoleClient("00000000-00000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.EnableConsole(ctx,
		"default",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*MicrosoftSerialConsoleClient) GetConsoleStatus

GetConsoleStatus - Gets whether or not Serial Console is disabled for a given subscription If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-05-01 defaultParam - Default parameter. Leave the value as "default". options - MicrosoftSerialConsoleClientGetConsoleStatusOptions contains the optional parameters for the MicrosoftSerialConsoleClient.GetConsoleStatus method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/serialconsole/resource-manager/Microsoft.SerialConsole/stable/2018-05-01/examples/SerialConsoleStatus.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/serialconsole/armserialconsole"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armserialconsole.NewMicrosoftSerialConsoleClient("00000000-00000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.GetConsoleStatus(ctx,
		"default",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*MicrosoftSerialConsoleClient) ListOperations

ListOperations - Gets a list of Serial Console API operations. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-05-01 options - MicrosoftSerialConsoleClientListOperationsOptions contains the optional parameters for the MicrosoftSerialConsoleClient.ListOperations method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/serialconsole/resource-manager/Microsoft.SerialConsole/stable/2018-05-01/examples/GetOperationsExample.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/serialconsole/armserialconsole"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armserialconsole.NewMicrosoftSerialConsoleClient("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.ListOperations(ctx,
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

type MicrosoftSerialConsoleClientDisableConsoleOptions

type MicrosoftSerialConsoleClientDisableConsoleOptions struct {
}

MicrosoftSerialConsoleClientDisableConsoleOptions contains the optional parameters for the MicrosoftSerialConsoleClient.DisableConsole method.

type MicrosoftSerialConsoleClientDisableConsoleResponse

type MicrosoftSerialConsoleClientDisableConsoleResponse struct {
	// // Possible types are DisableSerialConsoleResult, GetSerialConsoleSubscriptionNotFound
	Value interface{}
}

MicrosoftSerialConsoleClientDisableConsoleResponse contains the response from method MicrosoftSerialConsoleClient.DisableConsole.

type MicrosoftSerialConsoleClientEnableConsoleOptions

type MicrosoftSerialConsoleClientEnableConsoleOptions struct {
}

MicrosoftSerialConsoleClientEnableConsoleOptions contains the optional parameters for the MicrosoftSerialConsoleClient.EnableConsole method.

type MicrosoftSerialConsoleClientEnableConsoleResponse

type MicrosoftSerialConsoleClientEnableConsoleResponse struct {
	// // Possible types are EnableSerialConsoleResult, GetSerialConsoleSubscriptionNotFound
	Value interface{}
}

MicrosoftSerialConsoleClientEnableConsoleResponse contains the response from method MicrosoftSerialConsoleClient.EnableConsole.

type MicrosoftSerialConsoleClientGetConsoleStatusOptions

type MicrosoftSerialConsoleClientGetConsoleStatusOptions struct {
}

MicrosoftSerialConsoleClientGetConsoleStatusOptions contains the optional parameters for the MicrosoftSerialConsoleClient.GetConsoleStatus method.

type MicrosoftSerialConsoleClientGetConsoleStatusResponse

type MicrosoftSerialConsoleClientGetConsoleStatusResponse struct {
	// // Possible types are Status, GetSerialConsoleSubscriptionNotFound
	Value interface{}
}

MicrosoftSerialConsoleClientGetConsoleStatusResponse contains the response from method MicrosoftSerialConsoleClient.GetConsoleStatus.

type MicrosoftSerialConsoleClientListOperationsOptions

type MicrosoftSerialConsoleClientListOperationsOptions struct {
}

MicrosoftSerialConsoleClientListOperationsOptions contains the optional parameters for the MicrosoftSerialConsoleClient.ListOperations method.

type MicrosoftSerialConsoleClientListOperationsResponse

type MicrosoftSerialConsoleClientListOperationsResponse struct {
	Operations
}

MicrosoftSerialConsoleClientListOperationsResponse contains the response from method MicrosoftSerialConsoleClient.ListOperations.

type Operations added in v0.2.0

type Operations struct {
	// A list of Serial Console operations
	Value []*OperationsValueItem `json:"value,omitempty"`
}

Operations - Serial Console operations

type OperationsValueItem added in v0.2.0

type OperationsValueItem struct {
	Display      *OperationsValueItemDisplay `json:"display,omitempty"`
	IsDataAction *string                     `json:"isDataAction,omitempty"`
	Name         *string                     `json:"name,omitempty"`
}

type OperationsValueItemDisplay added in v0.2.0

type OperationsValueItemDisplay struct {
	Description *string `json:"description,omitempty"`
	Operation   *string `json:"operation,omitempty"`
	Provider    *string `json:"provider,omitempty"`
	Resource    *string `json:"resource,omitempty"`
}

type ProxyResource

type ProxyResource struct {
	// READ-ONLY; Resource Id
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type
	Type *string `json:"type,omitempty" azure:"ro"`
}

ProxyResource - The resource model definition for a ARM proxy resource. It will have everything other than required location and tags

type Resource

type Resource struct {
	// READ-ONLY; Resource Id
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type
	Type *string `json:"type,omitempty" azure:"ro"`
}

Resource - The Resource model definition.

type SerialPort

type SerialPort struct {
	// The properties of the serial port.
	Properties *SerialPortProperties `json:"properties,omitempty"`

	// READ-ONLY; Resource Id
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type
	Type *string `json:"type,omitempty" azure:"ro"`
}

SerialPort - Represents the serial port of the parent resource.

type SerialPortConnectResult

type SerialPortConnectResult struct {
	// Connection string to the serial port of the resource.
	ConnectionString *string `json:"connectionString,omitempty"`
}

SerialPortConnectResult - Returns a connection string to the serial port of the resource.

type SerialPortListResult

type SerialPortListResult struct {
	// The list of serial ports.
	Value []*SerialPort `json:"value,omitempty"`
}

SerialPortListResult - The list serial ports operation response.

type SerialPortProperties

type SerialPortProperties struct {
	// Specifies whether the port is enabled for a serial console connection.
	State *SerialPortState `json:"state,omitempty"`
}

SerialPortProperties - The properties of the serial port.

type SerialPortState

type SerialPortState string

SerialPortState - Specifies whether the port is enabled for a serial console connection.

const (
	SerialPortStateEnabled  SerialPortState = "enabled"
	SerialPortStateDisabled SerialPortState = "disabled"
)

func PossibleSerialPortStateValues

func PossibleSerialPortStateValues() []SerialPortState

PossibleSerialPortStateValues returns the possible values for the SerialPortState const type.

type SerialPortsClient

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

SerialPortsClient contains the methods for the SerialPorts group. Don't use this type directly, use NewSerialPortsClient() instead.

func NewSerialPortsClient

func NewSerialPortsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SerialPortsClient, error)

NewSerialPortsClient creates a new instance of SerialPortsClient with the specified values. subscriptionID - Subscription ID which uniquely identifies the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call requiring it. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*SerialPortsClient) Connect

func (client *SerialPortsClient) Connect(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourceType string, parentResource string, serialPort string, options *SerialPortsClientConnectOptions) (SerialPortsClientConnectResponse, error)

Connect - Connect to serial port of the target resource If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-05-01 resourceGroupName - The name of the resource group. resourceProviderNamespace - The namespace of the resource provider. parentResourceType - The resource type of the parent resource. For example: 'virtualMachines' or 'virtualMachineScaleSets' parentResource - The resource name, or subordinate path, for the parent of the serial port. For example: the name of the virtual machine. serialPort - The name of the serial port to connect to. options - SerialPortsClientConnectOptions contains the optional parameters for the SerialPortsClient.Connect method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/serialconsole/resource-manager/Microsoft.SerialConsole/stable/2018-05-01/examples/SerialPortConnectVMSS.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/serialconsole/armserialconsole"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armserialconsole.NewSerialPortsClient("00000000-00000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Connect(ctx,
		"myResourceGroup",
		"Microsoft.Compute",
		"virtualMachineScaleSets",
		"myscaleset/virtualMachines/2",
		"0",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*SerialPortsClient) Create

func (client *SerialPortsClient) Create(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourceType string, parentResource string, serialPort string, parameters SerialPort, options *SerialPortsClientCreateOptions) (SerialPortsClientCreateResponse, error)

Create - Creates or updates a serial port If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-05-01 resourceGroupName - The name of the resource group. resourceProviderNamespace - The namespace of the resource provider. parentResourceType - The resource type of the parent resource. For example: 'virtualMachines' or 'virtualMachineScaleSets' parentResource - The resource name, or subordinate path, for the parent of the serial port. For example: the name of the virtual machine. serialPort - The name of the serial port to create. parameters - Parameters supplied to create the serial port. options - SerialPortsClientCreateOptions contains the optional parameters for the SerialPortsClient.Create method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/serialconsole/resource-manager/Microsoft.SerialConsole/stable/2018-05-01/examples/CreateSerialPort.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/serialconsole/armserialconsole"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armserialconsole.NewSerialPortsClient("00000000-00000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = client.Create(ctx,
		"myResourceGroup",
		"Microsoft.Compute",
		"virtualMachines",
		"myVM",
		"0",
		armserialconsole.SerialPort{
			Properties: &armserialconsole.SerialPortProperties{
				State: to.Ptr(armserialconsole.SerialPortStateEnabled),
			},
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*SerialPortsClient) Delete

func (client *SerialPortsClient) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourceType string, parentResource string, serialPort string, options *SerialPortsClientDeleteOptions) (SerialPortsClientDeleteResponse, error)

Delete - Deletes a serial port If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-05-01 resourceGroupName - The name of the resource group. resourceProviderNamespace - The namespace of the resource provider. parentResourceType - The resource type of the parent resource. For example: 'virtualMachines' or 'virtualMachineScaleSets' parentResource - The resource name, or subordinate path, for the parent of the serial port. For example: the name of the virtual machine. serialPort - The name of the serial port to delete. options - SerialPortsClientDeleteOptions contains the optional parameters for the SerialPortsClient.Delete method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/serialconsole/resource-manager/Microsoft.SerialConsole/stable/2018-05-01/examples/DeleteSerialPort.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/serialconsole/armserialconsole"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armserialconsole.NewSerialPortsClient("00000000-00000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = client.Delete(ctx,
		"myResourceGroup",
		"Microsoft.Compute",
		"virtualMachines",
		"myVM",
		"0",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*SerialPortsClient) Get

func (client *SerialPortsClient) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourceType string, parentResource string, serialPort string, options *SerialPortsClientGetOptions) (SerialPortsClientGetResponse, error)

Get - Gets the configured settings for a serial port If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-05-01 resourceGroupName - The name of the resource group. resourceProviderNamespace - The namespace of the resource provider. parentResourceType - The resource type of the parent resource. For example: 'virtualMachines' or 'virtualMachineScaleSets' parentResource - The resource name, or subordinate path, for the parent of the serial port. For example: the name of the virtual machine. serialPort - The name of the serial port to connect to. options - SerialPortsClientGetOptions contains the optional parameters for the SerialPortsClient.Get method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/serialconsole/resource-manager/Microsoft.SerialConsole/stable/2018-05-01/examples/GetSerialPort.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/serialconsole/armserialconsole"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armserialconsole.NewSerialPortsClient("00000000-00000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx,
		"myResourceGroup",
		"Microsoft.Compute",
		"virtualMachines",
		"myVM",
		"0",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*SerialPortsClient) List

func (client *SerialPortsClient) List(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourceType string, parentResource string, options *SerialPortsClientListOptions) (SerialPortsClientListResponse, error)

List - Lists all of the configured serial ports for a parent resource If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-05-01 resourceGroupName - The name of the resource group. resourceProviderNamespace - The namespace of the resource provider. parentResourceType - The resource type of the parent resource. For example: 'virtualMachines' or 'virtualMachineScaleSets' parentResource - The resource name, or subordinate path, for the parent of the serial port. For example: the name of the virtual machine. options - SerialPortsClientListOptions contains the optional parameters for the SerialPortsClient.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/serialconsole/resource-manager/Microsoft.SerialConsole/stable/2018-05-01/examples/ListSerialPort.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/serialconsole/armserialconsole"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armserialconsole.NewSerialPortsClient("00000000-00000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.List(ctx,
		"myResourceGroup",
		"Microsoft.Compute",
		"virtualMachines",
		"myVM",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*SerialPortsClient) ListBySubscriptions

ListBySubscriptions - Handles requests to list all SerialPort resources in a subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-05-01 options - SerialPortsClientListBySubscriptionsOptions contains the optional parameters for the SerialPortsClient.ListBySubscriptions method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/serialconsole/resource-manager/Microsoft.SerialConsole/stable/2018-05-01/examples/ListSerialPortSubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/serialconsole/armserialconsole"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armserialconsole.NewSerialPortsClient("00000000-00000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.ListBySubscriptions(ctx,
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

type SerialPortsClientConnectOptions added in v0.2.0

type SerialPortsClientConnectOptions struct {
}

SerialPortsClientConnectOptions contains the optional parameters for the SerialPortsClient.Connect method.

type SerialPortsClientConnectResponse added in v0.2.0

type SerialPortsClientConnectResponse struct {
	SerialPortConnectResult
}

SerialPortsClientConnectResponse contains the response from method SerialPortsClient.Connect.

type SerialPortsClientCreateOptions added in v0.2.0

type SerialPortsClientCreateOptions struct {
}

SerialPortsClientCreateOptions contains the optional parameters for the SerialPortsClient.Create method.

type SerialPortsClientCreateResponse added in v0.2.0

type SerialPortsClientCreateResponse struct {
	SerialPort
}

SerialPortsClientCreateResponse contains the response from method SerialPortsClient.Create.

type SerialPortsClientDeleteOptions added in v0.2.0

type SerialPortsClientDeleteOptions struct {
}

SerialPortsClientDeleteOptions contains the optional parameters for the SerialPortsClient.Delete method.

type SerialPortsClientDeleteResponse added in v0.2.0

type SerialPortsClientDeleteResponse struct {
}

SerialPortsClientDeleteResponse contains the response from method SerialPortsClient.Delete.

type SerialPortsClientGetOptions added in v0.2.0

type SerialPortsClientGetOptions struct {
}

SerialPortsClientGetOptions contains the optional parameters for the SerialPortsClient.Get method.

type SerialPortsClientGetResponse added in v0.2.0

type SerialPortsClientGetResponse struct {
	SerialPort
}

SerialPortsClientGetResponse contains the response from method SerialPortsClient.Get.

type SerialPortsClientListBySubscriptionsOptions added in v0.2.0

type SerialPortsClientListBySubscriptionsOptions struct {
}

SerialPortsClientListBySubscriptionsOptions contains the optional parameters for the SerialPortsClient.ListBySubscriptions method.

type SerialPortsClientListBySubscriptionsResponse added in v0.2.0

type SerialPortsClientListBySubscriptionsResponse struct {
	SerialPortListResult
}

SerialPortsClientListBySubscriptionsResponse contains the response from method SerialPortsClient.ListBySubscriptions.

type SerialPortsClientListOptions added in v0.2.0

type SerialPortsClientListOptions struct {
}

SerialPortsClientListOptions contains the optional parameters for the SerialPortsClient.List method.

type SerialPortsClientListResponse added in v0.2.0

type SerialPortsClientListResponse struct {
	SerialPortListResult
}

SerialPortsClientListResponse contains the response from method SerialPortsClient.List.

type Status added in v0.2.0

type Status struct {
	// Whether or not Serial Console is disabled.
	Disabled *bool `json:"disabled,omitempty"`
}

Status - Returns whether or not Serial Console is disabled.

Jump to

Keyboard shortcuts

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